Cloudflare Sandbox vs Modal VM Sandboxes

Both give each sandbox its own kernel. Cloudflare runs a container inside your Workers app. It sleeps when idle, wakes on the next request, and keeps files through snapshots or R2 that your code sets up. Modal runs a full Linux VM with Docker and systemd for up to 24 hours, and carries work forward through filesystem snapshots or Volumes.

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. 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.

Modal VM Sandboxes

Modal is a serverless cloud for AI work, and VM Sandboxes are the version of its sandboxes that run in a virtual machine with their own Linux kernel.

You create a VM Sandbox from Python, TypeScript or Go code with runtime="vm", run commands in it, and terminate it when the job is done. Modal built the runtime on the Rust-based Cloud Hypervisor, so Docker, FUSE, systemd and nested cgroups work, with the same API, images and prices as its gVisor sandboxes. It became generally available on 1 October 2026. It suits teams that want many agent machines next to Modal's inference and training.

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. “43rd cheapest of 361” means 42 of the other 360 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 workloadCloudflare Sandbox: price rankModal VM Sandboxes: price rankboat: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
Modal's VM fits a software factory: Docker in a real VM, with files carried between sessions by filesystem snapshots. In this scenario Modal VM costs $633 a month and boat $634. Cloudflare costs $1,543 and has 20 GB of disk. boat saves the disk with no code and adds a built-in desktop.
192nd of 365, with limits
$1,543 a month
27th cheapest of 365
$633 a month
5th cheapest of 365
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
43rd cheapest of 361
$2,188 a month
Not ranked: misses a requirement6th cheapest of 361
$657 a month
Code interpreter bursts
100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month
Short code-interpreter calls suit both. Cloudflare bills CPU only while busy and wakes on the next request. Modal bills per second on the larger of request and use.
17th cheapest of 336
$144 a month
Not ranked: misses a requirement189th 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 suits apps already on Workers. On Modal you snapshot each user's filesystem and boot from it when the user comes back. boat keeps each user's disk with no code; each start counts against the plan's start cap.
19th cheapest of 349
$731 a month
Not ranked: misses a requirement3rd 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
Huge bursts of short rollouts suit Modal: Team runs 5,000 containers at once, with no per-start fee. Cloudflare allows 1,500 vCPU per account by default, and raises it on request. boat caps starts per plan.
147th of 349, with limits
$9,428 a month
163rd of 349, with limits
$11,982 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
60th cheapest of 359
$818 a month
Not ranked: misses a requirement10th cheapest of 359
$200 a month
CI runners
40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month
Both Modal and boat run Docker builds in a real VM. Cloudflare has 20 GB of disk and turns iptables off. boat adds /dev/kvm on every plan; Modal offers nested virtualization on Enterprise only, as an experimental option.
303rd of 374, with limits
$704 a month
170th of 374, with limits
$655 a month
2nd cheapest of 374
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
A dev box should keep its files when you log off. On Cloudflare your code saves snapshots or mounts R2. Modal stops within 24 hours, and a filesystem snapshot carries the files to a new sandbox. boat keeps a stopped disk at least 14 days with no code.
123rd cheapest of 371
$93 a month
Not ranked: misses a requirement19th cheapest of 371
$26 a month
Computer-use agents
50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month
Neither ships a built-in desktop. On Cloudflare you build one into your image. Modal's runnable example installs Xvfb, x11vnc, noVNC, Chromium and a Browser Use agent. boat ships a 60 fps desktop with computer tools.
207th of 367, with limits
$460 a month
Not ranked: misses a requirement7th cheapest of 367
$200 a month
Browser-use agents
50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month
68th of 356, with limits
$233 a month
Not ranked: misses a requirement7th 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
102nd cheapest of 343
$286 a month
Not ranked: misses a requirement6th 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
168th of 327, with limits
$5,741 a month
Not ranked: misses a requirement73rd 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
In the red-teaming scenario boat costs $200 a month, Cloudflare $325 and Modal VM $464. Modal gives raw TCP tunnels and outbound allowlists. Cloudflare blocks iptables changes and raw TCP inbound. boat has root networking, raw ports over IPv6 and /dev/kvm.
25th cheapest of 351
$325 a month
27th cheapest of 351
$464 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 requirementNot ranked: misses a requirementNot 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 requirementNot ranked: misses a requirementNot ranked: misses a requirement

Key features

FeatureCloudflare SandboxModal VM Sandboxesboat
IsolationFirecracker microVM per container, own kernel and networkVM with its own Linux kernel on Cloud HypervisorFull VM with its own kernel, on a physical host dedicated to boat (AMD Ryzen 7 9700X or Ryzen 9 9950X); vCPUs are shared
CPU benchmark (V8 Web Tooling, 4 vCPU / 8 GB, StarSling run of 3 October 2026)Not in this runVM runtime 15.48 runs/s, gVisor 12.60, both rank 7 of 15 (shared); measured with cpu=428.06 runs/s, rank 2 of 15 (shared), on a Ryzen 9 9950X host
Longest sessionNo fixed maximum; stops after an inactivity timeout and wakes on the next request; runtime not guaranteed24 hours (default 5 minutes); continue in a new sandbox from a filesystem snapshotAuto-stop 1 h by default; up to 30 days, or off on a paid plan with no session cap
Files between sessionsDisk is fresh after sleep; keep files with snapshots (public beta, 30 days), scheduled automatic saves, R2 backups or a mounted R2 bucketYour code calls snapshot_filesystem() and boots a new sandbox from it (kept 30 days by default, or with no expiry), or keeps files in a VolumeDisk saved every minute and at each stop, with no code; kept at least 14 days after a stop, longer as a saved snapshot
ForkSnapshot or back up a running sandbox, then start new sandboxes from it; no one-call forkSnapshot a running sandbox's filesystem into an image and boot any number of new sandboxes; memory snapshots in alphaFork a running sandbox in one call; the fork uses the last 1-minute snapshot
Disk20 GBFixed 512 GiB root filesystem51 GB on 2 and 4 vCPU sizes, up to 251 GB on xlarge
Docker insidedocker:dind with iptables and IP forwarding turned offDocker, systemd and root; you start dockerd yourselfDocker with BuildKit and Compose, root and systemd
Nested virtualizationNot documentedEnterprise plan only, as an experimental optionYes, /dev/kvm on every sandbox
Desktop and browserBuilt-in desktop removed in SDK 0.10.2; build one into your own image, or use the separate Browser Run service for headless browsersNot built in; Modal's runnable example installs Xvfb, x11vnc, noVNC, Chromium and a Browser Use agent1920x1080, 60 fps desktop and Chrome, computer tools built in; no GPU
Coding agents and API keysGuides for Claude Code, Codex, OpenCode and Pi in your image; your outbound handler adds tokens for any HTTP or HTTPS hostYou install the harness; official examples for the Claude Agent SDK and OpenCode; a credential-injecting proxy in a Sidecar (experimental) from an official exampleSeven installed, with a prompt, steer and events API; optional paid key proxy ($1 a day while on, plus $1 per 1,000 requests)
Inbound trafficHTTP and WebSocket previews through your Worker; SSH; no raw TCP inbound or public IPEncrypted and raw TCP tunnels, connect tokens, inbound IP allowlistUp to 50 HTTPS URLs, token-gated by default; raw ports over public IPv6
Outbound network rulesallowedHosts deny-by-default list plus outbound handlers you write in Worker codeBlock all, IP-range allowlist, domain allowlist (beta)No provider-side allowlist
Sleep when idleStops after inactivity and wakes on the next requestNo paused state; the sandbox ends at its timeout or when you terminate itAuto-stop on a timer (1 h by default), not on idle; stop and resume with the disk
Running at once1,500 vCPU per account by default; higher on request; no per-start fee100 containers on Starter, 5,000 on Team; no per-start feeStarts included per plan: $20 plan 12 a minute and 200 a day; $2,000 plan 90 a minute and 600 an hour; extra starts $0.03 to $0.07
RegionsSeveral regions across Cloudflare's network; pin to a region or jurisdictionUS, EU and Asia-Pacific; pinning a region costs 1.15x to 1.75xGermany, Finland and France; no US or Asia region; you cannot pick one
Every feature Battleships tracks (43)
FeatureCloudflare SandboxModal VM Sandboxesboat
Full VM (own kernel)YesYesYes
Docker insideYesYesYes
Nested virtualizationNo documented wayYesYes
RootYesYesYes
SystemdNot publishedYesYes
Desktop GUINo documented wayWith your own setupYes
BrowserWith your own setupWith your own setupYes
Computer-use APINo documented wayWith your own setupYes
SSHYesWith your own setupYes
Persistent diskWith your own setupWith your own setupYes
Pause/resumeNo documented wayNo documented wayYes
Automatic snapshotsWith your own setupNo documented wayYes
Fork/cloneWith your own setupYesYes
Live fork (no pause)With your own setupNot publishedYes
Memory forkNo documented wayYesNo documented way
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo documented way
Wake on requestYesNo documented wayNo documented way
HTTPS preview URLsYesYesYes
Raw TCP inboundNo documented wayYesYes
Public IPv4No documented wayNo documented wayNo documented way
Egress allowlistYesYesNo documented way
Secret proxyYesWith your own setupYes
Secret proxy for any APIYesNo documented wayYes
Preinstalled agentsYesWith your own setupYes
Agent harness APIWith your own setupNo documented wayYes
MCP serverNo documented wayNo documented wayNo documented way
GPUNo documented wayNo documented wayNo documented way
WindowsNo documented wayNo documented wayNo documented way
Arm64No documented wayNo documented wayNo documented way
Self-hostingNo documented wayNo documented wayNo documented way
BYOCNo documented wayNo documented wayNo documented way
Open sourceYesNo documented wayNo documented way
Scoped API keysNot publishedNot publishedYes
Spend limitsNo documented wayNot publishedYes
Usage per sandbox (API)Not publishedNot publishedYes
Audit logsYesYesNo documented way
SSOYesYesNo documented way
SOC 2YesYesNo documented way
HIPAAYesYesNo documented way
EU data residencyYesYesNo documented way
Zero data retentionNot publishedNot publishedYes

Performance

Cloudflare SandboxNot measured
Modal VM Sandboxes15.48 runs/s
boat28.06 runs/s

StarSling ran the V8 Web Tooling Benchmark at 4 vCPU / 8 GB on 3 October 2026 (run 37073680030). boat did 28.06 runs/s, second of 15. Modal's VM runtime did 15.48 and its gVisor runtime 12.60, both rank 7 (shared). That is about 1.8 times the CPU work of Modal's VM runtime in the same time. StarSling ran Modal with cpu=4, and the sandbox saw 4 CPUs (PR #121); sized that way, Modal bills 4 cores, $0.76/h, not the 2-core $0.476/h list price used on this page. Every boat sandbox in the run ran on an AMD Ryzen 9 9950X host; boat also places some sandboxes on other hosts. Providers ran on different hardware in different regions. Cloudflare is not in that run, so we cannot compare its CPU.

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. Modal VM Sandboxes measured on: VM Sandbox, request = size. 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.

ScenarioCloudflare Sandbox, a monthModal VM Sandboxes, 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
$39 · Workers Paid$0 · Starter$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$148 · Workers Paid$109 · Starter · 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
$1,660 · Workers Paid$1,480 · Starter$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$579 · 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$1,911 · Team · with limits$8,800 · $2000/mo · with limits

Cloudflare Sandbox: You need Workers Paid ($5 a month minimum). CPU is billed only while busy, at $0.072 per vCPU-hour. Memory and disk are billed on the instance size in 10 ms steps until the container sleeps. 4 vCPU always comes with 12 GiB. Snapshot pricing is not published.

Modal VM Sandboxes: Modal bills per second for the larger of what you request or use, until the sandbox ends. It prices CPU per physical core, and one core equals two vCPUs: a 4 vCPU / 8 GiB sandbox is 2 cores + 8 GiB, $0.476 an hour ($0.070956 per vCPU-hour). Starter is $0 with $30 of monthly credit, Team is $250 a month with $100 of credit, and pinning a region costs 1.15x to 1.75x. The scenario bills use a minimal CPU request that bursts above it, which is not guaranteed.

Modal VM Sandboxes: Plans cost $20, $100, $500 or $2,000 a month, and the whole plan price comes back as VM time for that month. A default 4 vCPU / 8 GB sandbox costs $0.036 an hour, billed per second while it runs, busy or idle. The $20 plan includes 12 starts a minute, 60 an hour and 200 a day; extra starts cost $0.03 to $0.07. A stopped sandbox has no compute charge and keeps its disk at least 14 days. Saved snapshots above the included count ($0.056 a day each) and the AI proxy, if on, still bill while stopped.

Limits in those scenarios

A Modal VM Sandbox runs 24 hours at most, so the always-on scenario needs a snapshot and a new sandbox each day, and Modal is marked as not fitting it as is. Cloudflare keeps files between days only through snapshots, automatic saves or R2 that your code sets up. For 1,000 jobs at once, Cloudflare's 1,500 vCPU account cap is short of the 2,000 needed (raised on request), and Modal's Team price relies on shared burst CPU that is not guaranteed. boat does not fit that burst either: the $2,000 plan includes 90 starts a minute and 600 an hour, charges $0.03 to $0.07 for extra starts, and refuses starts above 270 a minute.

ScenarioCloudflare SandboxModal VM Sandboxesboat
One coding agent, workdaysNone for this scenarioNone for this scenarioNone for this scenario
One agent that never stopsNone for this scenario
  • Starter: sessions capped at 24 h
None for this scenario
50 agents in parallelNone for this scenarioNone for this scenarioNone for this scenario
Sandboxes for your usersNone for this scenarioNone for this scenarioNone for this scenario
1,000 short jobs at once
  • Workers Paid: max 1,500 vCPU running at once (needs 2,000)
  • shared vCPUs on this tier (Modal (VM Sandboxes) sells dedicated cores separately as “VM Sandbox, request = size”): heavy, sustained CPU use can be slowed by other tenants
  • 2,400 starts/day included, paid above that (needs ~6,667)
  • 600 starts/hour included, paid above that (needs ~1,000)
  • starts above 90/min are paid, and starts above 270/min fail with 429

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 as code.

  • Sleeps when idle, wakes on request. Useful for many short, spiky sessions: a sandbox sleeps when quiet, wakes on the next request, and bills CPU only while busy.
  • 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.
  • Built into the Workers platform. If your app already runs on Workers, sandboxes sit next to Durable Objects and R2 with little to wire up.

Use Modal VM Sandboxes when

you need a real VM with Docker and systemd for jobs that finish within a day, run huge bursts, branch from filesystem snapshots, or already run your models on Modal.

  • A real VM with Docker and systemd. Modal's VM runs its own Linux kernel with a 512 GiB disk, so Docker, FUSE and systemd work as on a normal Linux machine.
  • Very large bursts and snapshot branching. Useful for huge bursts of short jobs: Team runs 5,000 containers at once, and one filesystem snapshot boots any number of sandboxes.
  • One platform with inference and training. If you already serve or train models on Modal, sandboxes, GPUs and models share one account and one bill, with a compliance report on every plan.

Where boat fits

Cloudflare and Modal both suit sandboxes that end and get thrown away, and both carry files forward through snapshots that your code takes. If your agents work for hours or days and come back to the same machine, boat saves the disk with no code, runs a desktop and comes with coding agents ready to drive. boat runs only in the EU, has no GPU, and caps starts per plan.

Files that stay put with no code

On Cloudflare your code saves snapshots, automatic saves or R2. A Modal VM ends within 24 hours, and your code snapshots its filesystem or uses a Volume. boat saves the disk every minute and at each stop. Memory is not saved, so a resume is like a reboot.

A full machine for builds and UI checks

Cloudflare runs Docker with iptables off on 20 GB of disk, and Modal offers nested virtualization only on Enterprise, as an experimental option. Neither ships a desktop: on Modal you follow its Xvfb and noVNC example. boat has Docker, /dev/kvm and a 60 fps desktop on every plan.

Agents driven from outside

On Cloudflare you bake each agent into your image and write the outbound handler that adds tokens. On Modal you install the harness and run a sidecar proxy from its example. boat ships seven agents with a prompt, steer and events API.

Use boat when your agents work for hours or days on a machine they come back to: Docker, /dev/kvm, a desktop and coding agents, on a VM that saves its disk with no code. Compare it one to one: boat vs Cloudflare Sandbox and boat vs Modal VM Sandboxes.

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 Cloudflare Sandbox cheaper than Modal VM Sandboxes?

It depends on the scenario. Cloudflare is lower for 300 user sandboxes ($476 against $579) and 1,000 short jobs ($1,889 against $1,911). Modal is lower for one workday agent ($0 inside Starter's credit, against $39) and 50 parallel agents ($1,480 against $1,660). One always-on agent is $148 on Cloudflare and $109 on Modal, which needs a new sandbox each day. boat costs $200, $8,800, $20, $317 and $26 for those five.

Which is faster?

In StarSling's run of 3 October 2026 at 4 vCPU / 8 GB, Modal's VM runtime did 15.48 V8 Web Tooling runs/s and its gVisor runtime 12.60. Cloudflare is not in that run. boat did 28.06 on an AMD Ryzen 9 9950X host; boat also places some sandboxes on other hosts. StarSling ran Modal with cpu=4, which Modal bills as 4 cores.

Can Cloudflare Sandbox run Docker?

Yes, as docker:dind with the daemon's iptables and IP forwarding turned off, because containers cannot change iptables. Modal's VM runs Docker with systemd and root once you start dockerd. boat runs Docker with BuildKit and Compose in every sandbox.

How long can each sandbox run?

A Modal VM Sandbox defaults to 5 minutes and stops at 24 hours at most; a filesystem snapshot carries the work to a new one. Cloudflare has no fixed maximum, but it stops an idle container and does not guarantee any runtime. boat stops after 1 hour by default; on a paid plan you turn auto-stop off for no session cap.

Do they keep my files?

Yes, through snapshots your code takes. Cloudflare keeps files with a snapshot (public beta, 30 days), scheduled automatic saves, an R2 backup or a mounted R2 bucket. Modal keeps files in a filesystem snapshot (30 days by default, or no expiry) or a Volume. boat saves the disk every minute and at each stop with no code, and keeps it at least 14 days after a stop.

Which handles big bursts of short jobs better?

Modal, with 5,000 containers at once on Team and no per-start fee. Cloudflare's account cap is 1,500 vCPU at once by default, raised on request. boat's $2,000 plan includes 90 starts a minute, charges $0.03 to $0.07 for extra starts, and refuses starts above 270 a minute.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons