pub struct ToolRule {
pub capability: Capability,
pub pattern: Option<String>,
pub action: ToolAction,
}Expand description
One tool-policy statement: action for capability, optionally narrowed by pattern.
Rules are kept in profile order, which carries no precedence: a broad rule against a scoped
one is the consuming harness’s call, and [EffectiveToolPolicy::project] settles only
capabilities one harness tool cannot tell apart.
Fields§
§capability: Capability§pattern: Option<String>Scope inside capability(...). None for * and mcp, whose scope is the capability.
action: ToolActionImplementations§
Source§impl ToolRule
impl ToolRule
pub fn from_parsed(parsed: ParsedToolName, action: ToolAction) -> Self
pub fn is_wildcard(&self) -> bool
pub fn is_mcp(&self) -> bool
Trait Implementations§
impl Eq for ToolRule
Source§impl Serialize for ToolRule
The rule’s wire shape, shared by the launch bundle’s tools.rules and agents show --json:
{capability, pattern, action}. capability is * for “every other tool” and
mcp for an MCP ref, whose pattern is its server/tool.
impl Serialize for ToolRule
The rule’s wire shape, shared by the launch bundle’s tools.rules and agents show --json:
{capability, pattern, action}. capability is * for “every other tool” and
mcp for an MCP ref, whose pattern is its server/tool.
impl StructuralPartialEq for ToolRule
Auto Trait Implementations§
impl Forget for ToolRule
impl Freeze for ToolRule
impl RefUnwindSafe for ToolRule
impl Send for ToolRule
impl Sync for ToolRule
impl Unpin for ToolRule
impl UnsafeUnpin for ToolRule
impl UnwindSafe for ToolRule
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.