Cloudflare Sandbox vs Beam
Cloudflare Sandbox runs each sandbox as a container in its own Firecracker microVM, driven from a Worker, that sleeps when idle and wakes on the next request. Beam is a serverless GPU platform whose sandboxes are fast gVisor containers, with a separate line of CPU VMs that keep their disk.
The companies and products
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.
- Largest instance
- 4 vCPU, 12 GiB memory, 20 GB disk (defaults, can be raised)
- Account limits
- 1,500 vCPU, 6 TiB memory and 30 TB disk running at once
- Compliance
- Cloudflare holds a SOC 2 Type II report
Beam
Beam is a serverless cloud for GPU inference, sandboxes and background jobs, built on its open-source runtime Beta9.
Beam runs functions, REST endpoints, task queues, pods, sandboxes and VMs on CPUs and GPUs, all from a Python or TypeScript SDK. A sandbox is a container isolated with gVisor that starts in a second or two, lives until you terminate it or its time to live runs out, and can be saved as a filesystem image or a memory snapshot. Beam VMs are a separate CPU product: a microVM with its own kernel, systemd and a root disk that stays when it stops. Much of Beam is a GPU serverless platform for AI teams.
- Bring your own cloud
- Management fee per vCPU and GB of RAM, on top of your own cloud bill
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. “13th cheapest of 345” means 12 of the other 344 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 | Cloudflare Sandbox: price rank | Beam: price rank | bochka: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month A software factory needs Docker, systemd and a disk that survives between runs; Cloudflare resets the disk on sleep, Beam sandboxes end with their time to live, and bochka keeps it. | 162nd of 367, with limits $1,543 a month | 69th of 367, with limits $551 a month | 3rd cheapest of 367 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB | 207th of 366, with limits $2,188 a month | 115th of 366, with limits $651 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 Both fit short code-interpreter calls well: Beam sandboxes start in a second or two and end on a timer, and Cloudflare bills CPU only while it is busy. | 13th cheapest of 345 $144 a month | 8th cheapest of 345 $117 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 Both fit sandboxes for your users; Cloudflare adds egress rules you write as Worker code, Beam gives each user a quick container, and bochka gives each one a full VM with hosting. | 9th cheapest of 361 $731 a month | 3rd cheapest of 361 $290 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 | 144th of 360, with limits $9,428 a month | 341st of 360, with limits $939 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 | 45th cheapest of 364 $818 a month | 13th cheapest of 364 $251 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 Beam fits CI runners, while Cloudflare's 20 GB disk and Docker with iptables turned off make image builds a squeeze; bochka adds /dev/kvm for Android and VM builds. | 301st of 377, with limits $704 a month | 12th cheapest of 377 $171 a month | 4th cheapest of 377 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB A dev box should keep its files: a Beam VM keeps its 50 GiB root disk while stopped, Cloudflare starts from a fresh disk after sleep, and bochka saves the disk every minute and on stop. | 70th cheapest of 368 $93 a month | 13th cheapest of 368 $21 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 Neither Cloudflare nor Beam ships a desktop or browser for computer use, so you would build one into your image; bochka ships a 60fps desktop with Chromium. | 166th of 369, with limits $460 a month | 111th of 369, with limits $237 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 | 210th of 367, with limits $233 a month | 195th of 367, with limits $176 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 | 250th of 346, with limits $286 a month | 200th of 346, with limits $131 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 | 169th of 338, with limits $5,741 a month | 42nd of 338, with limits $923 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 | 239th of 360, with limits $325 a month | 175th of 360, with limits $155 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 Only Beam has GPUs here, from RTX 4090 up to H100 and B200; Cloudflare Sandbox and bochka are CPU only. | Can't run it | Cheapest of 98 $458 a month | Can't run it |
| macOS agents 5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month | Can't run it | Can't run it | Can't run it |
Key features
| Feature | Cloudflare Sandbox | Beam | bochka |
|---|---|---|---|
| Isolation | Firecracker microVM per container, own kernel and network | gVisor container by default for sandboxes; separate Beam VMs are CPU microVMs with their own kernel | Full VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts |
| Largest machine | 4 vCPU / 12 GiB / 20 GB disk by default (can be raised) | Max sandbox size not published | Up to 16 vCPU / 32 GB, depending on plan |
| Files between sessions | Disk is fresh after sleep; snapshots (public beta, 30 days) or R2 backups when your code saves them | A sandbox ends with its time to live unless you save an image or use a volume; a Beam VM keeps a 50 GiB root disk while stopped | Disk saved every minute and on stop; a stopped sandbox costs nothing and keeps it |
| Snapshots and fork | Filesystem snapshot or backup restored into a new sandbox; no fork | Memory snapshot of a running sandbox with its processes, restored into new sandboxes | Fork a running sandbox with its disk, without stopping it |
| Docker inside | docker:dind with iptables and IP forwarding turned off | Docker inside sandboxes with docker_enabled | Full Docker, root and systemd |
| systemd | Not documented | Only in Beam VMs, not in sandboxes | Yes, like a normal Ubuntu server |
| Nested virtualization | Not documented | Not documented | Yes, /dev/kvm for Android emulators and VMs |
| GPUs | No | GPU sandboxes and serverless GPUs up to H100, H200 and B200 | No, CPU only |
| Desktop and browser | Built-in desktop removed in SDK 0.10.2; bring your own | No desktop or browser product | 60fps desktop with Chromium, computer-use API, embeddable stream |
| Inbound access | HTTP and WebSocket previews routed through your Worker; no raw TCP or public IP | Public HTTPS URL per exposed port with no built-in auth; no raw TCP or dedicated IP | HTTPS URLs for up to 50 ports, token-protected; raw TCP; own IPv4 or IPv6 |
| Outbound rules | allowedHosts deny-by-default list plus outbound handlers you write in Worker code | Block all outbound traffic, or allow up to 10 CIDR ranges, changeable while running | Open internet, no provider-side allowlist |
| Keeping API keys out of the sandbox | Your outbound handler adds the token for any HTTP or HTTPS host; you write the code | Secrets are exposed as environment variables inside the sandbox | Managed proxy for model providers and any HTTPS API; switch a credential to another account when credits run out |
| Coding agents | Run Claude Code, Codex, OpenCode or Pi in your image; OpenCode has an SDK helper | None preinstalled; you install and run them through process exec | Claude Code, Codex, OpenCode and more built in, with a prompt, steer and events API |
| Regions and self-hosting | Several regions across Cloudflare's network; not self-hostable | US only; Beta9 runtime is AGPL-3.0 and free to self-host, or bring your own cloud for a fee | EU only (Germany, Finland, France); not self-hostable |
Every feature Battleships tracks (43)
| Feature | Cloudflare Sandbox | Beam | bochka |
|---|---|---|---|
| Full VM (own kernel) | Yes | No | Yes |
| Docker inside | Yes | Yes | Yes |
| Nested virtualization | No | No | Yes |
| Root | Yes | Yes | Yes |
| Systemd | Not published | No | Yes |
| Desktop GUI | No | No | Yes |
| Browser | No | No | Yes |
| Computer-use API | No | No | Yes |
| SSH | Yes | Yes | Yes |
| Persistent disk | No | Yes | Yes |
| Pause/resume | No | No | Yes |
| Automatic snapshots | No | No | Yes |
| Fork/clone | No | Yes | Yes |
| Live fork (no pause) | No | Yes | Yes |
| Memory fork | No | Yes | No |
| Custom image (Docker or snapshot) | Yes | Yes | Yes |
| ≥24 h sessions | Yes | Yes | Yes |
| Idle auto-stop | Yes | No | No |
| Wake on request | Yes | No | No |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | No | No | Yes |
| Public IPv4 | No | No | No |
| Egress allowlist | Yes | Yes | No |
| Secret proxy | Yes | No | Yes |
| Secret proxy for any API | Yes | No | Yes |
| Preinstalled agents | Yes | No | Yes |
| Agent harness API | Yes | No | Yes |
| MCP server | No | Yes | No |
| GPU | No | Yes | No |
| Windows | No | No | No |
| Arm64 | No | No | No |
| Self-hosting | No | Yes | No |
| BYOC | No | Yes | No |
| Open source | Yes | Yes | No |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | No | Not published | Yes |
| Usage per sandbox (API) | Not published | No | Yes |
| Audit logs | Yes | Not published | No |
| SSO | Yes | No | No |
| SOC 2 | Yes | Yes | No |
| HIPAA | Yes | Yes | No |
| EU data residency | Yes | Not published | Yes |
| Zero data retention | Not published | Not published | Yes |
Performance
There is no comparable CPU measurement for Cloudflare Sandbox or Beam: neither has a result on the StarSling hpc-sandbox-benchmarks Node.js test, so we cannot say which of the two is faster. bochka did 26.69 runs per second on that test at 4 vCPU / 8 GB. Beam's own guide says its sandboxes cold-boot in 1 to 3 seconds.
Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Cloudflare Sandbox and Beam have 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.
| Scenario | Cloudflare Sandbox, a month | Beam, a month | bochka, 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 | $39 · Workers Paid · with limits | $5 · Developer | $20 · $20/mo |
| One agent that never stops 4 vCPU / 8 GB, 50 GB disk, running 24/7 all month | $148 · Workers Paid · with limits | $22 · Developer | $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 | $1,660 · Workers Paid · with limits | $410 · Team | $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 | $476 · Workers Paid | $191 · Team | $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 | $1,889 · Workers Paid · with limits | $259 · Team | $2,000 · $2000/mo · with limits |
Cloudflare Sandbox: You need Workers Paid ($5 a month minimum). CPU is billed only while busy; memory and disk are billed on the instance size you picked until the container sleeps, and 4 vCPU always comes with 12 GiB.
Beam: Beam sandboxes bill per second for each CPU core (two vCPU) and GiB of RAM you request until they end, so an idle tail is billed too. Developer has no fee; Team is $89 a month plus usage, with no usage credit.
Beam: Plans start at $20 a month, and all of it is usage credit, billed per second while a sandbox runs. A stopped sandbox costs nothing and keeps its disk.
Limits in those scenarios
Cloudflare's disk resets after sleep and is 20 GB by default, so the scenarios that keep 50 GB of files between days do not fit without your own snapshot or backup code. A Cloudflare account can run 1,500 vCPU at once by default, short of the 2,000 vCPU the 1,000-job burst needs, though the limit can be raised. Beam's Developer plan allows 30 CPU containers at once, so 50 parallel agents need Team, and Beam publishes no disk price, so its estimates count no disk cost. bochka's $2,000 plan queues the burst's starts, while Beam's Team plan fits it.
| Scenario | Cloudflare Sandbox | Beam | bochka |
|---|---|---|---|
| One coding agent, workdays |
|
| None that bite |
| One agent that never stops |
|
| None that bite |
| 50 agents in parallel |
|
| None that bite |
| Sandboxes for your users | None that bite |
| None that bite |
| 1,000 short jobs at once |
|
|
|
Which one should you use?
Use Cloudflare Sandbox when
your app already runs on Workers and you want short sandboxes that sleep when idle, wake on the next request, and follow egress rules you write in code.
- Sleeps when idle, wakes on request. For many short, spiky sessions, a sandbox sleeps after a quiet spell, wakes on the next request, and bills CPU only while busy.
- Egress rules you can program. For teams that must control traffic, Cloudflare blocks every host not on your list and runs your own code on each outbound request.
- Next to the rest of your Workers app. If your app already runs on Workers, sandboxes sit beside Durable Objects and R2, in several regions of Cloudflare's network.
Use Beam when
your agents need GPUs, when you want memory snapshots of running sandboxes, when you want low-cost CPU in the US, or when you must self-host.
- GPUs in the same platform. For workloads that need a GPU, Beam offers GPU sandboxes and serverless GPUs from RTX 4090 to H100, H200 and B200.
- Memory snapshots of running sandboxes. For agents that should resume mid-task, Beam can snapshot a running sandbox with its processes and restore it into new sandboxes.
- Open source and your own cloud. For teams that must self-host, the Beta9 runtime is AGPL-3.0 and free to run, or Beam can run in your own cloud.
Where bochka fits
Both Cloudflare Sandbox and Beam give you a container to drive from code. If what you are really running is coding agents that work for hours, build with Docker, run emulators or a browser, and need their files the next day, look at bochka: every sandbox is a full VM that keeps its disk.
Files that are still there tomorrow
On Cloudflare the disk starts fresh after sleep, and a Beam sandbox ends with its time to live. Either way an agent loses its repo and installs unless your code saves a snapshot, backup or image first.
A whole machine, not a container
Cloudflare runs Docker with iptables turned off and tops out at 20 GB of disk by default; Beam sandboxes have no systemd. Neither documents /dev/kvm, so Android emulators and nested VMs have nowhere to start.
Agents, desktop and keys built in
On both you bake each agent into your image and build any desktop yourself. On Beam secrets sit as environment variables inside the sandbox; on Cloudflare you write the outbound handler that adds every token.
Use bochka when your agents do real work for hours or days: builds, full Docker, emulators and a desktop, on a full VM whose disk is still there the next time it starts. Compare it one to one: bochka vs Cloudflare Sandbox and bochka vs Beam.
Questions people ask
Is Cloudflare Sandbox cheaper than Beam?
Not in these scenarios. Beam costs less in all five, such as $22 against $148 a month for one agent that never stops, and $191 against $476 a month for sandboxes for your users. Beam's estimates count no disk cost, because Beam publishes no disk price.
Which is faster, Cloudflare Sandbox or Beam?
We have no comparable CPU measurement for either, so we cannot say. Beam's guide says its sandboxes cold-boot in 1 to 3 seconds, and a Cloudflare sandbox wakes on the next request after it sleeps.
Is either one a VM?
Cloudflare runs each container in its own Firecracker microVM with its own kernel. A Beam sandbox is a gVisor container by default, though Beam also sells separate CPU VMs with their own kernel and systemd. Every bochka sandbox is a full VM with /dev/kvm.
Can Cloudflare Sandbox or Beam run Docker?
Yes. Cloudflare supports docker:dind with iptables and IP forwarding turned off, and Beam supports Docker inside a sandbox with docker_enabled. bochka runs full Docker with systemd in a full VM.
Do they keep my files?
A Cloudflare sandbox starts from a fresh disk after sleep unless your code saved a snapshot or R2 backup. A Beam sandbox ends with its time to live, 10 minutes by default, unless you save an image or use a volume, while a Beam VM keeps its root disk while stopped.
Which one has GPUs?
Only Beam. It offers GPU sandboxes and serverless GPUs from RTX 4090 up to H100, H200 and B200. Cloudflare Sandbox and bochka are CPU only.
Try bochka
Install the CLI, then run bochka new.
Product preview
More comparisons
- bochka vs Cloudflare Sandbox
- bochka vs Beam
- E2B vs Cloudflare Sandbox
- Daytona vs Cloudflare Sandbox
- Modal vs Cloudflare Sandbox
- Vercel Sandbox vs Cloudflare Sandbox
- Cloudflare Sandbox vs Blaxel
- Cloudflare Sandbox vs Runloop
- Cloudflare Sandbox vs Tensorlake
- Cloudflare Sandbox vs Morph Cloud
- Cloudflare Sandbox vs CodeSandbox SDK
- Cloudflare Sandbox vs Northflank