Sandbox Agent
Run multiple coding agents in isolated sandboxes and control them remotely through one HTTP API.
The sources place arbitrary-code agents inside sandboxes, show token authentication bound to 127.0.0.1 by default, and use relatively narrow CI permissions, providing a reasonable least-privilege baseline. However, no core permission-handling implementation is supplied, so per-action user confirmation cannot be established. The README explains that events leave through HTTP/SSE for caller-managed external storage and that persistence is out of scope, but it gives no complete classification, retention, or deletion policy. Credentials are passed through environment variables, and a command can extract and print personal API keys; the supplied files do not show redaction, encryption at rest, log filtering, or lifecycle controls. Dependencies are version-constrained and exercised in CI, but many constraints are broad and there is no supplied lockfile, security scan, or vulnerability-response evidence. Arbitrary command execution, agent installation, network streaming, and external persistence are disclosed external effects, yet fine-grained approval or effect previews are not demonstrated. Examples destroy sandboxes, but session recovery, undo, and persistence rollback are not provided. Repository, author, license, and contributor attribution are clear, while publisher identity remains unverified by the stated registry.
The README, Cargo metadata, SDK/CLI examples, and tests describe a generally coherent product, with core versions aligned around 0.4.2/0.4.x. Broad claims such as full feature coverage and operation in any sandbox are not supported by the supplied core implementation. Rust, Node, pnpm, external agent binaries, provider credentials, and platform prerequisites are partly documented, and agents may install lazily, but availability still depends on networks, third-party services, tokens, and provider tooling. Tests produce useful timeout, process-exit, startup-failure, and stdout/stderr diagnostics; these mostly demonstrate fixture diagnostics rather than the complete server and SDK error model.
Local development, remote server, embedded SDK, language-neutral HTTP clients, and multiple sandbox-provider scenarios are clearly distinguished, with concrete invocation paths, so audience and scenario coverage is thorough. The Out of Scope section and FAQ explicitly exclude external session persistence, direct LLM wrappers, Git management, and sandbox-provider APIs, earning full capability-boundary credit. Actions are triggered through explicit SDK, CLI, or HTTP requests and agent configuration, but the supplied files do not establish exact permission-prompt, retry, idempotency, or concurrent-event semantics. Environment fit covers several modes and providers and includes conditional integration tests; deductions reflect that some tests are skipped by default, require external credentials and tools, and do not substantiate the universal “any sandbox” claim.
The README is well organized around motivation, architecture, components, setup, FAQ, scope, and roadmap. It supplies practical npm, Bun, curl, CLI, embedded, and remote installation notes. Naming is consistent across packages, binaries, and Cargo metadata, but the product is still at 0.4.x and one compatibility feature is explicitly experimental, limiting stability evidence. Examples and FAQ coverage are extensive, and known exclusions are explicit. Apache-2.0 is consistent across metadata and a complete license file, justifying full license credit. Only the current version and 0.4.x channel are shown; no changelog, migration policy, or explicit compatibility policy is supplied. Cargo authorship, repository metadata, documentation, and Discord provide maintenance routes, but publisher identity is unknown and support ownership or commitments are not clearly allocated.
The unified HTTP/SSE API, TypeScript SDK, CLI, Inspector, universal event schema, and OpenAPI entry point yield directly usable outputs, with examples covering session creation, messages, and event streaming. A common adapter for otherwise distinct coding agents offers clear marginal value, but full feature parity and seamless swapping remain mostly asserted because adapter implementations and comparison evidence are absent. A static Rust binary and lazy installation may reduce deployment overhead, while agents, sandboxes, external storage, third-party APIs, and operations still impose costs; no benchmarks, resource figures, or cost model are provided, so cost-benefit support is adequate rather than thorough.
Many claims trace to concrete README examples, Cargo workspace metadata, CI steps, and provider health tests, providing reasonable static traceability. Missing core server, permission, and credential implementations prevent tracing several strong claims end to end. README, manifests, CI, and tests corroborate versions, components, and health-check behavior, but provider tests are conditional and no independent results or sources are supplied. Facts, roadmap items, experimental labels, and out-of-scope statements are generally separated, yet promotional claims such as “full feature coverage” and “any sandbox” are not clearly marked as inference or bounded by validation evidence.
- This product controls agents capable of arbitrary code execution. Production deployments should preserve network isolation, token authentication, and sandbox boundaries; never expose --no-token on a non-local interface.
- credentials extract-env --export prints personal API keys. Treat its output as sensitive, keep it out of logs, terminal recordings, CI artifacts, and chats, and use short-lived least-privilege credentials.
- Session persistence is caller-managed and streams data to external storage. Define encryption, access control, retention, deletion, and audit policies before deployment.
- Install scripts, npm packages, and agent binaries are obtained from the network and may run lazily. Pin exact versions, verify artifact provenance, and add dependency and vulnerability scanning.
- Some integration tests skip when environment variables are absent. This was a static review only; no behavior was executed or independently verified.
What does this agent do, and when should you use it?
Sandbox Agent is a server that runs inside a sandbox and exposes a common control plane for Claude Code, Codex, OpenCode, Cursor, Amp, and Pi. Its Rust daemon serves HTTP and SSE, while the TypeScript SDK supports both embedded and remote-server modes and the CLI mirrors the HTTP endpoints. Agent-specific adapters translate proprietary APIs and events into a universal API and session schema that applications can stream to their own storage. A built-in Inspector provides a UI for examining sessions and events, and an OpenAPI specification supports clients written in other languages. It can run locally or inside E2B, Daytona, Modal, Cloudflare Containers, Agent Computer, Vercel Sandboxes, Docker, and other environments capable of running Linux binaries. It does not provide external session persistence, Git repository management, sandbox-provider orchestration, or a direct LLM wrapper.
The sandbox-agent server command starts an HTTP and SSE service inside the sandbox and runs the selected coding agents as local subprocesses. Applications can start embedded mode with SandboxAgent.start() or connect remotely with SandboxAgent.connect({ baseUrl, token }); they then use listAgents(), createSession(), postMessage(), and streamEvents() to discover agents, create a session, submit work, and consume normalized events from an offset. HTTP clients can perform the same operations, while the CLI exposes commands including sandbox-agent api sessions create, send-message, and send-message-stream. Per-agent adapters translate between the common protocol and the distinct interfaces of Claude Code, Codex, OpenCode, Cursor, Amp, and Pi. The main output is a stream of session events in a universal JSON schema, which the consuming application must persist if auditing or replay is required. The Inspector at /ui/ displays sessions and their events for debugging.
- A cloud development product can run coding agents in E2B, Daytona, Vercel Sandboxes, or Docker so arbitrary generated code is isolated from production servers.
- A platform team supporting Claude Code, Codex, OpenCode, Cursor, Amp, or Pi can integrate one HTTP API and switch agents through configuration instead of rebuilding every client.
- A team with a non-TypeScript backend can build against the OpenAPI specification and receive live agent activity over SSE.
- An engineering organization that needs audits or replay can stream the normalized JSON events into Postgres, ClickHouse, or Rivet.
- Developers investigating remote permissions, messages, and session behavior can inspect the event history through the bundled Inspector UI.
- A team can prototype locally in embedded mode and later operate the same interface as a server inside an isolated production sandbox.
What are this agent's strengths and limitations?
- One HTTP API covers Claude Code, Codex, OpenCode, Cursor, Amp, and Pi while normalizing their different event formats into a universal session schema.
- The same system can run as a static Rust server binary inside a sandbox or through an embedded TypeScript SDK, supporting both local and remote execution models.
- HTTP, SSE, and a published OpenAPI specification make real-time integration possible from languages beyond TypeScript.
- The bundled Inspector, endpoint-mirroring CLI, and credential extraction command support debugging, automation, and test setup.
- Its deployment model places arbitrary agent-executed code inside an isolated environment rather than directly on production application servers.
- The project does not persist its normalized event stream; adopters must operate their own Postgres, ClickHouse, Rivet, or equivalent storage and replay pipeline.
- It deliberately does not abstract sandbox-provider APIs, so provisioning and lifecycle management for E2B, Daytona, Vercel, or another provider remain application responsibilities.
- Each supported agent still requires its own binary, configuration, and credentials; the common API does not remove those underlying dependencies.
- The Python SDK, automatic MCP/skill/hook configuration, and todo lists appear only on the roadmap and should not be treated as current capabilities.
- OpenCode SDK/UI compatibility and Gigacode are labeled experimental, creating stability risk for production adoption of those paths.
- Git repository management and direct LLM wrapping are explicitly out of scope, so a complete development platform needs additional components.
How do you install or deploy this agent?
Install the published skill with npx skills add rivet-dev/skills -s sandbox-agent or bunx skills add rivet-dev/skills -s sandbox-agent.
For the TypeScript SDK, run npm install [email protected]. Bun users can run bun add [email protected]; using SandboxAgent.start() also requires trusting the appropriate native-binary postinstall packages.
For the HTTP server, run curl -fsSL https://releases.rivet.dev/sandbox-agent/0.4.x/install.sh | sh, followed by sandbox-agent server --token "$SANDBOX_TOKEN" --host 127.0.0.1 --port 2468. Optionally preinstall all agent binaries with sandbox-agent install-agent --all; otherwise they are installed lazily on first use. Local development can disable authentication with sandbox-agent server --no-token --host 127.0.0.1 --port 2468.
The optional CLI wrapper installs with npm install -g @sandbox-agent/[email protected]. Supply the credentials required by the chosen coding agent. For testing, sandbox-agent credentials extract-env --export prints environment variables derived from local agent configurations, including OpenAI and Anthropic API keys.
How do you use this agent?
For embedded mode, initialize const client = await SandboxAgent.start(). For a remote server, use const client = await SandboxAgent.connect({ baseUrl: "http://127.0.0.1:2468", token: process.env.SANDBOX_TOKEN }). Create a first Codex session with await client.createSession("demo", { agent: "codex", agentMode: "default" }), submit work with await client.postMessage("demo", { message: "Hello from the SDK." }), and consume output with for await (const event of client.streamEvents("demo", { offset: 0 })).
The equivalent CLI flow starts with sandbox-agent api sessions create my-session --agent codex --endpoint http://127.0.0.1:2468 --token "$SANDBOX_TOKEN", followed by sandbox-agent api sessions send-message-stream my-session --message "Hello" --endpoint http://127.0.0.1:2468 --token "$SANDBOX_TOKEN". After starting the server, open http://localhost:2468/ui/ to inspect sessions and events. In production, keep token authentication enabled and continuously copy streamed events into application-owned storage.
How does this agent compare with similar options?
Sandbox Agent is complementary to the Vercel AI SDK: Vercel AI SDK is for chat interfaces and model calls, whereas Sandbox Agent controls autonomous coding agents that write code and execute commands. Compared with an agent's official SDK, which typically assumes local processes and interactive terminals, Sandbox Agent places a server inside the sandbox and is designed for remote HTTP control. Compared with piping commands over SSH, its HTTP/SSE layer is intended to preserve streaming, tool confirmations, TTY-sensitive behavior, and human-in-the-loop flows.
FAQ
Does it automatically preserve agent sessions?
Does production deployment require a particular sandbox vendor?
What permissions and credentials are required?
sandbox-agent credentials extract-env --export can export credentials from local agent configurations for testing.