Workers Paid
$5
Per month
- 25 GiB-hours memory included
- 375 vCPU-minutes included
- 200 GB-hours disk included
Respan Gateway: up to 40% off tokens on Gemini, GPT, Claude and 1,000+ more models. One API key, 0% fee.
Cloudflare Sandboxes let a Cloudflare Worker run untrusted or generated code, such as code an AI agent writes, without exposing your application's memory or data. Code runs in one of two environments: Containers, where each instance is a microVM with its own kernel and network running a full Linux image in any language, or Dynamic Workers, which load JavaScript, Python, or WebAssembly as a new Worker at runtime. Your Worker decides which APIs, data, and internet access the sandboxed code gets.
The @cloudflare/sandbox SDK runs commands and streams their output, starts background processes, opens terminals, moves files, and exposes web servers running in a sandbox through preview URLs. Workspaces can be backed up to R2 or mounted from an R2 bucket, and saving and restoring a workspace is in beta. Sandboxes are coordinated through Durable Objects, so they fit most naturally for teams already building on Workers.
Sandboxes need the Workers Paid plan at $5 a month, which includes 25 GiB-hours of memory, 375 vCPU-minutes, and 200 GB-hours of disk for containers each month. After that, containers bill for every 10 milliseconds they run, at $0.000020 per vCPU-second of active CPU and $0.0000025 per GiB-second of provisioned memory, and charges stop when an instance goes to sleep. Workers, Durable Objects, and egress bill separately, and the SDK assumes you build on Workers, so teams outside Cloudflare's platform may prefer the Cloudflare Sandbox alternatives.
Core capabilities this platform advertises.
What this tool does well, and the limitations to keep in mind.
Pros
Cons
What's included in each plan, and how the tiers compare.
$5
Per month
$0.000020/vCPU-second
Per 10 ms while running
Teams building AI apps on Cloudflare Workers that need to run untrusted or generated code
Respan routes your agent's model calls across 1,000+ models at up to 55% off tokens and traces each sandbox step beside the call that triggered it. Book a demo to see it on your own traffic.
Top companies in Agent Sandboxes you can use instead of Cloudflare Sandbox.
E2B
A Firecracker microVM for each agent session
Daytona
Isolated sandboxes with a dedicated kernel and network stack
Vercel Sandbox
Firecracker microVM isolation with a dedicated kernel
Blaxel
MicroVM sandboxes with an in-memory root filesystem
Runloop
Micro-VM sandboxes with a container isolation layer
Microsandbox
Apache 2.0 open-source runtime
Side-by-side comparisons with other tools in this category.