pub struct ToolRiskProfile {
pub untrusted_input: bool,
pub sensitive_access: bool,
pub state_changing: bool,
}Expand description
Declared risk properties of a tool, used by the Rule-of-Two check (A2).
All three default to false, so an undeclared tool is fully low-risk and provokes no
interception — behaviour is byte-for-byte identical to a framework without this rule.
Fields§
§untrusted_input: boolThe tool’s input originates from an untrusted external source (web page, retrieved document, raw user text).
sensitive_access: boolThe tool can touch sensitive resources (read files, open network connections).
state_changing: boolCalling the tool changes external world state (write DB, send mail, delete, pay).
Implementations§
Source§impl ToolRiskProfile
impl ToolRiskProfile
Sourcepub fn count_armed(&self) -> usize
pub fn count_armed(&self) -> usize
Number of declared (true) properties, in [0, 3].
The Rule of Two fires when this reaches 3: untrusted_input + sensitive_access + state_changing all present forms a complete actionable-harm chain.
Trait Implementations§
Source§impl Clone for ToolRiskProfile
impl Clone for ToolRiskProfile
Source§fn clone(&self) -> ToolRiskProfile
fn clone(&self) -> ToolRiskProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ToolRiskProfile
Source§impl Debug for ToolRiskProfile
impl Debug for ToolRiskProfile
Source§impl Default for ToolRiskProfile
impl Default for ToolRiskProfile
Source§fn default() -> ToolRiskProfile
fn default() -> ToolRiskProfile
Returns the “default value” for a type. Read more
impl Eq for ToolRiskProfile
Source§impl PartialEq for ToolRiskProfile
impl PartialEq for ToolRiskProfile
impl StructuralPartialEq for ToolRiskProfile
Auto Trait Implementations§
impl Freeze for ToolRiskProfile
impl RefUnwindSafe for ToolRiskProfile
impl Send for ToolRiskProfile
impl Sync for ToolRiskProfile
impl Unpin for ToolRiskProfile
impl UnsafeUnpin for ToolRiskProfile
impl UnwindSafe for ToolRiskProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.