pub enum Decision {
Deny,
Ask,
Allow,
}Expand description
The three-way outcome the engine can reach for a tool call. Ordered by
strictness for Decision::stricter (Deny strictest, Allow loosest)
— NOT by numeric severity in the tier-priority sense (which is a fixed
deny→ask→allow scan order, not a totally-ordered scale); the ordering
here exists purely to fold multiple sub-command decisions down to “the
single worst one wins”, the compound-safety invariant D-3/risk-1 demands.
Variants§
Deny
Refuse outright. A hard floor — never bypassed by an approval policy
or a cached “approve for session” grant (mirrors
Config::tool_deny_patterns’ existing precedent, config.rs).
Ask
Requires approval (interactive prompt, or a non-interactive
super::approval::PermissionsApprovalHandler).
Allow
Proceed without prompting.
Implementations§
Source§impl Decision
impl Decision
Sourcepub fn stricter(self, other: Decision) -> Decision
pub fn stricter(self, other: Decision) -> Decision
The stricter (lower-trust) of two decisions: Deny beats Ask beats
Allow. Used to fold a compound command’s per-sub-command decisions
into one (§5.3 risk 1: “a compound where ANY sub-command matches a
deny rule → the whole command is denied” — generalized here to “the
whole command is AT LEAST as strict as its strictest sub-command”).
Trait Implementations§
impl Copy for Decision
impl Eq for Decision
impl StructuralPartialEq for Decision
Auto Trait Implementations§
impl Freeze for Decision
impl RefUnwindSafe for Decision
impl Send for Decision
impl Sync for Decision
impl Unpin for Decision
impl UnsafeUnpin for Decision
impl UnwindSafe for Decision
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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
key and return true if they are equal.