The Problem
Running coding agents in isolation is a nightmare. Every agent (Claude, Codex, OpenCode, etc.) has its own API, quirks, and weird limitations. Want to swap one out? Get ready to rewrite half your integration. And don’t even think about running these things in production without isolation—you’ll end up with a rogue AI setting your servers on fire. Oh, and good luck persisting session data when the sandbox crashes or gets terminated.
What This Does
sandbox-agent is here to save your weekends. It’s a lightweight Rust-based server (or embeddable SDK) that runs directly inside any sandbox—Docker, Vercel, E2B, Daytona, whatever. It exposes a universal HTTP and SSE API to control multiple coding agents (Claude Code, Codex, Amp, OpenCode, etc.), so you write your integration once and never think about agent APIs again.
The repo is massive but well-organized. The examples/ folder has 94 files (yes, really), so you’ll find ready-to-go setups for Python, TypeScript, and more. The docs/ directory is stacked with 46 .mdx files covering everything from session persistence (docs/session-persistence.mdx) to OpenCode compatibility (docs/opencode-compatibility.mdx). And for those who love over-engineering, there’s even a built-in UI (examples/cloudflare/frontend/App.tsx) for inspecting and debugging sessions.
Real-World Use
Let’s say you’re running Claude Code in a Docker sandbox. You drop the sandbox-agent binary into your container and spin it up with a single command. Your app talks to the agent over HTTP, streaming events in a normalized schema. Need to swap Claude for Codex? Change a config and call it a day—no rewrites.
Here’s a quick example from the Python SDK (examples/boxlite-python/main.py):
Persist session events to Postgres, audit them later, or replay them for debugging. Your CI/CD pipeline can even use the sandbox-agent to run tests in isolated environments (see examples/boxlite-python/setup_image.py).
The Bottom Line
Sandbox-Agent is a power tool for people building apps around coding agents. It’s overkill for small projects—but if you’re juggling multiple agents or deploying to sandboxes, it’s pure gold. The repo is intimidating, but the docs are solid, and the examples are surprisingly useful. Just don’t expect it to hold your hand—it’s built for devs who know what they’re doing.