Cloud Sandbox Extension Examples
These examples are for manual verification of the cloud sandbox backends that live under agents.extensions.sandbox.
They intentionally keep the flow simple:
- Build a tiny manifest in memory.
- Create a
SandboxAgentthat inspects that workspace through one shell tool. - Run the agent against E2B, Modal, Daytona, Cloudflare, Runloop, Blaxel, or Vercel.
All of these examples require OPENAI_API_KEY, because they call the model through the normal Runner path. Each cloud backend also needs its own provider credentials.
E2B
Setup
Install the repo extra:
bash
uv sync --extra e2bCreate an E2B account, create an API key, and export it as E2B_API_KEY. The official setup docs are:
Export the required environment variables:
bash
export OPENAI_API_KEY=...
export E2B_API_KEY=...Run
bash
uv run python examples/sandbox/extensions/e2b_runner.py --streamUseful flags:
--sandbox-type e2b_code_interpreter