Getting startedSeatbeltFail-closed
Developer laptop containment. Generated from docs/getting-started/local-agent-sandbox.md on
main. MCP snippets: Sandbox exec· Plugin: Sandbox.Local agent sandbox (macOS Seatbelt)
Contain AI coding agents and subagents to company repo paths only — fail-closed, never fail-open.
The Matt Shumer class incident (rm -rf after $HOME mis-expansion in a subagent) is blocked at the kernel: Seatbelt denies file-write* outside explicit allowed paths even when the shell command is wrong.
One-liner setup
curl -fsSL https://clawql.com/install | bash
clawql sandbox init
clawql sandbox verify
clawql doctor --smoke # includes sandbox verify when enabled
clawql codex # per-harness sandbox-exec wrapper
Architecture: two layers for Claude Code
| Layer | Mechanism |
|---|---|
| Outer | ClawQL sandbox-exec -f ~/.ClawQL/sandbox/claude.sb -D WORK_DIR=… |
| Inner | Claude Code native /sandbox via ~/.claude/settings.json |
Same defense-in-depth idea as Kata + Istio in enterprise — applied locally.
clawql sandbox command surface
clawql sandbox init # profiles + Claude settings.json
clawql sandbox status # per-harness profile paths
clawql sandbox verify # kernel-level containment probes
clawql sandbox edit --harness claude # customize profile in $EDITOR
Per-harness profiles
| Harness | Profile | Notes |
|---|---|---|
claude | ~/.ClawQL/sandbox/claude.sb | Seatbelt wrapper + Claude /sandbox |
codex | ~/.ClawQL/sandbox/codex.sb | sandbox-exec only |
cursor | ~/.ClawQL/sandbox/cursor.sb | sandbox-exec only |
opencode | ~/.ClawQL/sandbox/opencode.sb | sandbox-exec only |
Launch: clawql <harness> → sandbox-exec -f \{harness\}.sb -D WORK_DIR=$PWD … -- <binary>
Parameterized profile template
Profiles use Seatbelt (param "…") filled at launch via -D:
(version 1)
(allow default)
(deny file-write*)
(allow file-write*
(subpath "/tmp")
(subpath (param "WORK_DIR"))
(subpath (param "CLAWQL_DIR")))
(deny file-read*
(subpath (param "HOME_SSH"))
(subpath (param "HOME_AWS"))
(subpath (param "HOME_CONFIG")))
clawql sandbox init also bakes in team allowedPaths / deniedPaths as literal subpath rules.
Fail-closed rules
sandbox-execmissing → harness launch abortsclawql sandbox verifyfails → harness launch abortsclawql doctor --smokeruns verify when sandbox is enabled
Never silently proceeds unsandboxed when failClosed: true (default).
Escalation path
| Level | Use when | Tool |
|---|---|---|
| 1 — Seatbelt | Daily macOS coding | clawql sandbox init |
| 2 — sandbox_exec MCP | In-agent snippets | CLAWQL_ENABLE_SANDBOX=1 |
| 3 — Kata | Enterprise K8s | Helm sandboxKata |
| 4 — UTM VM | Computer Use | Share only company repos folder |
