Cloudflare Sandbox vs Fly.io Machines

Both run your code in Firecracker microVMs with their own kernel. Cloudflare Sandbox is a sandbox SDK inside Workers. Its containers sleep and wake on request, and keep files through snapshots or R2 that your code sets up. Fly.io Machines are the VMs under an app hosting platform, with a Volume for lasting files and 17 regions to run in.

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.

Fly.io Machines

Fly.io is an app hosting platform, and Machines are the microVMs underneath it that you can also start and stop through a REST API.

A Fly Machine boots your Docker image as a Firecracker microVM on Fly's own servers, in one of 17 regions. You pick a shared or performance CPU preset and mount one Volume at a time for data that must last. Fly Proxy can stop, suspend and wake Machines as traffic comes and goes. Machines themselves are an app-hosting building block; for agent sandboxes Fly also sells Sprites (see boat vs Sprites), so this page compares only the Machines product.

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 rankFly.io Machines: price rankboat: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
Long agent sessions need their files. On Cloudflare your code keeps them with snapshots, automatic saves or R2. On Fly, files last on one Volume, or on the root file system with opt-in persist_rootfs. boat saves the whole disk with no code, with Docker and a desktop.
192nd of 365, with limits
$1,543 a month
123rd of 365, with limits
$836 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
186th of 361, with limits
$816 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 suit short code-interpreter calls. Cloudflare bills CPU only while busy and wakes on the next request. Fly bills per second with no plan fee, on cheap shared CPU for code that mostly waits.
17th cheapest of 336
$144 a month
83rd of 336, with limits
$94 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
Cloudflare fits sandboxes for your users, with egress rules in Worker code. Fly's Machines API takes about one create request per second per app, so big sign-up waves need pre-created Machines. boat fits too, with per-sandbox usage and spend limits.
19th cheapest of 349
$731 a month
75th of 349, with limits
$600 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
147th of 349, with limits
$9,428 a month
52nd of 349, with limits
$2,838 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
Cloudflare fits agent evals as short sessions that sleep between runs. On Fly the shared CPU baseline makes it a compromise. boat fits with a full VM per run.
60th cheapest of 359
$818 a month
124th of 359, with limits
$457 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
CI jobs keep the CPU busy, which drains a shared Fly vCPU's burst balance; Fly's performance CPUs avoid that at a higher rate. Cloudflare has 20 GB of disk and runs Docker with iptables off. boat has Docker with BuildKit on every machine.
303rd of 374, with limits
$704 a month
154th of 374, with limits
$288 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. Cloudflare starts from a fresh disk after sleep unless your code snapshots it or works in a mounted R2 bucket. Fly keeps a Volume, and the root file system with persist_rootfs. boat stops with no compute charge and keeps its disk at least 14 days.
123rd cheapest of 371
$93 a month
160th of 371, with limits
$35 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
Neither Cloudflare nor Fly ships a desktop, so you build one into your own image. boat ships a 60 fps desktop with Chrome and computer tools.
207th of 367, with limits
$460 a month
140th of 367, with limits
$173 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
68th of 356, with limits
$233 a month
229th of 356, with limits
$90 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
102nd cheapest of 343
$286 a month
233rd of 343, with limits
$67 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
Fly's bill is lower here ($1,232 a month, against $5,741 on Cloudflare and $1,800 on boat), and it can spread scrapers across 17 regions. None of the three is a full match.
168th of 327, with limits
$5,741 a month
47th of 327, with limits
$1,232 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
25th cheapest of 351
$325 a month
168th of 351, with limits
$63 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 SandboxFly.io Machinesboat
Kind of productSandbox SDK: containers you start and drive from a Cloudflare WorkerApp hosting platform; Machines are its microVMs, with a REST API. Fly sells Sprites separately for agent sandboxesAgent sandbox: a full VM per agent, ready to use
IsolationFirecracker microVM per container, own kernel and networkFirecracker microVM with its own kernel, on Fly's own serversFull VM with its own kernel, on a physical host dedicated to boat (AMD Ryzen 7 9700X or Ryzen 9 9950X); vCPUs are shared
Files after a stopDisk is fresh after sleep; keep files with snapshots (public beta, 30 days), scheduled automatic saves, R2 backups or a mounted R2 bucketRoot file system resets by default; opt-in persist_rootfs keeps it, but Fly says not to trust it with critical data. One Volume per Machine keeps data, with daily snapshots, billed for its full sizeDisk saved every minute and at each stop, with no code; kept at least 14 days after a stop, longer as a saved snapshot; memory is not saved
Sleep, wake and memoryStops after inactivity and wakes on the next request; processes and memory are not keptFly Proxy stops or suspends idle Machines and wakes them on request; suspend keeps memory for Machines up to 2GBYou start and stop machines through the API; auto-stop runs on a timer (1 h by default), not on idle; resume reboots from disk
ForkSnapshot or back up a running sandbox, then start new sandboxes from it; no one-call forkClone copies a Machine's config; restore a volume snapshot or fork the Volume to copy data; the root file system is not copiedFork a running sandbox in one call, disk included; the fork uses the last 1-minute snapshot
Docker and systemddocker:dind with iptables and IP forwarding turned offRoot and Docker you install yourself; Fly's own init by default, systemd as PID 1 not documentedDocker with BuildKit and Compose, root and systemd on every machine
Nested virtualizationNot documentedNot documentedYes, /dev/kvm (Android emulators, VMs)
Largest machine and CPU4 vCPU / 12 GiB / 20 GB disk; CPU billed only while busyShared vCPUs guarantee 6.25% of a core plus bursts; performance vCPUs get the full core at a higher rate16 vCPU / 32 GB / 251 GB disk (needs the $100 plan or higher); shared vCPUs with no baseline quota or burst balance
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; add a desktop, a browser and a VNC stream to your own image1920x1080, 60 fps desktop and Chrome, computer tools and browser control, embeddable stream; no GPU
Coding agentsGuides for Claude Code, Codex, OpenCode and Pi in your image, plus integrationsNot built in on Machines; you install agents in your image. Fly's Sprites product ships coding agentsSeven installed, including Claude Code, Codex and OpenCode, with a prompt, steer and events API
Keeping keys out of the sandboxYour outbound handler adds the token for any HTTP or HTTPS host; you write the codeSecrets arrive as environment variables; deploy Fly's open-source tokenizer proxy yourself to inject keysOptional paid proxy ($1 a day while on, plus $1 per 1,000 requests) for model providers and HTTPS APIs; other secrets still enter the sandbox
Reaching the sandboxHTTP and WebSocket previews routed through your Worker; SSH; no raw TCP inbound or public IPPublic HTTPS and TCP through Fly Proxy, Anycast IPs, custom domains, private network between Machines; static egress IP for $3.60 a monthUp to 50 HTTPS URLs, token-gated by default; SSH; raw ports over public IPv6; no dedicated IPv4
Outbound rulesallowedHosts deny-by-default list plus outbound handlers that run your code on each HTTP requestNetwork policies allow chosen ports and protocols and deny the restNo provider-side allowlist
RegionsSeveral regions across Cloudflare's network; pin to a region or jurisdiction17 regions on six continentsGermany, Finland and France; no US or Asia region; you cannot pick one
Every feature Battleships tracks (43)
FeatureCloudflare SandboxFly.io Machinesboat
Full VM (own kernel)YesYesYes
Docker insideYesYesYes
Nested virtualizationNo documented wayNot publishedYes
RootYesYesYes
SystemdNot publishedNot publishedYes
Desktop GUINo documented wayNo documented wayYes
BrowserWith your own setupNo documented wayYes
Computer-use APINo documented wayNo documented wayYes
SSHYesYesYes
Persistent diskWith your own setupYesYes
Pause/resumeNo documented wayYesYes
Automatic snapshotsWith your own setupYesYes
Fork/cloneWith your own setupYesYes
Live fork (no pause)With your own setupYesYes
Memory forkNo documented wayNo documented wayNo documented way
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo documented way
Wake on requestYesYesNo documented way
HTTPS preview URLsYesYesYes
Raw TCP inboundNo documented wayYesYes
Public IPv4No documented wayYesNo documented way
Egress allowlistYesYesNo documented way
Secret proxyYesNo documented wayYes
Secret proxy for any APIYesNo documented wayYes
Preinstalled agentsYesNo documented wayYes
Agent harness APIWith your own setupNo documented wayYes
MCP serverNo documented wayYesNo 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 sourceYesYesNo documented way
Scoped API keysNot publishedNot publishedYes
Spend limitsNo documented wayNo documented wayYes
Usage per sandbox (API)Not publishedNo documented wayYes
Audit logsYesNot publishedNo documented way
SSOYesNo documented wayNo documented way
SOC 2YesYesNo documented way
HIPAAYesYesNo documented way
EU data residencyYesYesNo documented way
Zero data retentionNot publishedNot publishedYes

Performance

Cloudflare SandboxNot measured
Fly.io MachinesNot measured
boat28.06 runs/s

Neither Cloudflare Sandbox nor Fly.io Machines is in StarSling's run of 3 October 2026 (run 37073680030), so we cannot say which has faster CPU. In that run boat did 28.06 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB, second of 15, on an AMD Ryzen 9 9950X host. boat also places some sandboxes on other hosts. On Fly the result would also depend on the CPU class: shared vCPUs guarantee 6.25% of a core, performance vCPUs get the full core. ComputeSDK measured a 671 ms median start for Cloudflare with 100 at once (2026-11-06, default size).

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 and Fly.io Machines are 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 monthFly.io Machines, 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$15 · Pay As You Go · with limits$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$148 · Workers Paid$36 · Pay As You Go · 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$487 · Pay As You Go · 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
$476 · Workers Paid$110 · Pay As You Go · with limits$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$232 · Pay As You Go · 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.

Fly.io Machines: Fly bills each Machine per second while it runs, with no plan fee. Stopped Machines pay for their root file system, and Volumes are billed for their full size all month at $0.15 per GB. The figures here use shared vCPUs bought in 1-year reservation blocks for 40% off, the lowest rate Fly sells. A performance-4x Machine with 8GB is $0.1833 an hour on demand.

Fly.io Machines: 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

Cloudflare fits four of the five scenarios, with files kept through snapshots, automatic saves or R2 that your code sets up. The 1,000-job burst needs 2,000 vCPU at once against a default account cap of 1,500, though Cloudflare raises it on request. Fly is a compromise in all five: its lowest figures need a 1-year reservation, and its shared vCPUs guarantee 6.25% of each core, so long builds get throttled. Fly's API also creates about one Machine per second per app, so big bursts need pre-created Machines. boat does not fit the burst either: the $2,000 plan includes 90 starts a minute and 2,400 a day, charges $0.03 to $0.07 for extra starts, and refuses starts above 270 a minute.

ScenarioCloudflare SandboxFly.io Machinesboat
One coding agent, workdaysNone for this scenario
  • different kind of product: app platform
  • files survive a stop only in one Fly Volume (root file system too with opt-in persist_rootfs): packages installed elsewhere reset
  • 1-year commitment
  • burstable CPU: 6.25% of each vCPU guaranteed, throttled above that
None for this scenario
One agent that never stopsNone for this scenario
  • different kind of product: app platform
  • files survive a stop only in one Fly Volume (root file system too with opt-in persist_rootfs): packages installed elsewhere reset
  • 1-year commitment
  • burstable CPU: 6.25% of each vCPU guaranteed, throttled above that
None for this scenario
50 agents in parallelNone for this scenario
  • different kind of product: app platform
  • files survive a stop only in one Fly Volume (root file system too with opt-in persist_rootfs): packages installed elsewhere reset
  • 1-year commitment
  • burstable CPU: 6.25% of each vCPU guaranteed, throttled above that
None for this scenario
Sandboxes for your usersNone for this scenario
  • different kind of product: app platform
  • 1-year commitment
  • burstable CPU: 6.25% of each vCPU guaranteed, throttled above that
None for this scenario
1,000 short jobs at once
  • Workers Paid: max 1,500 vCPU running at once (needs 2,000)
  • different kind of product: app platform
  • 1-year commitment
  • burstable CPU: 6.25% of each vCPU guaranteed, throttled above that
  • 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 request and only reach hosts you allow.

  • Egress rules you can program. Useful when sandboxed code must only reach known hosts: allowedHosts blocks the rest, and outbound handlers run your code on each request.
  • Short, spiky sessions. Useful for code-interpreter calls: a sandbox sleeps when idle, wakes on the next request, and bills CPU only while busy.
  • Part of the Workers platform. If your app already runs on Workers, sandboxes sit next to Durable Objects and R2, with less to wire up.

Use Fly.io Machines when

you host apps or long-lived services that need a lasting Volume, public TCP and regions outside Europe.

  • 17 regions worldwide. Useful when work must run near users on other continents: Fly runs Machines in 17 regions, from the US to Sydney.
  • Files that last, and memory suspend. Useful for longer-lived services: a Volume keeps data across restarts, and small Machines can suspend with their memory kept.
  • A full app platform around each Machine. Useful if you host whole apps: Fly adds public TCP, Anycast IPs, custom domains, private networking and port-level network policies.

Where boat fits

If you run coding agents that work for hours, both options leave you building the sandbox yourself: Cloudflare around short sessions that sleep, Fly around an app host. boat gives each agent a full VM that saves its disk with no code, with Docker, /dev/kvm, a desktop and coding agents in place. boat runs only in the EU, and plans include a set number of starts.

A disk saved with no code

On Cloudflare your code saves snapshots, automatic saves or R2 to keep files across sleep. On Fly a Volume lasts, billed for its full size even while stopped, and persist_rootfs keeps the root file system without a durability promise. boat saves the whole disk every minute and at each stop. Memory is not saved.

A whole machine for agent work

Cloudflare runs Docker with iptables turned off on 20 GB of disk. Fly does not document systemd or /dev/kvm, and its shared vCPUs throttle long builds unless you pay for performance vCPUs. boat has Docker, systemd, /dev/kvm and a 60 fps desktop on every machine.

Agents ready to drive

On both you bake agents into your image and write the code that drives them. Cloudflare needs an outbound handler you write to add tokens, and Fly passes secrets as environment variables unless you run its tokenizer. boat ships seven agents with a prompt API, and an optional paid key proxy.

Use boat when your agents do real work for hours: builds, tests, Docker and emulators on a full VM that saves its disk with no code, with a desktop and coding agents built in. Compare it one to one: boat vs Cloudflare Sandbox and boat vs Fly.io Machines.

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 Fly.io Machines?

In our five scenarios Fly's estimate is lower each time, for example $110 on Fly against $476 on Cloudflare for 300 user sandboxes. Fly's figures use shared vCPUs on a 1-year reservation, which assume work that stays near a 6.25% CPU baseline. boat is $200 for the same user sandboxes, $26 for one agent running all month ($36 on Fly, $148 on Cloudflare), and $8,800 for 1,000 short jobs at once, because it bills extra starts.

Which is faster, Cloudflare Sandbox or Fly.io Machines?

Neither is in StarSling's run of 3 October 2026, so we cannot say. In that run boat did 28.06 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB, on an AMD Ryzen 9 9950X host. Fly's shared vCPUs guarantee 6.25% of a core with bursts, so sustained work on Fly needs performance vCPUs.

Can I run Docker in Cloudflare Sandbox or Fly.io Machines?

Yes, with limits. Cloudflare supports docker:dind with iptables and IP forwarding turned off. On Fly you install Docker yourself inside the microVM, which uses Fly's own init; Fly does not document /dev/kvm. boat has Docker, systemd and /dev/kvm ready on every machine.

Do they keep my files when a sandbox stops?

Cloudflare starts from a fresh disk after sleep, unless your code saves a snapshot (public beta, kept 30 days), schedules automatic saves or works in a mounted R2 bucket. Fly keeps what is on the Machine's Volume, and the root file system with opt-in persist_rootfs, which Fly says not to trust with critical data. boat saves the whole disk every minute and at each stop, and keeps it at least 14 days.

Which runs in more places?

Fly runs Machines in 17 regions on six continents. Cloudflare places containers in several regions of its network and lets you pin one. boat runs on machines in Germany, Finland and France, and you cannot pick a region.

Can I use either one as an AI agent sandbox?

Yes, but you build the sandbox yourself on both: package the tools, browser and agents into an image, set up the file saving, and write the code that drives each agent. Fly also sells Sprites for agent sandboxes. boat ships a desktop and coding agents with a prompt and steer API in every machine.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons