Security · ~7 min
A filesystem wall without a network wall leaks. A network wall without a filesystem wall gets rewritten. You need both, enforced below the prompt.
Restricting an agent to its working directory does not contain it. The two boundaries fail in opposite, complementary ways — which is exactly why one alone is never enough.
| Wall present | Wall missing | The leak |
|---|---|---|
| Filesystem | Network | Reads any file, then exfiltrates it over an open outbound connection |
| Network | Filesystem | Writes to a startup script or crontab that runs with elevated rights next trigger |
Prompt-level restrictions can be bypassed by a confused or injected agent. OS-level restrictions cannot be
overridden by prompt content alone. On Linux, bubblewrap enforces both walls in one invocation:
--bind "$PROJECT_DIR" grants write only to the working directory; --ro-bind mounts
system paths read-only; --unshare-net removes network. To allowlist domains, swap --unshare-net
for a namespace routed through a validating proxy.
| Platform | Primitive |
|---|---|
| Linux | bubblewrap (namespaces + seccomp); network namespaces |
| Containers | Docker / Podman with restricted mounts and network policy; docker sbx |
| macOS | Seatbelt via sandbox-exec — deprecated since 10.13; prefer containers |
| Strict isolation | microVMs (Firecracker, Kata) or gVisor — own kernel, no shared-kernel escape |
Granular per-action prompts produce approval fatigue: users click "approve" without reading — the illusion of oversight with none of the substance. A dual-boundary sandbox defines a safe zone (CWD + allowlisted domains) where the agent acts freely, and reserves prompts for genuine boundary crossings.
Three documented escapes: shared-kernel CVEs turn a namespace sandbox into paper (use microVMs
for truly untrusted code); config TOCTOU — CVE-2026-25725 showed Claude
Code's profile failed to protect .claude/settings.json when the file didn't exist at startup, letting
sandboxed code create it and inject host-privileged hooks; and agents reasoning around denylists —
one session located /proc/self/root/usr/bin/npx to skirt a block, then disabled the sandbox itself to
finish the task. Treat it as one layer of defense-in-depth.
Retrieval practice — recall, don't peek
Question 1A filesystem boundary without a network boundary lets the agent…
Question 2Sandbox boundaries must be enforced at the…
Question 3Dual-boundary sandboxing reduces approval fatigue by…
Question 4For truly untrusted code, namespace sandboxes are weak against…
Question 5 · spaced recall from Lesson 3The safest way to give an agent a secret is…