Expand description
Enforce: turn a keel_policy::Policy into a real execution boundary.
Backends:
NullBackend— records + soft checks onlyProcessGuardBackend— soft process spawn / FS guardLocalProcessBackend— Landlock (Linux) / Seatbelt (macOS) via nono; default isolate_apply sandboxes children only (host stays clean). Linux read-deny uses bubblewrap bind-over.
Structs§
- Backend
Info - Egress
Proxy - Running egress proxy bound to 127.0.0.1.
- Local
Process Backend - Landlock / Seatbelt enforce backend.
- Local
Process Options - Options for
LocalProcessBackend. - MapOptions
- Options when mapping policy → kernel capabilities.
- Null
Backend - Process
Guard Backend - Resolved
Credential - A resolved secret ready to inject (kept out of Debug).
- Spawn
Request - Spawned
Process - Worktree
Backend - Worktree isolation backend (optionally layered on another backend).
- Worktree
Options - Options for
WorktreeBackend.
Enums§
- Credential
Source Kind - How a grant source is interpreted.
- Enforce
Error
Constants§
- DENY_
GLOB_ MAX_ MATCHES - Maximum matches per glob (fail closed if exceeded under require_kernel).
- EGRESS_
PROXY_ PORT_ ENV - Env var: proxy port written for child pre_exec / kernel ProxyOnly mode.
Traits§
- Enforce
Backend - A live enforcement context for one space.
Functions§
- apply_
kernel_ here - Apply Landlock/Seatbelt for the current process (call only in child / helper).
- apply_
policy_ file_ and_ ready - Load policy JSON from path and apply (used by
keel sandbox-exec). - expand_
deny_ globs - Expand policy deny globs to concrete paths under the workspace (and absolute roots).
- glob_
to_ seatbelt_ regex - Translate a gitignore-style glob to a Seatbelt-oriented regex (anchored).
- grant_
names - Snapshot grant names for recording without secret values.
- inject_
into_ env - Merge resolved credentials into a spawn env list (does not overwrite existing keys).
- local_
process - Local-process only (no worktree).
- path_
matches_ deny_ glob - Soft check: does path match any deny glob in the policy?
- policy_
to_ capability_ set - Build a nono capability set from a Keel policy.
- prepare_
kernel - Validate that the policy can be mapped and the platform supports sandboxing.
- process_
guard - Soft process-guard only.
- resolve_
credentials - Resolve all grants on a policy. Missing optional sources are skipped with a warning
unless
strictis true. - revoke_
resolved - Zeroize-ish drop helper: overwrite strings then drop.
- worktree_
sandboxed - Worktree + LocalProcess (kernel FS on children) — closest to Grok’s “isolated tree + OS sandbox” stack for coding agents.
- worktree_
soft - Worktree isolation only (soft process-guard inside).
- write_
spawn_ policy_ file - Write policy JSON for child spawn; returns path.