External sandboxes for coding agents
<p><strong><a href="https://blog.primeradiant.com/external-sandboxes-for-coding-agents/">External sandboxes for coding agents</a></strong></p> 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.</p> <p>I worked on this project with <a href="https://primeradiant.com">Prime Radiant</a>, the AI research lab behind Superpowers and <a href="https://github.com/orgs/prime-radiant-inc/repositories">other projects</a>.</p> <p><a href="https://blog.primeradiant.com/external-sandboxes-for-coding-agents/">My post</a> on the Prime Radiant blog introduces the <strong>external sandbox</strong> pattern, where code executed by the agent runs inside a dedicated sandbox while the agent itself lives outside of that sandbox.</p> <p>To demonstrate this pattern we've released three sandbox server implementations:</p> <ul> <li><a href="https://github.com/prime-radiant-inc/external-sandbox-v86">external-sandbox-v86</a> runs a Node.js server which then uses <a href="https://github.com/copy/v86">v86</a> to run Alpine Linux inside WebAssembly.</li> <li><a href="https://github.com/prime-radiant-inc/external-sandbox-container">external-sandbox-container</a> is a Python web server which runs the sandbox in Alpine Linux inside an Apple Containers instance.</li> <li><a href="https://github.com/prime-radiant-inc/external-sandbox-quicksand">external-sandbox-quicksand</a> is another Python web server, this time using Microsoft's <a href="https://github.com/microsoft/quicksand">Quicksand</a> sandboxing library, which bundles QEMU <em>and</em> Alpine Linux in a Python package!</li> </ul> <p>Each of these implementations offers the same localhost API. You can then configure Pi, Claude Code, or Codex to send API calls to that sandbox any time they want to execute code.</p> <p>The sandboxes also include an optional HTTP/HTTPS allow-list proxy, so you can control exactly which hosts your agent's code is allowed to communicate with - plus a credential replacement mechanism to make authenticated API calls without sharing a secret with the agent. Here's the UI you can use to reconfigure that proxy while the sandbox is still running:</p> <p><img alt="The network policy page with allowed destinations, the policy JSON editor and recent proxy activity" src="https://static.simonwillison.net/static/2026/sandbox-proxy.png" /></p> <p>I continue to be fascinated by the challenge of safely running untrusted code. This external sandbox pattern provides a neat way to experiment with different approaches. <p>Tags: <a href="https://simonwillison.net/tags/sandboxing">sandboxing</a>, <a href="https://simonwillison.net/tags/security">security</a>, <a href="https://simonwillison.net/tags/ai">ai</a>, <a href="https://simonwillison.net/tags/webassembly">webassembly</a>, <a href="https://simonwillison.net/tags/generative-ai">generative-ai</a>, <a href="https://simonwillison.net/tags/llms">llms</a>, <a href="https://simonwillison.net/tags/coding-agents">coding-agents</a>, <a href="https://simonwillison.net/tags/claude-code">claude-code</a>, <a href="https://simonwillison.net/tags/codex">codex</a>, <a href="https://simonwillison.net/tags/pi">pi</a></p>
Nguyên văn nguồnChi tiết nguồn
- External sandboxes for coding agents Simon Willison · 18 thg 11, 2026