npx skills add ...
npx skills add rivet-dev/skills --skill sandbox-agent
Deploy, configure, and integrate Sandbox Agent - a universal API for orchestrating AI coding agents (Claude Code, Codex, OpenCode, Amp) in sandboxed environments. Use when setting up sandbox-agent server locally or in cloud sandboxes (E2B, Daytona, Docker), creating and managing agent sessions via SDK or API, streaming agent events and handling human-in-the-loop interactions, building chat UIs for coding agents, or understanding the universal schema for agent responses.
npx skills add rivet-dev/skills --skill sandbox-agent
Sandbox Agent provides a universal API for orchestrating AI coding agents in sandboxed environments.
If something is not working as intended or you are stuck, prompt the user to join the Rivet Discord or file an issue on GitHub to report an issue and get help.
Provide the user with a pre-generated report with:
Each coding agent requires API keys to connect to their respective LLM providers.
Use sandbox-agent credentials extract-env --export to extract your existing API keys (Anthropic, OpenAI, etc.) from local Claude Code or Codex config files.
Use the mock agent for SDK and integration testing without provider credentials.
For per-tenant token tracking, budget enforcement, or usage-based billing, see LLM Credentials for gateway options like OpenRouter, LiteLLM, and Portkey.
Install and run the binary directly.
Run without installing globally.
Run without installing globally.
Install globally, then run.
Install globally, then run.
For local development, use SandboxAgent.start() to spawn and manage the server as a subprocess.
For local development, use SandboxAgent.start() to spawn and manage the server as a subprocess.
If you're running from source instead of the installed CLI.
Binding to 0.0.0.0 allows the server to accept connections from any network interface, which is required when running inside a sandbox where clients connect remotely.
Tokens are usually not required. Most sandbox providers (E2B, Daytona, etc.) already secure networking at the infrastructure layer.
If you expose the server publicly, use --token "$SANDBOX_TOKEN" to require authentication:
Then pass the token when connecting:
If you're calling the server from a browser, see the CORS configuration guide.
To preinstall agents:
If agents are not installed up front, they are lazily installed when creating a session.
If you want to use /v1/desktop/*, install the desktop runtime packages first:
Then use GET /v1/desktop/status or sdk.getDesktopStatus() to verify the runtime is ready before calling desktop screenshot or input APIs.
Open the Inspector UI at /ui/ on your server (for example, http://localhost:2468/ui/) to inspect sessions and events in a GUI.

Session Persistence — Configure in-memory, Rivet Actor state, IndexedDB, SQLite, and Postgres persistence.
Deploy to a Sandbox — Deploy your agent to E2B, Daytona, Docker, Vercel, or Cloudflare.
SDK Overview — Use the latest TypeScript SDK API.