pub struct ToolAskRule {
pub tool: String,
pub command: Option<String>,
pub path: Option<String>,
pub action: PermissionAction,
}Expand description
Typed rule that controls whether a tool invocation is denied, allowed, or requires approval.
The action field governs what happens when this rule matches:
"deny"— the tool call is blocked outright (highest priority)."ask"— the approval prompt is forced (default, backward compatible)."allow"— the tool call proceeds without asking.
Deny always wins over ask, which wins over allow. Command-prefix-based
deny and allow rules are promoted into the execution-policy engine’s
denied_prefixes / trusted_prefixes for arity-aware matching;
path-only rules are evaluated separately.
Fields§
§tool: StringName of the tool this rule applies to (e.g. "exec_shell", "edit_file").
command: Option<String>Optional command prefix to match against (uses arity-aware matching).
path: Option<String>Optional file path pattern to match against.
action: PermissionActionAction when this rule matches. Default: "ask" (backward compatible).
Implementations§
Trait Implementations§
Source§impl Clone for ToolAskRule
impl Clone for ToolAskRule
Source§fn clone(&self) -> ToolAskRule
fn clone(&self) -> ToolAskRule
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 moreSource§impl Debug for ToolAskRule
impl Debug for ToolAskRule
Source§impl<'de> Deserialize<'de> for ToolAskRule
impl<'de> Deserialize<'de> for ToolAskRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ToolAskRule
Source§impl PartialEq for ToolAskRule
impl PartialEq for ToolAskRule
Source§impl Serialize for ToolAskRule
impl Serialize for ToolAskRule
impl StructuralPartialEq for ToolAskRule
Auto Trait Implementations§
impl Freeze for ToolAskRule
impl RefUnwindSafe for ToolAskRule
impl Send for ToolAskRule
impl Sync for ToolAskRule
impl Unpin for ToolAskRule
impl UnsafeUnpin for ToolAskRule
impl UnwindSafe for ToolAskRule
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