Simon Willison introduces the external sandbox pattern for coding agents: the agent runs on the Mac, and the code executes in a sandbox
The external sandbox pattern lets coding agents run on a local Mac, but the code generated by the agent executes in a WebAssembly, QEMU or Apple Container sandbox. Simon Willison introduces this pattern in a tweet and links to a detailed article on the Prime Radiant blog, which provides demos for Claude Code, Codex and Pi. In the architecture diagram, the agent sends commands to a Linux virtual machine inside a local localhost:8686 sandbox server (run by v86, Apple container or QEMU); mounted directories (read-only or read-write) and a user-controllable allowlist proxy are the virtual machine's only external channels, and outbound requests are allowed through the proxy to permitted hosts.
I've been exploring new ways to sandbox code written by coding agents - here's a description of the external sandbox pattern, where agents run on your Mac but execute code in a WebAssembly or QEMU or Apple Container sandbox - with demos for Claude Code, Codex and Pi https://blog.primeradiant.com/external-sandboxes-for-coding-agents/