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; on Windows: Job Objects (+ restricted-token probe); soft FS policy. 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
Exit - Result of waiting on a
SpawnedProcess. - Process
Guard Backend - Resolved
Credential - A resolved secret ready to inject (kept out of Debug).
- Spawn
Request - Spawned
Process - Low-level child handle with process-group / Job / AppContainer-aware wait/kill.
- 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 - Stdio
Mode - How to connect a child’s standard stream.
- Termination
Reason - Why a managed process stopped.
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).
- local_
process_ confined - Local-process with host Landlock/Seatbelt (
isolate_apply = false). Prefer [keel_core::Space::create_confined] for the full Space lifecycle. - 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.
- soft_
fs_ allowed - Soft filesystem allow check.
- soft_
fs_ resolve - Resolve a path for SpaceFs-style I/O: workspace-relative join, then
canonicalize existing paths (follows symlinks). For new paths, canonicalize
the nearest existing ancestor and rejoin the full relative suffix after it
(so
foo/bar.txtkeeps bothfoo/andbar.txt, not only the leaf). - 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.