Cloudflare Sandbox vs smol machines
Both run each sandbox in its own microVM with its own kernel. Cloudflare Sandbox is a container inside the Workers platform that sleeps when idle and starts from a fresh disk, while smol machines is an open-source VM engine whose machines keep their files and can branch while running.
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
smol machines
smol machines makes fast, isolated Linux microVMs that run the same way on your laptop, in their hosted cloud, or on your own servers.
The core is smolvm, an open-source microVM engine built on libkrun, where each machine has its own guest kernel. smol cloud is the paid hosted service that runs fleets of those machines behind a REST API and Node, Python and Rust SDKs. It is built for developers who want one VM model from local development to production, with live branching of running machines.
- Uptime SLA
- 99.95% on Pro, Startup and Enterprise
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 | smol machines: price rank | bochka: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month smol machines keeps the disk across stops and fits a long build session better than Cloudflare, whose disk resets on sleep; bochka adds /dev/kvm, SSH and coding agents you drive from outside. | 162nd of 367, with limits $1,543 a month | 73rd of 367, with limits $604 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 | 148th of 366, with limits $1,038 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 runs well: Cloudflare bills CPU only while busy and wakes on the next request, and smol machines has a one-minute minimum and a /code endpoint. | 13th cheapest of 345 $144 a month | 12th cheapest of 345 $140 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, at $731 a month on Cloudflare and $531 a month on smol machines; bochka fits too at $209 a month and adds a desktop per user. | 9th cheapest of 361 $731 a month | 7th cheapest of 361 $531 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 smol machines can branch a running machine with its memory and processes, so many rollouts start from one prepared state; Cloudflare has no fork. | 144th of 360, with limits $9,428 a month | 111th of 360, with limits $6,978 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 | 36th cheapest of 364 $670 a month | 10th cheapest of 364 $200 a month |
| CI runners 40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month CI that builds Docker images fits smol machines better, since Cloudflare caps disk at 20 GB by default and turns off iptables for Docker; bochka adds /dev/kvm for Android builds. | 301st of 377, with limits $704 a month | 66th cheapest of 377 $514 a month | 4th cheapest of 377 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB Cloudflare starts from a fresh disk after sleep, smol machines keeps files but bills the disk while stopped, and bochka stops at no cost with its disk kept. | 70th cheapest of 368 $93 a month | 216th of 368, with limits $29 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 ships a desktop: Cloudflare removed its built-in one and smol machines only has a guide for your own Chromium; bochka streams a 60fps desktop with computer use. | 166th of 369, with limits $460 a month | 90th of 369, with limits $156 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 | 176th of 367, with limits $136 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 | 241st of 346, with limits $242 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 | 148th of 338, with limits $4,344 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 Red-team runs often need nested VMs and raw networking; Cloudflare cannot change iptables or take raw TCP, smol cloud has no nested virtualization, and bochka has both. | 239th of 360, with limits $325 a month | 252nd of 360, with limits $377 a month | 2nd cheapest of 360 $200 a month |
| GPU eval jobs 10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month | Can't run it | Can't run it | 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 | smol machines | bochka |
|---|---|---|---|
| Isolation | Firecracker microVM per container, own kernel and network | libkrun microVM with its own guest kernel | Full VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts |
| Biggest machine | 4 vCPU / 12 GiB / 20 GB disk by default (can be raised) | Up to 32 vCPU / 32 GB on Startup, 16 vCPU / 24 GB on Pro | Up to 16 vCPU / 32 GB on the $100 plan and above |
| Files after a stop | Fresh disk after sleep; snapshots (public beta, 30 days) or R2 backups if your code saves them | Filesystem survives a stop, /tmp is emptied; stopped disk keeps billing | Disk saved every minute and on stop; a stopped sandbox costs nothing |
| Fork | No fork; restore a saved snapshot or backup into a new sandbox | Branch a running machine with its memory and processes | Fork a running sandbox with its disk, without stopping it |
| Wake on request | Sleeps after inactivity and wakes on the next request | A command or terminal starts a stopped machine; idle apps wake on the next request | No; a stopped sandbox is started by API |
| Docker inside | docker:dind with iptables and IP forwarding turned off | Docker inside the VM, with its data on the machine's ext4 disk | Full Docker, root and systemd |
| Nested virtualization | Not documented | Not exposed in the cloud API; a local smolvm flag only | Yes, /dev/kvm for Android emulators and VMs |
| Inbound traffic | HTTP and WebSocket previews through your Worker; no raw TCP or public IP | Up to 16 published ports through a returned URL; no dedicated IP | HTTPS URLs for up to 50 ports, token-protected; raw TCP; dedicated IPv4 or IPv6 |
| Outbound rules | allowedHosts deny-by-default list plus outbound handlers you write in Worker code | Blocked, open, or an allowlist of hosts and CIDR ranges | 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 | Cloud secrets are environment variables the guest can read | Managed credentials proxy for model providers and any HTTPS API; switch a credential to another account |
| Desktop and browser | Built-in desktop removed in SDK 0.10.2; bring your own | No hosted desktop; a guide shows running your own Chromium | 60fps Linux desktop, Chromium and computer use built in |
| Coding agents | Run Claude Code, Codex, OpenCode or Pi in your image; OpenCode has an SDK helper | Registry images with the Codex CLI and the Harbor eval harness | Seven agents preinstalled, with a prompt, steer and events API |
| Regions | Several regions across Cloudflare's network | No region choice in the cloud API | EU only (Germany, Finland, France), with EU data residency |
| Self-hosting | No; the SDK is open source, the platform is not | Open-source smolvm runs on your laptop or your own servers | No, hosted only |
Every feature Battleships tracks (43)
| Feature | Cloudflare Sandbox | smol machines | bochka |
|---|---|---|---|
| Full VM (own kernel) | Yes | Yes | Yes |
| Docker inside | Yes | Yes | Yes |
| Nested virtualization | No | No | Yes |
| Root | Yes | Not published | Yes |
| Systemd | Not published | Not published | Yes |
| Desktop GUI | No | No | Yes |
| Browser | No | No | Yes |
| Computer-use API | No | No | Yes |
| SSH | Yes | No | Yes |
| Persistent disk | No | Yes | Yes |
| Pause/resume | No | Yes | 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 | Yes | No |
| Wake on request | Yes | Yes | No |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | No | Not published | 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 | Yes | Yes |
| Agent harness API | Yes | No | Yes |
| MCP server | No | Yes | No |
| GPU | No | No | No |
| Windows | No | No | No |
| Arm64 | No | Yes | 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 | Yes | Yes |
| Usage per sandbox (API) | Not published | Yes | Yes |
| Audit logs | Yes | Not published | No |
| SSO | Yes | Yes | No |
| SOC 2 | Yes | No | No |
| HIPAA | Yes | No | No |
| EU data residency | Yes | No | Yes |
| Zero data retention | Not published | Not published | Yes |
Performance
There is no comparable CPU measurement for Cloudflare Sandbox or smol machines: neither has been run on the StarSling hpc-sandbox-benchmarks test. bochka did 26.69 runs per second on that Node.js build-and-test loop at 4 vCPU / 8 GB. smol machines publishes a boot time under 200ms for smolvm, which is a start-time figure, not CPU speed.
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 smol machines 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 | smol machines, 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 | $25 · Standard | $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 | $93 · Standard | $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 | $1,139 · Pro | $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 | $465 · Startup | $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,389 · Startup | $2,000 · $2000/mo · with limits |
Cloudflare Sandbox: You need Workers Paid ($5 a month minimum). CPU is billed only while in use; memory and disk are billed on the instance size you picked until the container sleeps, and 4 vCPU always comes with 12 GiB.
smol machines: smol cloud charges a base fee for every hour a machine runs, plus the CPU and memory the guest actually uses, with a one-minute minimum and disk billed even while stopped. Pro ($20) and Startup ($150) are monthly fees on top of usage, not credit.
smol machines: Plans start at $20 a month, and the whole fee 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, so the three scenarios that keep 50 GB of files between sessions do not fit without your own snapshot or backup code, and its 1,500 vCPU account cap is short of the 2,000 vCPU the 1,000-job burst needs, though it can be raised. smol machines fits all five scenarios but caps machines by plan (20 on Standard, 100 on Pro, 1,000 on Startup), with stopped machines still holding a slot. bochka's limit that bites is starts: on the 1,000-job burst, starts above 90 a minute wait in a queue.
| Scenario | Cloudflare Sandbox | smol machines | bochka |
|---|---|---|---|
| One coding agent, workdays |
| None that bite | None that bite |
| One agent that never stops |
| None that bite | None that bite |
| 50 agents in parallel |
| None that bite | None that bite |
| Sandboxes for your users | None that bite | None that bite | None that bite |
| 1,000 short jobs at once |
| None that bite |
|
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 follow egress rules you write in code.
- Egress rules you can program. Teams that must control traffic can block every host not listed and run their own Worker code on each outbound request.
- 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.
- Right next to your Workers app. If your app already runs on Workers, sandboxes sit beside Durable Objects and R2, across several regions of Cloudflare's network.
Use smol machines when
you want one open-source VM engine from your laptop to your own servers, machines that keep their files, or live branches of a running machine.
- Open source, laptop to your own servers. Teams that want the same VM locally, in a hosted cloud and on their own servers can use one open-source engine.
- Live branches with memory. Useful for RL and test fan-out: branch a running machine with its memory and processes, paying the one-minute minimum once.
- Files that survive a stop. Agents that come back to the same work keep their filesystem across a stop, on machines of up to 32 vCPU.
Where bochka fits
If your agents work for hours on builds, tests, emulators or a desktop, both Cloudflare Sandbox and smol machines leave pieces for you to build. bochka gives each agent a full VM that keeps its disk, runs full Docker with /dev/kvm, streams a desktop, and comes with coding agents you drive from outside.
Files kept, stops free
On Cloudflare a sleeping sandbox wakes with a fresh disk unless your code saves a snapshot, which expires after 30 days. smol machines keeps files but bills the disk while stopped. bochka saves the disk every minute and a stopped sandbox costs nothing.
A whole machine, not just a VM boundary
Cloudflare runs Docker with iptables off and has no raw TCP; smol cloud has no SSH, no nested virtualization and 16 published ports. bochka has full Docker, /dev/kvm, SSH, 50 HTTPS ports and raw TCP.
Desktop, agents and keys built in
Neither ships a desktop. On Cloudflare you bake agents into your image and write the code that adds each token; on smol cloud secrets sit in the guest, readable by a prompt injection. bochka has a 60fps desktop, seven agents and a credentials proxy.
Use bochka when your agents do real work for hours: full Docker, emulators, SSH and a desktop, on a machine that keeps its files, with coding agents you drive from outside and keys that never enter the sandbox. Compare it one to one: bochka vs Cloudflare Sandbox and bochka vs smol machines.
Questions people ask
Is Cloudflare Sandbox cheaper than smol machines?
In all five scenarios on this page, smol machines has the lower estimate, for example $93 a month against $148 for one agent that never stops. For sandboxes for your users they are close, at $465 against $476. Cloudflare also misses three scenarios because its disk resets on sleep.
Which is faster, Cloudflare Sandbox or smol machines?
Neither has a result on the CPU benchmark used here, so there is no fair speed comparison. smol machines publishes a boot time under 200ms for smolvm. bochka scored 26.69 runs per second on that benchmark.
Can Cloudflare Sandbox and smol machines run Docker?
Both can. Cloudflare supports docker:dind with iptables and IP forwarding turned off, because containers cannot change iptables. smol machines runs Docker inside the VM with its data on the ext4 disk. bochka runs full Docker with root and systemd, plus /dev/kvm.
Which one keeps my files between sessions?
smol machines keeps the filesystem across a stop, though the disk keeps billing. Cloudflare starts from a fresh disk after sleep unless your code saved a snapshot (public beta, kept 30 days) or an R2 backup. bochka saves the disk every minute and on stop.
Can either one fork a running sandbox?
smol machines can branch a running machine into children that keep its memory and processes. Cloudflare has no fork; you restore a saved snapshot or backup into a new sandbox. bochka forks a running sandbox with its disk.
Can I self-host Cloudflare Sandbox or smol machines?
smol machines, yes: smolvm is open source and runs on macOS, Linux and Windows hosts. Cloudflare's SDK is open source, but the platform it runs on cannot be self-hosted. bochka is a hosted service only.
Try bochka
Install the CLI, then run bochka new.
Product preview
More comparisons
- bochka vs Cloudflare Sandbox
- bochka vs smol machines
- 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