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. Cloudflare Sandbox is a container inside the Workers platform that sleeps when idle and wakes on the next request. It starts on a fresh disk unless your code restores a snapshot or backup, or keeps files on a mounted R2 bucket.
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. Its runtime is open source, and E2B Embed runs it on your own infrastructure.
- Isolation
- Firecracker microVM per sandbox
- Open source and self-hosting
- Runtime under Apache-2.0; E2B Embed runs it with Docker Compose, Terraform or Kubernetes
- Bring your own cloud
- Enterprise data plane in your AWS, GCP or Azure account
- Compliance
- SOC 2 Type II; HIPAA BAA on request
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. 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. The disk resets when the container stops, and your code keeps files with snapshots, automatic saves, R2 backups or R2 bucket mounts. It suits teams already on Workers who want sandboxes that sleep when idle. For code that only calls known methods, Cloudflare also offers Dynamic Workers, which run JavaScript in V8 isolates.
- Largest instance
- 4 vCPU, 12 GiB memory, 20 GB disk
- Compliance
- Cloudflare holds a SOC 2 Type II report
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. “20th cheapest of 365” means 19 of the other 364 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 workload | E2B: price rank | Cloudflare Sandbox: price rank | boat: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month E2B fits a software factory (20th) but stops one run at 24 hours on Pro. Cloudflare is a compromise: 20 GB of disk at most, Docker with iptables off, and no built-in desktop. boat ranks 5th and saves the disk with no code. | 20th cheapest of 365 $4,143 a month | 192nd of 365, with limits $1,543 a month | 5th cheapest of 365 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB Cloudflare fits an assistant that lives on its machine all month (43rd, $2,188 a month) when your code keeps files with snapshots, automatic saves or an R2 mount. E2B is a compromise because one run stops at 24 hours on Pro. boat ranks 6th. | 82nd of 361, with limits $5,348 a month | 43rd cheapest of 361 $2,188 a month | 6th cheapest of 361 $657 a month |
| Code interpreter bursts 100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month Both fit short code runs. Cloudflare ranks 17th ($144 a month) because CPU is billed only while busy; E2B ranks 43rd ($421) and wakes a paused sandbox with its memory. | 43rd cheapest of 336 $421 a month | 17th cheapest of 336 $144 a month | 189th of 336, 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 Both fit sandboxes for your users: Cloudflare ranks 19th at $731 a month and E2B 33rd at $2,354. boat ranks 3rd at $209. | 33rd cheapest of 349 $2,354 a month | 19th cheapest of 349 $731 a month | 3rd cheapest of 349 $209 a month |
| RL rollouts 1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month E2B ranks 5th: memory forks and a high start rate suit many short rollouts from one state. Cloudflare and boat are a compromise here. | 5th cheapest of 349 $9,384 a month | 147th of 349, with limits $9,428 a month | 39th of 349, with limits $2,000 a month |
| Agent evals 250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month | 87th cheapest of 359 $1,975 a month | 60th cheapest of 359 $818 a month | 10th cheapest of 359 $200 a month |
| CI runners 40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month Both are a compromise for CI that builds Docker images or Android apps. E2B's docs list nested virtualization as not supported, and Cloudflare runs Docker with iptables off on 20 GB of disk. boat ranks 2nd. | 338th of 374, with limits $1,429 a month | 303rd of 374, with limits $704 a month | 2nd cheapest of 374 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB Cloudflare fits a dev box (123rd, $93 a month) with SSH and files kept through snapshots or an R2 mount. E2B is a compromise because of its 24-hour cap. boat ranks 19th at $26 and keeps its disk with no code. | 208th of 371, with limits $358 a month | 123rd cheapest of 371 $93 a month | 19th cheapest of 371 $26 a month |
| Computer-use agents 50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month E2B fits with a Linux desktop for computer use. Cloudflare removed its built-in desktop in SDK 0.10.2; you build one into your own image, or use Browser Run for headless browsers. boat streams a desktop at 60 fps. | 34th cheapest of 367 $1,342 a month | 207th of 367, with limits $460 a month | 7th cheapest of 367 $200 a month |
| Browser-use agents 50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month | 126th of 356, with limits $746 a month | 68th of 356, with limits $233 a month | 7th cheapest of 356 $200 a month |
| Scraping & bots (startup scale) 50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month | 62nd cheapest of 343 $554 a month | 102nd cheapest of 343 $286 a month | 6th cheapest of 343 $90 a month |
| Mass scraping & bots (undetectable) 1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month | 226th of 327, with limits $9,223 a month | 168th of 327, with limits $5,741 a month | 73rd of 327, with limits $1,800 a month |
| Parallel red teaming 200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month | 17th cheapest of 351 $1,043 a month | 25th cheapest of 351 $325 a month | 3rd cheapest of 351 $200 a month |
| GPU eval jobs 10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month | Not ranked: misses a requirement | Not ranked: misses a requirement | Not ranked: misses a requirement |
| macOS agents 5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month | Not ranked: misses a requirement | Not ranked: misses a requirement | Not ranked: misses a requirement |
Key features
| Feature | E2B | Cloudflare Sandbox | boat |
|---|---|---|---|
| Isolation | Firecracker microVM with its own kernel | Firecracker microVM per container, own kernel and network | Full VM with its own kernel, on hosts dedicated to boat (AMD Ryzen 7 9700X and Ryzen 9 9950X); shared vCPUs |
| CPU benchmark (V8 Web Tooling, 4 vCPU / 8 GB, StarSling run of 3 October 2026) | 11.08 runs/s, rank 7 of 15 (shared) | Not in this run | 28.06 runs/s, second of 15 (shared rank 2), on a Ryzen 9 9950X host |
| Largest machine | Up to 8 vCPU / 8 GiB self-serve, more on request; 20 GiB disk on Pro | 4 vCPU / 12 GiB / 20 GB disk | 16 vCPU / 32 GB / 251 GB disk on the $100 plan and above |
| Session length | One run: up to 1 hour on Hobby, 24 hours on Pro; pausing resets the clock | No fixed maximum; stops after inactivity, and no runtime is guaranteed | No cap once auto-stop is off on a paid plan; auto-stop defaults to 1 hour, up to 30 days |
| Files between sessions | Pause saves memory and disk; resume takes about 1 second with processes running; a paused sandbox is kept indefinitely | Disk is fresh after sleep; your code keeps files with snapshots (public beta, 30 days), scheduled automatic saves, R2 directory backups or a mounted R2 bucket | Disk saved every minute and at each stop, with no code; kept at least 14 days, longer as a saved snapshot; resume is like a reboot |
| Fork a running sandbox | Yes, with its memory, up to 20 copies per call | Snapshot or back up a running sandbox, then start new sandboxes from it; no one-call fork | One call, without stopping it; the fork uses the last 1-minute disk snapshot |
| Sleep when idle | Auto-pause is opt-in; a paused sandbox wakes on the next HTTP request or SDK call | Stops after inactivity, wakes on the next request; CPU billed only while busy | Auto-stop timer (1 hour by default); no idle timer; full rate while running; started again by API |
| Docker and nested virtualization | Docker inside; docs list nested-virtualization runtimes as not supported | docker:dind with iptables and IP forwarding turned off; nested virtualization not documented | Docker with BuildKit and Compose, root and systemd, plus /dev/kvm for Android emulators and VMs |
| Desktop and computer use | E2B Desktop sandbox with VNC streaming | Built-in desktop removed in SDK 0.10.2; build one into your own image, or use the separate Browser Run service | 1920x1080, 60 fps desktop and Chrome, computer tools, embeddable stream |
| Inbound traffic | HTTPS URL per port, public by default unless you turn on a token; no public IP per sandbox | HTTP and WebSocket previews routed through your Worker; SSH; no raw TCP inbound or public IP | Up to 50 HTTPS URLs, token-gated by default; SSH; public IPv6; raw ports over IPv6 on sandboxes with no IPv4 of their own |
| Egress control | Allow and deny lists by IP, CIDR or domain | allowedHosts deny-by-default list plus outbound handlers you write in Worker code | Open internet; no provider-side allowlist, so you set firewall rules inside the VM |
| Keeping API keys out of the sandbox | Secrets injected into outbound HTTPS headers (private beta) | Your outbound handler adds the token for any HTTP or HTTPS host; you write the code | Optional AI credentials proxy ($1 a day while on, plus $1 per 1,000 requests) for supported model providers and HTTPS APIs you register |
| Coding agents | Templates and guides for many agents; you run them through the command API | Guides for Claude Code, Codex, OpenCode and Pi in your image | Seven harnesses installed, with a prompt, steer and events API |
| Regions and self-hosting | US by default, EU and APAC enabled by support; open-source runtime and your own cloud on Enterprise | Several regions across Cloudflare's network; pin to a region or jurisdiction; platform cannot be self-hosted | Germany, Finland and France; no US or Asia region; no self-hosting |
Every feature Battleships tracks (43)
| Feature | E2B | Cloudflare Sandbox | boat |
|---|---|---|---|
| Full VM (own kernel) | Yes | Yes | Yes |
| Docker inside | Yes | Yes | Yes |
| Nested virtualization | No documented way | No documented way | Yes |
| Root | Yes | Yes | Yes |
| Systemd | Yes | Not published | Yes |
| Desktop GUI | Yes | No documented way | Yes |
| Browser | Yes | With your own setup | Yes |
| Computer-use API | Yes | No documented way | Yes |
| SSH | Yes | Yes | Yes |
| Persistent disk | Yes | With your own setup | Yes |
| Pause/resume | Yes | No documented way | Yes |
| Automatic snapshots | Yes | With your own setup | Yes |
| Fork/clone | Yes | With your own setup | Yes |
| Live fork (no pause) | Yes | With your own setup | Yes |
| Memory fork | Yes | No documented way | No documented way |
| Custom image (Docker or snapshot) | Yes | Yes | Yes |
| ≥24 h sessions | Yes | Yes | Yes |
| Idle auto-stop | Yes | Yes | No documented way |
| Wake on request | Yes | Yes | No documented way |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | No documented way | No documented way | Yes |
| Public IPv4 | No documented way | No documented way | No documented way |
| Egress allowlist | Yes | Yes | No documented way |
| Secret proxy | Yes | Yes | Yes |
| Secret proxy for any API | Yes | Yes | Yes |
| Preinstalled agents | Yes | Yes | Yes |
| Agent harness API | No documented way | With your own setup | Yes |
| MCP server | Yes | No documented way | No documented way |
| GPU | No documented way | No documented way | No documented way |
| Windows | No documented way | No documented way | No documented way |
| Arm64 | No documented way | No documented way | No documented way |
| Self-hosting | Yes | No documented way | No documented way |
| BYOC | Yes | No documented way | No documented way |
| Open source | Yes | Yes | No documented way |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | Yes | No documented way | Yes |
| Usage per sandbox (API) | No documented way | Not published | Yes |
| Audit logs | Not published | Yes | No documented way |
| SSO | No documented way | Yes | No documented way |
| SOC 2 | Yes | Yes | No documented way |
| HIPAA | Yes | Yes | No documented way |
| EU data residency | Yes | Yes | No documented way |
| Zero data retention | Not published | Not published | Yes |
Performance
In StarSling's run of 3 October 2026 (run 37073680030), the V8 Web Tooling Benchmark at 4 vCPU / 8 GB, boat did 28.06 runs/s (second of 15) and E2B did 11.08 (rank 7, shared), about 2.5x. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host; boat also places sandboxes on Ryzen 7 9700X hosts, which this run did not measure. Providers ran on different hardware in different regions. Cloudflare Sandbox is not in that run, so we cannot say how its CPU compares. For start time with 100 at once, at each provider's default size, ComputeSDK measured a median of 671 ms for Cloudflare and 1.1 s for E2B (6 November 2026). boat is not in ComputeSDK.
V8 Web Tooling Benchmark at a 4 vCPU / 8 GB target, runs per second, higher is better. Source: StarSling's run of 3 October 2026 (run 37073680030), median of 5 sandboxes. Providers ran on different hardware in different regions. StarSling gives a shared rank when the run cannot separate two providers. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure. Cloudflare Sandbox is not in the public benchmarks we use, so we cannot say which is faster.
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. Start limits, per-start fees and plan minimums are in the price, boat's included.
| Scenario | E2B, a month | Cloudflare Sandbox, a month | boat, 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 | $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 | $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 | $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 | $8,800 · $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: $0.33 an hour for 4 vCPU / 8 GiB. A paused sandbox costs nothing. Hobby costs $0 with a one-time $100 credit. Pro costs $150 a month for higher limits, with no usage credit.
Cloudflare Sandbox: Cloudflare needs Workers Paid ($5 a month minimum). CPU is billed only while in use, at $0.072 per vCPU-hour. Memory and disk are billed on the instance size until the container sleeps, including the idle wait before it sleeps, and 4 vCPU always comes with 12 GiB. 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. Snapshot pricing is not published.
Cloudflare Sandbox: Plans cost $20, $100, $500 or $2,000 a month, and the whole plan price comes back as VM time for that month. Included time does not carry over. A 4 vCPU / 8 GB sandbox costs $0.036 an hour, billed per second while it runs, busy or idle. A stopped sandbox has no compute charge, and boat keeps its disk for at least 14 days. Saved snapshots above the included count and the optional AI credentials proxy still charge while sandboxes are stopped. The $20 plan includes 200 starts a day; extra starts cost $0.03 to $0.07. A card is required, also for the 7-day trial.
Limits in those scenarios
E2B caps one run at 24 hours on Pro, so the agent that never stops needs a daily pause and is marked as not fitting as-is; its price for disk beyond 20 GiB is not published. Cloudflare fits the other four scenarios, with files kept through snapshots, automatic saves or R2 that your code sets up; its local disk tops out at 20 GB. For 1,000 short jobs at once, E2B Pro++ fits and queues bursts above 300 starts a minute. Cloudflare's default 1,500 vCPU account limit is short of the 2,000 vCPU needed, and Cloudflare raises it on request. boat does not fit that burst as-is: the $2,000 plan includes 2,400 starts a day, charges for starts above 90 a minute and refuses them above 270 with 429. boat never queues a start.
| Scenario | E2B | Cloudflare Sandbox | boat |
|---|---|---|---|
| One coding agent, workdays |
| None for this scenario | None for this scenario |
| One agent that never stops |
| None for this scenario | None for this scenario |
| 50 agents in parallel |
| None for this scenario | None for this scenario |
| Sandboxes for your users |
| None for this scenario | None for this scenario |
| 1,000 short jobs at once |
|
|
|
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 with its memory.
- Big bursts of short jobs. E2B Pro++ fits 1,000 short jobs at once. Cloudflare's default account limit of 1,500 vCPU running needs a raise for that.
- 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 sandboxes from your own image 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 a region you can pin.
Where boat fits
E2B and Cloudflare Sandbox are both built around short sessions. E2B Pro stops one run at 24 hours, and Cloudflare keeps files only through snapshots, automatic saves or R2 that your code sets up. If your agents work for hours on builds, tests, Docker, emulators and a browser, boat gives each one a full VM that saves its disk with no code. Cloudflare and E2B both cost less in the 1,000-job burst.
Files kept with no code
E2B Pro stops one run at 24 hours unless your code pauses and resumes it. Cloudflare starts on a fresh disk after sleep unless your code restores a snapshot (public beta, kept 30 days) or backup, or keeps files on a mounted R2 bucket. boat saves the disk every minute and keeps a stopped disk at least 14 days, longer as a saved snapshot.
A whole machine
Neither E2B nor Cloudflare documents nested virtualization, and Cloudflare runs Docker with iptables off on 20 GB of disk. boat is a full VM with /dev/kvm and systemd. In StarSling's run of 3 October 2026 it did 28.06 V8 Web Tooling runs/s on a Ryzen 9 9950X host, and E2B 11.08.
Agents 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 an optional credentials proxy ($1 a day plus $1 per 1,000 requests).
Use boat when your agents do hours of installs, builds, full Docker, emulators and a desktop on a full VM that saves its disk with no code. Compare it one to one: boat vs E2B and boat vs Cloudflare Sandbox.
boat's own limits
- Plans start at $20 a month. The plan price comes back as VM time for that month. Unused time does not carry over. Source
- Starts (create, fork, resume): the $20 plan includes 12 a minute, 60 an hour and 200 a day. The $2,000 plan includes 90 a minute, 600 an hour and 2,400 a day. Extra starts cost $0.03 to $0.07. A start fails with 429 above 3 times the included starts per minute, or 6 times per hour or per day. Source
- A stopped sandbox has no compute charge. boat keeps its disk for at least 14 days. A saved snapshot keeps it longer; extra saved snapshots and the AI credentials proxy are paid. Source
- Auto-stop defaults to 1 hour. You can turn it off on a paid plan. The trial allows 2 hours at most. Source
- boat saves the disk every minute and at each stop. Memory, running programs and /tmp are not saved: a resume is like a reboot. A machine failure loses writes after the last good snapshot. Source
- Machines run in Germany, Finland and France only. Snapshot copies can be stored outside the EU. Source
- Public IPv6 and outbound IPv4. No dedicated IPv4. The IP changes at each resume. Source
- Hosts are AMD Ryzen 7 9700X and Ryzen 9 9950X. vCPUs are shared. No GPU. You cannot boot your own Docker image. Source
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, and $39 against $202 for one agent on workdays. Cloudflare fits four of the five; for 1,000 jobs at once its default vCPU limit needs a raise. boat comes to $200 and $20 in those two scenarios.
Which is faster, E2B or Cloudflare Sandbox?
E2B did 11.08 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB in StarSling's run of 3 October 2026. Cloudflare is not in that run, so we cannot compare CPU. For start time with 100 at once, ComputeSDK measured 671 ms for Cloudflare and 1.1 s for E2B. boat did 28.06 runs/s in the StarSling 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. E2B's docs list nested virtualization as not supported. boat runs Docker with BuildKit and exposes /dev/kvm for Android emulators and VMs.
Does Cloudflare Sandbox keep files like E2B?
Yes, when your code sets it up. The next start after sleep uses a fresh disk unless your code restores a snapshot (public beta, kept 30 days), a scheduled automatic save or an R2 backup, or works in a mounted R2 bucket. E2B keeps memory and disk when it pauses. boat saves the disk with no code and keeps a stopped disk at least 14 days.
Can a sandbox run for days on E2B or Cloudflare?
On E2B one run stops after 24 hours on Pro and 1 hour on Hobby; pausing and resuming resets the clock. Cloudflare sets no fixed maximum but stops idle containers and does not guarantee any runtime. boat has no session cap once auto-stop is off on a paid plan (the default is 1 hour).
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 has no provider-side egress allowlist today; you set firewall rules inside the VM.
Try boat
Install the CLI, then run boat new.
7-day free trial