Universal API for automatic coding agents in sandboxes. Supports Claude Code, Codex, OpenCode, and Amp.
- **Any coding agent**: Universal API to interact with all agents with full feature coverage - **Server or SDK mode**: Run as an HTTP server or with the TypeScript SDK - **Universal session schema**: [Universal schema](https://sandboxagent.dev/docs/universal-schema) to store agent transcripts - **Supports your sandbox provider**: Daytona, E2B, Vercel Sandboxes, and more - **Lightweight, portable Rust binary**: Install anywhere with 1 curl command - **Automatic agent installation**: Agents are installed on-demand when first used - **OpenAPI spec**: Well documented and easy to integrate [Documentation](https://sandboxagent.dev/docs) — [Discord](https://rivet.dev/discord) ## Universal Schema Support Which agent features are normalized into the universal event schema. All agents have full native capabilities; this shows what's exposed via the API. | Feature | Claude | Codex | OpenCode | Amp | |--------------------|:------:|:-----:|:------------:|:------------:| | Stability | Stable | Stable| Experimental | Experimental | | Text Messages | ✓ | ✓ | ✓ | ✓ | | Tool Calls | ✓ | ✓ | ✓ | ✓ | | Tool Results | ✓ | ✓ | ✓ | ✓ | | Questions (HITL) | ✓ | | ✓ | | | Permissions (HITL) | ✓ | ✓ | ✓ | - | | Images | - | ✓ | ✓ | - | | File Attachments | - | ✓ | ✓ | - | | Session Lifecycle | - | ✓ | ✓ | - | | Error Events | - | ✓ | ✓ | ✓ | | Reasoning/Thinking | - | ✓ | | | | Command Execution | - | ✓ | | | | File Changes | - | ✓ | | | | MCP Tools | - | ✓ | | | | Streaming Deltas | ✓ | ✓ | ✓ | - | Agents: [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview) · [Codex](https://github.com/openai/codex) · [OpenCode](https://github.com/opencode-ai/opencode) · [Amp](https://ampcode.com) - ✓ = Supported in universal schema - \- = Schema support in progress Want support for another agent? [Open an issue](https://github.com/rivet-dev/sandbox-agent/issues/new) to request it. ## Architecture  The Sandbox Agent acts as a universal adapter between your client application and various coding agents (Claude Code, Codex, OpenCode, Amp). Each agent has its own adapter (e.g., `claude_adapter.rs`) that handles the translation between the universal API and the agent-specific interface. - **Embedded Mode**: Runs agents locally as subprocesses - **Server Mode**: Runs as HTTP server from any sandbox provider [Documentation](https://sandboxagent.dev/docs/architecture) ## Components - Server: Rust daemon (`sandbox-agent server`) exposing the HTTP + SSE API. - SDK: TypeScript client with embedded and server modes. - Inspector: `https://inspect.sandboxagent.dev` for browsing sessions and events. - CLI: `sandbox-agent` (same binary, plus npm wrapper) mirrors the HTTP endpoints. ## Quickstart ### Skill Install skill with: ``` npx skills add rivet-dev/skills -s sandbox-agent ``` ### SDK **Install** ```bash npm install sandbox-agent ``` **Setup** Local (embedded mode): ```ts import { SandboxAgent } from "sandbox-agent"; const client = await SandboxAgent.start(); ``` Remote (server mode): ```ts import { SandboxAgent } from "sandbox-agent"; const client = await SandboxAgent.connect({ baseUrl: "http://127.0.0.1:2468", token: process.env.SANDBOX_TOKEN, }); ``` **API Overview** ```ts const agents = await client.listAgents(); await client.createSession("demo", { agent: "codex", agentMode: "default", permissionMode: "plan", }); await client.postMessage("demo", { message: "Hello from the SDK." }); for await (const event of client.streamEvents("demo", { offset: 0 })) { console.log(event.type, event.data); } ``` [Documentation](https://sandboxagent.dev/docs/sdks/typescript) — [Building a Chat UI](https://sandboxagent.dev/docs/building-chat-ui) — [Managing Sessions](https://sandboxagent.dev/docs/manage-sessions) ### Server Install the binary (fastest installation, no Node.js required): ```bash # Install it curl -fsSL https://releases.rivet.dev/sandbox-agent/latest/install.sh | sh # Run it sandbox-agent server --token "$SANDBOX_TOKEN" --host 127.0.0.1 --port 2468 ``` Optional: preinstall agent binaries (no server required; they will be installed lazily on first use if you skip this): ```bash sandbox-agent install-agent claude sandbox-agent install-agent codex sandbox-agent install-agent opencode sandbox-agent install-agent amp ``` To disable auth locally: ```bash sandbox-agent server --no-token --host 127.0.0.1 --port 2468 ``` [Documentation](https://sandboxagent.dev/docs/quickstart) - [Integration guides](https://sandboxagent.dev/docs/deploy) ### CLI Install the CLI wrapper (optional but convenient): ```bash npm install -g @sandbox-agent/cli ``` Create a session and send a message: ```bash sandbox-agent api sessions create my-session --agent codex --endpoint http://127.0.0.1:2468 --token "$SANDBOX_TOKEN" sandbox-agent api sessions send-message my-session --message "Hello" --endpoint http://127.0.0.1:2468 --token "$SANDBOX_TOKEN" sandbox-agent api sessions send-message-stream my-session --message "Hello" --endpoint http://127.0.0.1:2468 --token "$SANDBOX_TOKEN" ``` You can also use npx like: ```bash npx sandbox-agent --help ``` [Documentation](https://sandboxagent.dev/docs/cli) ### Inspector Debug sessions and events with the [Inspector UI](https://inspect.sandboxagent.dev).  [Documentation](https://sandboxagent.dev/docs/inspector) ### OpenAPI Specification [Explore API](https://sandboxagent.dev/docs/api-reference) — [View Specification](https://github.com/rivet-dev/sandbox-agent/blob/main/docs/openapi.json) ### Universal Schema All events follow a [universal schema](https://sandboxagent.dev/docs/universal-schema) that normalizes differences between agents. ### Tip: Extract credentials Often you need to use your personal API tokens to test agents on sandboxes: ```bash sandbox-agent credentials extract-env --export ``` This prints environment variables for your OpenAI/Anthropic/etc API keys to test with Sandbox Agent SDK. ## FAQ