Prime Radiant external sandbox: agent local, commands boxed

Prime Radiant's prototype external sandboxes run Claude Code, Codex or Pi commands in an isolated Linux VM on your Mac, for developers who want boundaries, not prompts.

Picture a freelance developer on an Apple silicon MacBook, working through a client's Python repo with a coding agent. She's been trying cheaper models to keep costs down. Today she has two bad options. She can approve every shell command, and by mid-afternoon she clicks yes without reading. Or she can turn the prompts off and hope nothing in a README or dependency talks the agent into reading ~/.aws or pushing somewhere it shouldn't. Neither option is a boundary. One is a habit, the other is luck.

That gap is what Prime Radiant's "external sandboxes" post (Nov 17, 2026) goes after. The agent keeps running on the Mac as usual. The commands it runs go to a separate Linux sandbox that sees only the folders you mount, has no network unless you allow specific hosts, and can make authenticated API calls without the agent ever seeing the key. Three interchangeable backends ship as prototypes, with setup instructions for Claude Code, Codex and Pi. The trade-off is that how much gets isolated depends on which agent you use.

What it is

The pattern, in Prime Radiant's words, is "external sandboxes": the sandbox is external to the agent, not to the computer, so both can run on the same machine. @simonw, who announced the work on X, describes Prime Radiant as "the AI research lab behind Superpowers" and points to an index repository for the prototypes.

Prime Radiant says it considered running agents inside the sandbox and chose not to. Its reasons: this avoids "weird behavior where the agent can modify itself or its direct environment," and it keeps the boundary easier to audit.

Three backends ship, all exposing the same localhost web API, per the primary post:

How each capability maps to the freelancer's problem:

The post also ships a protocol specification and a conformance testing tool, so others can build compatible sandbox servers. Superpower Daily's write-up, which credits the release to Simon Willison, frames the design the same way: command execution, "not necessarily the coding agent itself," becomes the security boundary.

Alternatives, each described from its own source:

Who it's for

Pick this up if you're on a Mac and drive Pi or Codex, whose file operations route into the sandbox. It also fits if you want to try cheaper or local models without handing them your whole laptop, or you already think of agent safety as a boundary problem rather than an approval problem. The v86 backend needs nothing beyond Node.js 22.19+, so it costs one command to evaluate.

Also consider it if you build sandboxes or agent tooling. The shared protocol and conformance tester are the reusable part, and Prime Radiant says the specification is "the place to start."

Skip it if you need isolation for sensitive workloads. Prime Radiant says plainly that these are prototypes that "have not been audited to a level that you should trust them with sensitive workloads." Skip it, or pair it with something else, if you work mainly in Claude Code and want file reads and edits contained: only Claude's Bash commands go to the sandbox. And if you want several unattended tasks at once that end in a pull request, Replicas' guide points toward cloud VMs instead. Bear in mind that Replicas sells exactly that.

Before and after

Before (prompts on):

  1. Start the agent in the project folder.
  2. Approve each command: pip install, pytest, a curl to GitHub.
  3. Read every prompt carefully for the first hour, then stop reading.
  4. Hope an injected instruction never lands among the approvals.

Before (prompts off):

  1. Start the agent with permission checks bypassed.
  2. Commands run as you, with your shell's tokens and your home directory in reach. Replicas' guide lists ~/.ssh, ~/.aws and any API key in your shell as exposed in this mode.

After (external sandbox):

  1. Commit your work, so the read-write mount has a safety net.
  2. Start a sandbox server in the project folder, mounting only that folder.
  3. Optionally give it a proxy config listing the hosts the task needs, with credentials that are substituted on the host side.
  4. Start the agent pointed at the sandbox URL.
  5. Let it run. Commands execute in Alpine Linux and writes land in the mounted folder. If you set a proxy config in step 3, blocked network calls show up in the /proxy log.
  6. Review the diff with git as usual.

The gain is that approvals become a policy you set once per session rather than a stream of yes/no decisions.

Try it

These steps use Pi and the v86 backend, the route the primary post calls the simplest. Prerequisites per Prime Radiant: Node.js 22.19 or later, and a model login for Pi. The sources give no cost for the sandbox itself. Your model usage is whatever your provider charges.

  1. Start the sandbox in your project directory. This downloads Alpine Linux and boots it in v86:
npx --yes external-sandbox-v86 \
  --preserve-paths --mount-rw "project=$PWD"

The folder is mounted read-write at /mnt/project. Because of --preserve-paths, it also appears at its original path, so host paths in commands still resolve.

  1. Start Pi in a second terminal, in the same directory:
npx --yes @earendil-works/pi-coding-agent \
  -e npm:external-sandbox-pi --no-builtin-tools \
  --sandbox-url http://127.0.0.1:8686

If you haven't used Pi before, run /login inside it first. --no-builtin-tools means nothing runs on your Mac if the extension fails to load. If the sandbox can't be reached, the tools return an error rather than falling back. Pi's status bar shows Sandbox: ... once connected.

  1. Confirm where commands run. In Pi, run !uname -a. The post shows output like this. You should see Linux, not Darwin:
Linux (none) 6.12.114-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2026-10-21 12:19:03 i686 Linux
  1. Give the task a narrow network. Say the job is "install the project's Python dependencies and check open issues via the GitHub API." Stop the server and create proxy.json with the post's example policy. It allows read-only access to PyPI and GET requests to GitHub's API, with the token substituted by the proxy:
{
  "allow": [
    {
      "origin": "https://pypi.org",
      "methods": ["GET", "HEAD"]
    },
    {
      "origin": "https://files.pythonhosted.org",
      "methods": ["GET"]
    },
    {
      "origin": "https://api.github.com",
      "methods": ["GET"],
      "credential": {
        "header": "authorization",
        "placeholder": "Bearer placeholder-github-token",
        "secretEnv": "GITHUB_TOKEN",
        "prefix": "Bearer "
      }
    }
  ],
  "guestEnv": {
    "GITHUB_TOKEN": "placeholder-github-token"
  }
}

Restart the sandbox with the token held by the host-side server only:

GITHUB_TOKEN="$(gh auth token)" npx --yes external-sandbox-v86 \
  --proxy-config proxy.json \
  --preserve-paths --mount-rw "project=$PWD"

Inside the sandbox, GITHUB_TOKEN holds only the placeholder. The proxy also sets HTTP_PROXY/HTTPS_PROXY and points SSL_CERT_FILE, REQUESTS_CA_BUNDLE and NODE_EXTRA_CA_CERTS at its CA certificate, so common clients go through it.

  1. Watch the policy work. Open the server's port (8686 for v86) in a browser and go to its /proxy page. Per the post, that page exists only when the server was started with --proxy or --proxy-config, which you just did. It shows a log of recent allowed and denied requests, and you can edit the rules mid-session. Given the policy above, a POST to GitHub or a request to any unlisted host should show as denied.

  2. Reinstall dependencies inside. The sandbox runs Linux, so Prime Radiant warns that a macOS-built node_modules or .venv in your project may need reinstalling there. Here's an instruction you could add to your agent's project notes. It's our example, not from the sources:

Shell commands run inside a Linux sandbox. Install dependencies there; don't reuse the host's .venv or node_modules. Only pypi.org, files.pythonhosted.org and GET on api.github.com are reachable. If a command fails on network access, stop and tell me which host it needed instead of retrying another way.

Using Codex instead. The post gives a dedicated Codex home pointed at the sandbox's WebSocket endpoint:

mkdir -p ~/.codex-external-sandbox
cat > ~/.codex-external-sandbox/environments.toml <<'EOF'
default = "external-sandbox"
include_local = false

[[environments]]
id = "external-sandbox"
url = "ws://127.0.0.1:8686/codex"
connect_timeout_sec = 5
initialize_timeout_sec = 10
EOF
CODEX_HOME=~/.codex-external-sandbox codex login
CODEX_HOME=~/.codex-external-sandbox codex --sandbox danger-full-access \
  -c features.shell_snapshot=false \
  -c features.unified_exec_tty=false \
  --cd "$PWD"

danger-full-access here tells Codex not to layer its own sandbox inside the external one. Codex then sends process and filesystem operations, including apply_patch, to the sandbox.

Using Claude Code. You clone the repo for a shell prefix script and launch claude with CLAUDE_CODE_SHELL_PREFIX and EXTERNAL_SANDBOX_API_URL set. The full commands are in the primary post. Remember that only Bash goes through it.

Where it breaks

It's a prototype, by its authors' account. Prime Radiant says the sandboxes "have not been audited to a level that you should trust them with sensitive workloads." We found no roadmap or support commitment, so long-term maintenance is open.

Claude Code is only half-covered. Per Prime Radiant, Claude's Read and Edit tools can still read and edit files on your Mac directly. Superpower Daily makes the same point. In our reading, that leaves a prompt-injected Claude session able to read files outside the mount through its Read tool. Claude Code's own built-in sandbox has the same shape: its docs say file and web tools run outside it, and that it "reduces risk but is not a complete isolation boundary."

Codex support rides on an experimental protocol. Prime Radiant's tests pass against Codex CLI 0.164.0 using codex exec and a simulated model (as of Nov 17, 2026). It says the exec-server protocol is experimental, so other versions may need checking.

The mount is real. A read-write mount still lets the agent damage anything in that folder. Prime Radiant's advice is to keep it under version control and use read-only mounts where you can. Whether --preserve-paths or symlinks inside a mount could be used to reach beyond it isn't addressed in the sources.

Credential replacement isn't magic. Prime Radiant warns that an allowed host "could still echo a credential back in its response." Its advice is to use credential rules only with trusted services and keep methods and paths narrow. Replicas makes a related point about allowlists generally: an allowed broad domain can still be used to send data out.

Dependency friction. macOS-built dependencies may need reinstalling inside Linux. The example policy's only package registry is PyPI. Whether npm installs need their own allow rule, and which hosts that rule would list, isn't confirmed by the sources.

Unmeasured costs. No source gives speed numbers for any of the three backends, including v86, which emulates x86 in WebAssembly. The Apple Containers and Quicksand backends are listed for Apple silicon Macs. Whether Apple Containers needs a specific macOS version isn't stated.

Lock-in is low, by design. All three backends share one protocol and the agents connect through their own extension points: a shell prefix, an exec-server, a Pi extension. If a backend disappoints, you can swap the port number rather than your workflow.

Sources