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). The file paths of a deny
group marked hook_only stay with it too (ADR-034): OS layers leave
them to the other rules, so these are the one place the IR’s own
verdicts may be wider than the hook’s.
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.