Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Sandbox Agent SDK in E2B Sandbox (JavaScript)

Run Sandbox Agent inside E2B, then control it with the Sandbox Agent SDK (npm: sandbox-agent).

Why use Sandbox Agent SDK

Running coding agents remotely is hard: local-first SDK assumptions, SSH streaming/TTY issues, and agent-specific APIs.

Sandbox Agent gives you a simple way to launch coding agents inside sandboxes and manage them over HTTP directly from your backend.

  • Single API, Multiple Agents — Drive Claude Code, Codex, OpenCode, Cursor, Amp, and Pi from one unified interface with complete feature support — no need to build separate integrations for each.
  • Standardized Event Schema — Every agent outputs events in its own format. The universal session schema brings them all into a single, normalized structure that's easy to persist and replay.
  • Two Ways to Deploy — Use it as a self-contained HTTP server, or drop in the TypeScript SDK to embed it right inside your application.

Setup

  1. Install dependencies:
npm install
  1. Create .env:
E2B_API_KEY=your_e2b_api_key

# At least one provider key
OPENAI_API_KEY=your_openai_api_key
# ANTHROPIC_API_KEY=your_anthropic_api_key

Provider credential options for other agents: Sandbox Agent credentials docs.

  1. Run:
npm run start

This starts up your Sandbox Agent and connects it to your E2B Sandbox. To run one prompt and stream events, uncomment the block in src/index.ts.

References