Back to Rivet

Sandbox Coding Agent

examples/sandbox-coding-agent-vercel/README.md

2.2.12.0 KB
Original Source

Note: This is the Vercel-optimized version of the sandbox-coding-agent example. It uses the hono/vercel adapter and is configured for Vercel deployment.

Sandbox Coding Agent

Example project demonstrating a Rivet Actor chat UI backed by the new rivetkit/sandbox actor.

Getting Started

sh
git clone https://github.com/rivet-dev/rivet.git
cd rivet/examples/sandbox-coding-agent-vercel
pnpm install
pnpm dev

Features

  • Uses rivetkit/sandbox instead of constructing SandboxAgent clients directly
  • One sandbox actor per agent key
  • Built-in transcript persistence through the sandbox actor
  • Provider selection with SANDBOX_PROVIDER=docker|daytona|e2b
  • Live UI updates via Rivet Actor events

Prerequisites

  • On Vercel, use SANDBOX_PROVIDER=daytona or SANDBOX_PROVIDER=e2b
  • For Daytona, set DAYTONA_API_KEY
  • For E2B, set E2B_API_KEY
  • Set the model provider credentials needed inside the sandbox, such as OPENAI_API_KEY, ANTHROPIC_API_KEY, or CODEX_API_KEY

Implementation

The example keeps a thin UI-facing agent actor, but the sandbox lifecycle and sandbox-agent API now live behind sandboxActor(...).

Resources

Read more about Rivet Actors, actions, and events.

License

MIT