pub enum Capability {
Show 14 variants
FileRead {
path_pattern: String,
},
FileWrite {
path_pattern: String,
},
FileEdit {
path_pattern: String,
},
FileList {
path_pattern: String,
},
FileFind {
path_pattern: String,
},
Bash {
allowed_commands: Vec<StringPattern>,
timeout_secs: Option<u64>,
},
Network {
allowed_domains: Vec<String>,
},
WebBrowse {
allowed_domains: Vec<String>,
},
Subagent {
max_children: Option<usize>,
},
BusRead {
channel: Option<String>,
},
BusWrite {
channel: Option<String>,
},
EnvRead {
allowed_vars: Vec<String>,
},
ToolUse {
tool_name: String,
},
McpAccess {
resource_patterns: Vec<String>,
},
}Expand description
A fine-grained permission that can be granted to an agent.
Each variant captures the specific resource and access level.
The Authorizer checks these at tool execution time.
Variants§
FileRead
Read files matching a glob pattern.
Fields
FileWrite
Write or create files matching a glob pattern.
Fields
FileEdit
Edit existing files matching a glob pattern.
FileList
List directory entries matching a glob pattern.
FileFind
Find files matching a glob pattern.
Bash
Execute a restricted set of shell commands.
Fields
allowed_commands: Vec<StringPattern>Command names or StringPattern matchers the agent is permitted to invoke.
Network
Make outbound network requests to a set of domains.
Fields
WebBrowse
Browse web pages on a set of domains.
Subagent
Spawn child agents as subagents.
Fields
BusRead
Read from an inter-agent message bus channel.
BusWrite
Write to an inter-agent message bus channel.
EnvRead
Read environment variables.
ToolUse
Invoke a named tool.
McpAccess
Access MCP server resources.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn satisfies(&self, required: &Capability) -> bool
pub fn satisfies(&self, required: &Capability) -> bool
Whether this capability satisfies (is at least as permissive as) required.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Capability
impl Debug for Capability
Source§impl<'de> Deserialize<'de> for Capability
impl<'de> Deserialize<'de> for Capability
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>,
impl Eq for Capability
Source§impl Hash for Capability
impl Hash for Capability
Source§impl PartialEq for Capability
impl PartialEq for Capability
Source§impl Serialize for Capability
impl Serialize for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.