E2B vs Cloudflare Sandbox

Both run each sandbox in its own Firecracker microVM. E2B can pause a sandbox with its memory and bring it back in about a second, while Cloudflare Sandbox is a container inside the Workers platform that sleeps when idle and wakes on a fresh disk.

The companies and products

E2B

E2B calls itself the AI agent cloud: an API that gives each agent session its own isolated Linux machine.

Every E2B sandbox is a Firecracker microVM that boots from a snapshot, so it starts fast and can be paused and resumed with its memory. You build custom sandboxes from templates based on a Docker image, and drive them from Python or JavaScript SDKs. It is built for teams that run many short code, data or agent jobs, and its runtime is open source.

Cloudflare Sandbox

Cloudflare Sandbox SDK runs untrusted or AI-generated code in Linux containers on Cloudflare's network, driven from a Cloudflare Worker.

Each sandbox is a Cloudflare Container backed by a Durable Object, and each container runs in its own Firecracker microVM with its own kernel and network. You build a linux/amd64 image, pick an instance type of up to 4 vCPU and 12 GiB, and reach the sandbox through your own Worker. It suits teams already on Workers who want short-lived sandboxes that sleep when idle; for code that only calls known methods, Cloudflare also offers Dynamic Workers, which run JavaScript in V8 isolates.

Which use cases each one fits

For each use case, Battleships prices every sandbox provider on the same workload and sorts them from the cheapest monthly bill up. “16th cheapest of 367” means 15 of the other 366 providers run that workload, with every feature it needs, for less. “With limits” means the provider runs it but misses something, so it is listed after every full match. Open a use case for its whole ranking and what each provider misses.

Use case and its workloadE2B: price rankCloudflare Sandbox: price rankboat: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
E2B fits a working day but stops at 24 hours on Pro; Cloudflare wipes the disk when the container sleeps, and boat keeps the disk with no session cap.
16th cheapest of 367
$4,143 a month
162nd of 367, with limits
$1,543 a month
3rd cheapest of 367
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
An assistant that lives on its machine all month hits E2B's 24-hour cap and loses its files on Cloudflare after sleep; boat simply keeps running.
51st of 366, with limits
$5,348 a month
207th of 366, with limits
$2,188 a month
5th cheapest of 366
$657 a month
Code interpreter bursts
100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month
Short code runs suit both: Cloudflare Sandbox ranks 13th because CPU is billed only while busy, and E2B wakes a paused sandbox with its memory.
37th cheapest of 345
$421 a month
13th cheapest of 345
$144 a month
186th of 345, with limits
$2,000 a month
Sandboxes for your users
300 at once · 2 vCPU / 4 GB · 30,000 sessions of 23 min a month
All three fit sandboxes for your users; boat ranks 1st, Cloudflare wakes on the next request, and E2B can resume a paused sandbox in about a second.
23rd cheapest of 361
$2,354 a month
9th cheapest of 361
$731 a month
Cheapest of 361
$209 a month
RL rollouts
1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month
E2B ranks 2nd here: memory forks and a high start rate suit many short rollouts that branch from the same state.
2nd cheapest of 360
$9,384 a month
144th of 360, with limits
$9,428 a month
34th of 360, with limits
$2,000 a month
Agent evals
250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month
78th cheapest of 364
$1,975 a month
45th cheapest of 364
$818 a month
10th cheapest of 364
$200 a month
CI runners
40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month
CI jobs that build Docker images or Android apps want full Docker and nested virtualization; boat has both, E2B has no nested virtualization, and Cloudflare turns off iptables.
337th of 377, with limits
$1,429 a month
301st of 377, with limits
$704 a month
4th cheapest of 377
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
A dev box that runs all month needs its files kept and no session cap; boat has both, E2B stops at 24 hours, and Cloudflare starts from a fresh disk after sleep.
192nd of 368, with limits
$358 a month
70th cheapest of 368
$93 a month
18th cheapest of 368
$26 a month
Computer-use agents
50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month
E2B has a Linux desktop for computer use and boat streams one at 60fps; Cloudflare removed its built-in desktop, so you bring your own.
32nd cheapest of 369
$1,342 a month
166th of 369, with limits
$460 a month
6th cheapest of 369
$200 a month
Browser-use agents
50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month
100th of 367, with limits
$746 a month
210th of 367, with limits
$233 a month
7th cheapest of 367
$200 a month
Scraping & bots (startup scale)
50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month
57th cheapest of 346
$554 a month
250th of 346, with limits
$286 a month
6th cheapest of 346
$90 a month
Mass scraping & bots (undetectable)
1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month
227th of 338, with limits
$9,223 a month
169th of 338, with limits
$5,741 a month
71st of 338, with limits
$1,800 a month
Parallel red teaming
200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month
11th cheapest of 360
$1,043 a month
239th of 360, with limits
$325 a month
2nd cheapest of 360
$200 a month
GPU eval jobs
10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month
Can't run itCan't run itCan't run it
macOS agents
5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month
Can't run itCan't run itCan't run it

Key features

FeatureE2BCloudflare Sandboxboat
IsolationFirecracker microVM with its own kernelFirecracker microVM per container, own kernel and networkFull VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts
CPU benchmark (4 vCPU / 8 GB)12.61 runs/sNo result on this benchmark26.69 runs/s
Largest machineUp to 8 vCPU / 8 GiB self-serve, more on request; 20 GiB disk on Pro4 vCPU / 12 GiB / 20 GB disk by default (can be raised)Up to 16 vCPU / 32 GB, depending on plan
Session lengthUp to 1 hour on Hobby, 24 hours on Pro; pausing resets the clockNo fixed maximum, but stops after inactivity and no runtime is guaranteedNo cap on paid plans; you set the time to live
Files between sessionsPause saves memory and disk; resume takes about 1 second with processes runningDisk is fresh after sleep; snapshots (public beta, 30 days) or R2 backups when your code saves themDisk saved every minute and on stop; resume boots the machine again
Fork a running sandboxYes, with its memory, up to 20 copies per callNo fork; restore a saved snapshot or backup into a new sandboxYes, with its disk, without stopping it
Sleep when idleAuto-pause is opt-in; a paused sandbox wakes on the next HTTP request or SDK callStops after inactivity, wakes on the next request; CPU billed only while busyTTL based (1 h default, changeable); started again by API
Docker and nested virtualizationDocker inside; nested virtualization not supporteddocker:dind with iptables and IP forwarding turned off; nested virtualization not documentedFull Docker, root and systemd, plus /dev/kvm for Android emulators and VMs
Desktop and computer useLinux desktop for computer useBuilt-in desktop removed in SDK 0.10.2; bring your own60fps desktop and Chromium, computer-use API, embeddable stream
Inbound trafficHTTPS URL per port, public by default unless you turn on a token; no dedicated IPHTTP and WebSocket previews routed through your Worker; no raw TCP or public IPHTTPS URLs for up to 50 ports, token-protected; raw TCP; dedicated IPv4 or IPv6
Egress controlAllow and deny lists by IP, CIDR or domainallowedHosts deny-by-default list plus outbound handlers you write in Worker codeOpen internet, no provider-side allowlist
Keeping API keys out of the sandboxSecrets injected into outbound HTTPS headers (private beta)Your outbound handler adds the token for any HTTP or HTTPS host; you write the codeManaged proxy for model providers and any HTTPS API; switch a credential to another account when credits run out
Coding agentsTemplates and guides for many agents, run through the command APIRun Claude Code, Codex, OpenCode or Pi in your image; OpenCode has an SDK helperSeven agents preinstalled, with a prompt, steer and events API
Regions and self-hostingUS by default, EU and APAC on Pro via support; open-source runtime and bring your own cloud on EnterpriseSeveral regions across Cloudflare's network, nearest free one picked; platform cannot be self-hostedEU only (Germany, Finland, France); no self-hosting
Every feature Battleships tracks (43)
FeatureE2BCloudflare Sandboxboat
Full VM (own kernel)YesYesYes
Docker insideYesYesYes
Nested virtualizationNoNoYes
RootYesYesYes
SystemdYesNot publishedYes
Desktop GUIYesNoYes
BrowserYesNoYes
Computer-use APIYesNoYes
SSHYesYesYes
Persistent diskYesNoYes
Pause/resumeYesNoYes
Automatic snapshotsYesNoYes
Fork/cloneYesNoYes
Live fork (no pause)YesNoYes
Memory forkYesNoNo
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo
Wake on requestYesYesNo
HTTPS preview URLsYesYesYes
Raw TCP inboundNoNoYes
Public IPv4NoNoNo
Egress allowlistYesYesNo
Secret proxyYesYesYes
Secret proxy for any APIYesYesYes
Preinstalled agentsYesYesYes
Agent harness APINoYesYes
MCP serverYesNoNo
GPUNoNoNo
WindowsNoNoNo
Arm64NoNoNo
Self-hostingYesNoNo
BYOCYesNoNo
Open sourceYesYesNo
Scoped API keysNot publishedNot publishedYes
Spend limitsYesNoYes
Usage per sandbox (API)NoNot publishedYes
Audit logsNot publishedYesNo
SSONoYesNo
SOC 2YesYesNo
HIPAAYesYesNo
EU data residencyYesYesYes
Zero data retentionNot publishedNot publishedYes

Performance

E2B12.61 runs/s
Cloudflare SandboxNot measured
boat26.69 runs/s

On the hpc-sandbox-benchmarks Node.js build-and-test loop at 4 vCPU / 8 GB, in the same run, boat did 26.69 runs per second and E2B did 12.61, so boat finished about twice as much CPU work in the same time. Cloudflare Sandbox has no result on that benchmark, so there is no comparable CPU number for it. This measures CPU speed only, not start time.

Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Cloudflare Sandbox has no published run in this suite yet, so there is no like-for-like number to compare.

Pricing in five scenarios

Each bill is priced from the providers' public price lists by the open Battleships engine, with the cheapest plan that runs the scenario.

ScenarioE2B, a monthCloudflare Sandbox, a monthboat, a month
One coding agent, workdays
4 vCPU / 8 GB, 50 GB disk, 8 hours a day, 22 days a month, files kept between days
$202 · Pro$39 · Workers Paid · with limits$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$368 · Pro · with limits$148 · Workers Paid · with limits$26 · $20/mo
50 agents in parallel
50 machines of 4 vCPU / 8 GB at once, 8-hour sessions, 1,100 sessions a month, Docker inside
$2,773 · Pro$1,660 · Workers Paid · with limits$317 · $20/mo × 3 seats
Sandboxes for your users
2 vCPU / 4 GB, 30,000 sessions of 10 minutes a month, up to 300 at once
$1,395 · Pro+ (600 concurrent)$476 · Workers Paid$200 · $100/mo × 2 seats
1,000 short jobs at once
2 vCPU / 4 GB, 1,000 at once, 3 minutes each, 200,000 jobs a month
$2,797 · Pro++ (1,100 concurrent)$1,889 · Workers Paid · with limits$2,000 · $2000/mo · with limits

E2B: E2B bills per second for the vCPU and RAM you set, idle time included, until you pause or kill the sandbox. Pro costs $150 a month for higher limits with no usage credit, and more concurrency costs $500 a month per 500 slots.

Cloudflare Sandbox: Cloudflare needs Workers Paid ($5 a month minimum). CPU is billed only while busy, while memory and disk are billed on the instance size until the container sleeps, and 4 vCPU always comes with 12 GiB.

Cloudflare Sandbox: Durable Object and Worker requests are billed on top, and egress is free up to 1 TB in North America and Europe, then $0.025 per GB.

Cloudflare Sandbox: Plans start at $20 a month, and the whole fee is usage credit. You pay per second while a sandbox runs, and a stopped sandbox costs nothing and keeps its disk.

Limits in those scenarios

Cloudflare's disk resets after sleep, so the coding-agent, always-on and 50-agent scenarios do not fit without your own snapshot or backup code. E2B caps a session at 24 hours on Pro, which rules it out for the agent that never stops, and its price for disk beyond 20 GiB is not published. For 1,000 short jobs at once, E2B Pro++ fits but queues bursts above 300 starts a minute, while Cloudflare's default 1,500 vCPU account limit is short of the 2,000 vCPU needed and boat's $2,000 plan caps starts per hour and per day.

ScenarioE2BCloudflare Sandboxboat
One coding agent, workdays
  • disk beyond 20 GiB: price unknown
  • egress price not published
  • missing persistent disk
None that bite
One agent that never stops
  • Pro: sessions capped at 24 h
  • disk beyond 20 GiB: price unknown
  • egress price not published
  • missing persistent disk
None that bite
50 agents in parallel
  • egress price not published
  • missing persistent disk
None that bite
Sandboxes for your users
  • egress price not published
None that biteNone that bite
1,000 short jobs at once
  • egress price not published
  • bursts above 300 starts/min are queued (a burst of 333 takes ~2 min to start)
  • Workers Paid: max 1,500 vCPU running at once (needs 2,000)
  • max 2,400 starts/day (needs ~6,667)
  • max 600 starts/hour (needs ~1,000)
  • bursts above 90 starts/min are queued (a burst of 333 takes ~4 min to start)

Which one should you use?

Use E2B when

you run many short jobs that pause between requests and must resume with their memory, need big bursts, or want to self-host.

  • Memory pause, fork and wake. For jobs that sleep between requests: a paused sandbox comes back in about a second with its processes still running, and can fork.
  • Big bursts of short jobs. E2B Pro++ fits 1,000 short jobs at once, where Cloudflare's default account limit of 1,500 vCPU running falls short.
  • Open source and your own cloud. Its runtime is Apache-2.0, and Enterprise customers can run it in their own AWS, GCP or Azure account.

Use Cloudflare Sandbox when

your app already runs on Workers and you want short sandboxes that sleep when idle, bill CPU only while busy, and follow egress rules you code.

  • CPU billed only while busy. For many short, spiky sessions: a sandbox sleeps when idle, wakes on the next request, and bills CPU only while it works.
  • Egress rules you can program. Cloudflare can block every host except the ones you list, and run your own Worker code on each outbound request.
  • Next to the rest of Workers. If your app already runs on Workers, sandboxes sit next to Durable Objects and R2, in several regions.

Where boat fits

Both E2B and Cloudflare Sandbox are built around short sessions: E2B stops at 24 hours, and Cloudflare sleeps and forgets its disk. If your agents work for hours on builds, tests, Docker, emulators and a browser, boat gives each one a full, faster VM that keeps its files and never cuts it off.

Work that lasts

E2B stops a session at 24 hours on Pro, so your code must pause and resume it. Cloudflare wipes the disk on sleep unless your code saves a snapshot, which is in beta and expires after 30 days. boat saves the disk every minute.

A whole, fast machine

Neither offers nested virtualization, so Android emulators and VMs will not start, and Cloudflare runs Docker with iptables off on 20 GB of disk. boat is a full VM with /dev/kvm and systemd, and did 26.69 runs/s to E2B's 12.61.

Agents and keys built in

On Cloudflare you bake each agent into your image and write the handler that adds every token; on E2B secret injection is a private beta. boat ships seven agents you drive from outside and a credentials proxy for any HTTPS API.

Use boat when your agents do real work for hours: installs, builds, full Docker, emulators and a desktop, on a fast machine that keeps its files and never cuts them off. Compare it one to one: boat vs E2B and boat vs Cloudflare Sandbox.

Questions people ask

Is E2B cheaper than Cloudflare Sandbox?

No. Cloudflare's estimate is lower in all five scenarios on this page, for example $476 a month against $1,395 for sandboxes for your users. But Cloudflare only fits that one scenario, because its disk resets after sleep and its default vCPU limit is too low for 1,000 jobs at once.

Which is faster, E2B or Cloudflare Sandbox?

E2B did 12.61 runs per second on the hpc-sandbox-benchmarks CPU test at 4 vCPU / 8 GB, and Cloudflare has no result on that test, so they cannot be compared. boat did 26.69 in the same run.

Can E2B and Cloudflare Sandbox run Docker?

Both run Docker inside the sandbox. Cloudflare uses docker:dind with iptables and IP forwarding turned off, and E2B does not support nested virtualization. boat runs full Docker and exposes /dev/kvm for Android emulators and VMs.

Does Cloudflare Sandbox keep files like E2B?

Only while the container runs. When it sleeps, the next start uses a fresh disk unless your code saved a snapshot (public beta, kept 30 days) or a backup to R2. E2B keeps memory and disk when it pauses, and boat keeps the disk on its own.

Can a sandbox run for days on E2B or Cloudflare?

Not in one E2B session: it stops after 24 hours on Pro and 1 hour on Hobby, though pausing resets the clock. Cloudflare sets no fixed maximum but stops idle containers and does not guarantee any runtime. boat has no session cap on paid plans.

Can I limit where a sandbox connects to?

Yes on both. E2B has allow and deny lists by IP, CIDR or domain, and Cloudflare has an allowedHosts list plus outbound handlers you write in Worker code. boat does not offer a provider-side egress allowlist today.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons