pub struct AgentPermissions {
pub approval: Option<ApprovalPolicy>,
pub sandbox: Option<SandboxPolicy>,
pub auto_approved_tools: Option<Vec<String>>,
pub deny: Vec<String>,
}Expand description
BP-7 (catalog §4a “Named agent definitions as data”: “Agent = prompt+model+tools+permissions in a file/config”): the permission bundle a named definition may carry, the component the shape was missing.
Tightening only, by construction. Every field here can make a child
stricter than its parent and nothing here can make one looser: the
approval/sandbox values are applied through the same rank comparison
configfile::clamp_project_permissions uses for the untrusted project
layer (a looser value is ignored, not honored), auto_approved_tools is
INTERSECTED with the parent’s, and deny is a union. So an agent
definition — which may come from a .claude/agents/*.md file in the
repo, i.e. from the same trust tier as a project config — can never be
a privilege-escalation door.
Fields§
§approval: Option<ApprovalPolicy>Approval policy for the child. Applied only when STRICTER than the parent’s.
sandbox: Option<SandboxPolicy>Filesystem sandbox tier for the child. Applied only when STRICTER than the parent’s.
auto_approved_tools: Option<Vec<String>>Tools this agent may run without an approval prompt. Intersected with the parent’s list — never a superset of it.
deny: Vec<String>Extra deny patterns, unioned onto the parent’s.
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 moreSource§impl Debug for AgentPermissions
impl Debug for AgentPermissions
Source§impl Default for AgentPermissions
impl Default for AgentPermissions
Source§fn default() -> AgentPermissions
fn default() -> AgentPermissions
impl Eq for AgentPermissions
Source§impl PartialEq for AgentPermissions
impl PartialEq for AgentPermissions
impl StructuralPartialEq for AgentPermissions
Auto Trait Implementations§
impl Freeze for AgentPermissions
impl RefUnwindSafe for AgentPermissions
impl Send for AgentPermissions
impl Sync for AgentPermissions
impl Unpin for AgentPermissions
impl UnsafeUnpin for AgentPermissions
impl UnwindSafe for AgentPermissions
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.