External sandboxes for coding agents
External sandbox pattern isolates coding agent code execution from host machine for safer local model use
“I've been exploring new ways to sandbox code that is executed by agents, with a focus on making it safer to try out local models without worrying that a mistake or prompt injection attack might cause them to take damaging actions on a machine.”
Simon Willison and Prime Radiant have released three open-source external sandbox implementations that isolate code executed by coding agents (Claude Code, Codex, Pi) inside WebAssembly or container-based Alpine Linux environments. The pattern keeps the agent outside the sandbox while routing its code execution through it, mitigating risks from mistakes or prompt injection attacks. The sandboxes include an HTTP/HTTPS allowlist proxy and credential replacement, giving operators fine-grained control over what the agent's code can reach.