Skip to main content
← Back to Templates

Sandbox Coding Agent

Example project demonstrating queue-driven Rivet Actor sessions that control a Sandbox Agent coding runtime.

Sandbox Coding Agent

Features

  • Actor-per-agent pattern with a coordinating manager Rivet Actor
  • Queue-based intake using c.queue.next inside the run loop
  • Sandbox Agent SDK sessions per agent with streamed output
  • Persistent history stored in Rivet Actor state
  • Live status updates via events and polling

Prerequisites

  • Sandbox Agent endpoint configured with SANDBOX_AGENT_URL and SANDBOX_AGENT_TOKEN if you are not running locally
  • API key for the coding agent you choose inside the Sandbox Agent environment, such as OPENAI_API_KEY for codex

Implementation

Each AI agent Rivet Actor creates or reuses a Sandbox Agent session, streams turn events, and broadcasts deltas back to the UI.

Resources

Read more about queues, run handlers, state, and events.