SPAWNBOX

● Works today

Let coding agents break things.Only their own sandbox breaks.

Run Claude Code, Codex or Copilot CLI on a real repo, with root in its own microVM. Spawnbox has a ready-made template for each one. Our scale test ran 768 Claude Code agents at once, and every one finished.

Any agent with a command line, for example

  • Claude Code
  • Codex
  • Copilot CLI
  • Gemini CLI
YOUR AGENTSANDBOXclaude -pSPAWNBOX APIKEYS · SITE RULESYOUR SERVER
FIG. 03 · ONE REQUEST, THERE AND BACK
0102

Follow one request.

Each step shows the call, the reply and the lines it adds to the activity log. You can read the whole log withGET /v1/sandboxes/$S/events.

  1. SPAWNBOX API

    Let the install build the templates

    Spawnbox comes with claude-code, codex and copilot templates. Each installs one pinned npm release on the base disk, with Node.js 26. A new install builds all three for you in a few minutes, one time for each server. On an install from before v0.1.10, run the installer again to upgrade, then build the one you need.

    SHELL
    # see when the builds are ready
    spawnbox templates ls
    
    # installed before v0.1.10: upgrade, then build one
    spawnbox templates build /opt/spawnbox/templates/claude-code.json
  2. SPAWNBOX API

    Keep the model key outside

    Save the key as a held secret. Claude Code sends it in the x-api-key header. The agent sees only a placeholder. The proxy puts the real key in requests to api.anthropic.com.

    REQUEST
    POST /v1/secrets
    
    {"name": "anthropic", "type": "http_header",
     "value": "sk-ant-...", "env": "ANTHROPIC_API_KEY",
     "allowed_hosts": ["api.anthropic.com"],
     "header": "x-api-key", "format": "{value}"}
  3. SPAWNBOX API

    Start a sandbox from the template

    It starts from the saved snapshot, with the agent already installed. On our test host this took about 0.1 s. The sandbox can reach only the model API, GitHub and npm.

    REQUEST
    POST /v1/sandboxes
    
    {"template": "claude-code",
     "secrets": ["anthropic", "github"],
     "egress": {"mode": "allowlist", "allow": [
       "api.anthropic.com", "github.com",
       "registry.npmjs.org"]}}
    • sandbox.createdsbx_9tr3c0vbq6ym2e8h
  4. IN THE SANDBOX

    Clone the repo

    A git_https secret opens private repos. The GitHub token does not go into the sandbox.

    REQUEST
    POST /v1/sandboxes/$S/git:clone
    
    {"url": "https://github.com/acme/api", "depth": 1}
    • net.connectiongithub.com:443
  5. IN THE SANDBOX

    Run the agent and watch it live

    Ask for a stream to get stdout and stderr as they come. If you close the stream, Spawnbox stops the agent.

    REQUEST
    POST /v1/sandboxes/$S/exec
    Accept: text/event-stream
    
    {"cmd": "claude -p 'fix the failing test' --permission-mode acceptEdits",
     "cwd": "/workspace/api", "timeout_s": 1800}
    • exec.startedclaude -p …
    • secret.injectedapi.anthropic.com
    • exec.finishedexit 0
  6. SPAWNBOX API

    Try three fixes from the same point

    Copy the sandbox with its memory, processes and files. Give each copy a different prompt, and keep the best result.

    REQUEST
    POST /v1/sandboxes/$S:fork
    
    {"count": 3}
    • sandbox.forked3 copies
0202

Good to know.