notes

External sandboxes split agent reasoning from execution

External sandboxes split agent reasoning from execution

Giving a coding agent terminal access usually forces an awkward trade-off between constant confirmation prompts and handing untrusted code free rein over your filesystem. In an overview of agent isolation architectures, Simon Willison outlines the external sandbox pattern to separate those responsibilities. The planning agent stays on the host machine to inspect files and plan edits, while the commands and tests it writes execute inside an isolated runtime like WebAssembly, QEMU, or an Apple container.

The architectural split makes sense because planning and execution require very different permissions. An agent needs to read repository files to understand context, but executing code does not require access to SSH keys, environment variables, or other directories. Running untrusted output inside a local microVM or WebAssembly sandbox keeps latency low and keeps source code off third-party servers. It also cuts down on prompt fatigue, which is usually when developers approve a dangerous command just to clear the screen.

Managing what crosses the boundary is where this approach gets complicated. Production codebases depend on local databases and internal network services. When an agent cannot reach those dependencies from inside a minimal sandbox, its test suites fail, tempting developers to punch holes in the network policy until isolation is gone. The pattern only succeeds if tooling can cleanly provide project context to the guest environment without exposing the host.

Source: x.com/simonw/status/2122500307557265651

← all notes