Rivet Sandbox Agent SDK provides a universal API for coding agents, allowing developers to work with different agent runtimes like Claude Code, Codex, OpenCode, and Amp without rewriting their integration for each one. It addresses the fragmentation across agent APIs, session handling, and streaming formats that has historically made agent integrations complex and difficult to maintain.
According to Rivet co-founder and CTO Nathan Flurry, the difficulty of building agentic systems comes down to three core challenges: API fragmentation, transient state, and deployment variance across providers.
Building coding agents is hard. Claude Code has one API. Codex has another. OpenCode and Amp each do things differently. And even if you picked one, you’d face session state disappearing when processes crash, different integration code for every sandbox provider, and no way to stream transcripts back to your application.
Each agent comes with its own event format, session model, and permission system. For example, Claude Code uses JSONL over stdout while Codex uses JSON-RPC, forcing developers to build two different integrations for each of them. Deployment adds another layer of complexity, as platforms like Daytona, Vercel, and E2B each expose their own custom APIs.
In contrast, Rivet’s Sandbox Agent SDK offers the possibility of writing one integration against a unified API and swap agents with just a configuration change. Here’s a minimal example of how to create an agent session using the SDK:
import { SandboxAgent } from "sandbox-agent";
const client = await SandboxAgent.start();
await client.createSession("my-session", {
agent: "claude", // or "codex", "opencode", "amp"
permissionMode: "auto",
});
for await (const event of client.streamEvents("my-session")) {
console.log(event.type, event.data);
}
This works alongside a unified session schema, where all agent-related events, including session lifecycle, streaming, human-in-the-loop questions, tool execution approval, and errors, follow a consistent format, eliminating the need to implement custom logic to adapt each agent’s output.
Commenting the announcement on X.com, Gianfranco P. wrote:
This is the abstraction layer that the coding agent ecosystem desperately needed. The fragmentation is a real pain point for building AI-powered dev tools. One integration, swap agents with a config change = the dream for testing which model actually performs best.
A Hacker News reader asked whether you can “think of [Rivet’s Sandbox Agent SDK] as ACP (agent client protocol) over-HTTP”. Flurry clarified that while the analogy is broadly accurate, “ACP seems to be focused on providing a universal API for the subset of features required for editors”, whereas the Sandbox Agent SDK is far more comprehensive, with a focus on full agent automation.
The Sandbox Agent SDK is a lightweight 15MB static binary, built in Rust with no runtime dependencies. It can be installed in any environment capable of executing a Linux binary, including Daytona, E2B, Vercel Sandboxes, Docker, and more. The project is available on GitHub.
