Security model
The plugin layer is not trusted to enforce anything. Enforcement lives in the kernel and the OS:
| Threat | Enforcement |
|---|---|
| Workspace escape | bash and MCP children re-exec oi __sandbox, which applies Landlock (Linux) or Seatbelt (macOS) and then execs. Writes are allowed only under the workspace, extra write_roots and $TMPDIR. With --no-net, TCP bind/connect is denied (Landlock ABI ≥ 4). In-process write/edit paths are canonicalised, symlinks included, and checked against the same roots. ~/.ssh, ~/.aws and other credential stores are unreadable. |
| Secret exfiltration | Credentials come only from the OS keychain (secret-tool / security) or named env refs. Secret-looking env vars are stripped from child environments. Tracked secret values and well-known token formats (sk-ant-…, ghp_…, AKIA… and others) are redacted from every tool output before it is logged or shown to the model. Checkpoints re-apply redaction. |
| Runaway JS / OOM | Per-isolate allocator ceiling enforced before QuickJS sees OOM, plus an interrupt handler for deadlines and Ctrl-C / ACP cancel. |
| Prompt injection | File, shell, MCP, plugin and Codemode output reaches the model inside <untrusted-data source="…"> frames that the content cannot close early. The system prompt says frame contents are data, never instructions. |
| Approvals | In ask mode, reads are automatic. Writes, shell, MCP and web calls ask the active client: the TTY prompt, ACP session/request_permission, or an SSE permission event answered with POST /permission/{id}. File changes come with their diff. Permission rules allow, ask or deny ahead of time; deny rules hold in auto mode too. Requests are asynchronous: other agents keep running while one waits, and a cancelled agent's request is withdrawn. |
| Web requests | web_fetch refuses loopback, private, link-local and metadata addresses at every redirect hop unless a rule names the host; both web tools are off with --no-net. |
| Hooks and commands | Shell hooks run in the OS sandbox; hooks from a repository's shared config need approval before they run. Custom commands and skills are prompt text: they never run commands themselves. |
| Sub-agents | A child's permissions only narrow (mode ceiling, tool allowlist, write roots, network), and are enforced by the same gate and sandbox. Its report is taint-framed. Children cannot spawn children unless configured, and run under a concurrency cap and the turn's cost budget. |