pub struct Enforcement {
pub fs: Filesystem,
pub egress: Egress,
pub secrets: Vec<BrokeredSecret>,
pub limits: Vec<ProcessLimit>,
pub decide_only: Vec<DecideOnly>,
pub losses: Vec<Loss>,
pub allowances: Vec<Allowance>,
}Expand description
What an OS layer may enforce for one policy in one context.
Fields§
§fs: FilesystemFile reads and writes.
egress: EgressOutbound network.
secrets: Vec<BrokeredSecret>Secrets the egress proxy and Claude Code’s own broker inject for the
agent (ADR-020). One entry per policy secrets: item; OS backends
consume these without reading the policy again.
limits: Vec<ProcessLimit>Limits on the agent’s processes. Always empty: no policy key sets one yet.
decide_only: Vec<DecideOnly>Rules only the hook can apply, by kind. Shell semantics, environment variables, MCP tool names and executable pins name things an OS layer cannot see (a command line, a variable, a tool), so they are not lowered and stay with the hook decision (ADR-018).
losses: Vec<Loss>Where the IR is stricter than the hook decision, with the reason.
allowances: Vec<Allowance>Where OS layers may be wider than the hook decision, listed in the
policy (sandbox.read_roots). The hook keeps deciding these accesses;
deny rules still win over them. Not part of Filesystem, so the IR’s
own verdicts stay the hook’s or stricter.
Implementations§
Source§impl Enforcement
impl Enforcement
Sourcepub fn checker(&self) -> Result<Checker, PolicyError>
pub fn checker(&self) -> Result<Checker, PolicyError>
Compile the IR’s globs for Checker::check.
Trait Implementations§
Source§impl Clone for Enforcement
impl Clone for Enforcement
Source§impl Debug for Enforcement
impl Debug for Enforcement
impl Eq for Enforcement
Source§impl PartialEq for Enforcement
impl PartialEq for Enforcement
Source§impl Serialize for Enforcement
impl Serialize for Enforcement
impl StructuralPartialEq for Enforcement
Auto Trait Implementations§
impl Freeze for Enforcement
impl RefUnwindSafe for Enforcement
impl Send for Enforcement
impl Sync for Enforcement
impl Unpin for Enforcement
impl UnsafeUnpin for Enforcement
impl UnwindSafe for Enforcement
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
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
key and return true if they are equal.