pub struct AgentPermissions {
pub agent_name: String,
pub allowed_tools: HashSet<String>,
pub allowed_paths: Vec<String>,
pub denied_paths: Vec<String>,
pub network_access: bool,
pub max_execution_time_secs: u64,
pub max_memory_mb: u64,
pub can_fork: bool,
}Expand description
Permissions for a single agent.
Agents start with minimal permissions (least privilege). Additional permissions must be explicitly granted via configuration or an authorized request.
Fields§
§agent_name: StringName of the agent this permission set applies to.
allowed_tools: HashSet<String>Set of allowed tool names. Empty means no tools allowed.
allowed_paths: Vec<String>Allowed path patterns (glob). Used for file operations.
denied_paths: Vec<String>Denied path patterns (glob). Always blocked, even if allowed_paths matches.
network_access: boolWhether this agent can make network requests.
max_execution_time_secs: u64Maximum execution time in seconds (0 = unlimited).
max_memory_mb: u64Maximum memory in MB (0 = unlimited).
can_fork: boolWhether this agent can spawn sub-agents.
Implementations§
Source§impl AgentPermissions
impl AgentPermissions
Sourcepub fn for_new_agent(agent_name: &str) -> Self
pub fn for_new_agent(agent_name: &str) -> Self
Creates permissions for a new agent with the default restrictive set.
Sourcepub fn allow_tool(&mut self, tool: &str)
pub fn allow_tool(&mut self, tool: &str)
Adds a tool to the allowed set.
Sourcepub fn allow_path(&mut self, path: &str)
pub fn allow_path(&mut self, path: &str)
Adds a path pattern to the allowed set.
Sourcepub fn enable_network(&mut self)
pub fn enable_network(&mut self)
Enables network access for this agent.
Sourcepub fn enable_forking(&mut self)
pub fn enable_forking(&mut self)
Enables agent forking (spawning sub-agents).
Trait Implementations§
Source§impl Clone for AgentPermissions
impl Clone for AgentPermissions
Source§fn clone(&self) -> AgentPermissions
fn clone(&self) -> AgentPermissions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more