Cloudflare Sandbox vs GitHub Codespaces

Cloudflare Sandbox is a sandbox you drive from code: a container in its own microVM, started from your Worker. It sleeps when idle and keeps files through snapshots or R2 that your code sets up. GitHub Codespaces is a dev environment for people: a dev container opened from a repository in VS Code or the browser. It keeps its files, but stops after 12 hours at most.

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.

GitHub Codespaces

GitHub Codespaces is GitHub's cloud development environment: a ready-to-code Linux machine for a repository, opened in the browser, VS Code or the GitHub CLI.

Codespaces is a different kind of product from boat: a dev environment for people who work on a GitHub repository, not a sandbox API for agents. Each codespace is a Docker container built from the repo's dev container config. It runs on its own newly built VM on Azure, with 2 to 32 cores. It is built for developers and teams who want every contributor to start from the same setup, with prebuilds, port forwarding and GitHub billing.

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 rankGitHub Codespaces: price rankboat: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
Long build and test sessions need files and time. On Cloudflare your code keeps files with snapshots, automatic saves or R2, on 20 GB of disk. A codespace keeps files but stops after 12 hours. boat saves the disk with no code and runs past 12 hours once auto-stop is off.
192nd of 365, with limits
$1,543 a month
290th of 365, with limits
$4,618 a month
5th cheapest of 365
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
An always-on assistant needs its files and logins to stay put. On Cloudflare your code saves snapshots or mounts R2. Codespaces stops every 12 hours, so it needs a restart script. On a paid boat plan you turn auto-stop off.
43rd cheapest of 361
$2,188 a month
320th of 361, with limits
$6,970 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
For short code-interpreter calls Cloudflare fits well: CPU is billed only while busy, and a container wakes on the next request. Each codespace builds a dev container on a new VM, which prebuilds speed up.
17th cheapest of 336
$144 a month
283rd of 336, with limits
$619 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 own users and adds egress rules in Worker code. Codespaces are created for GitHub users on a repository, and GitHub does not publish how many can run at once.
19th cheapest of 349
$731 a month
276th of 349, with limits
$1,964 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
276th of 349, with limits
$9,489 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 many short, separate sandboxes. On Codespaces every copy is created again from the repository or a prebuild. boat can fork one prepared machine while it runs; each fork counts as a start.
60th cheapest of 359
$818 a month
295th of 359, with limits
$1,519 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
Neither is a natural CI box. Cloudflare has 20 GB of disk and runs Docker with iptables off. Codespaces has no fork or snapshot API, so each run starts from a repo or a prebuild.
303rd of 374, with limits
$704 a month
317th of 374, with limits
$909 a month
2nd cheapest of 374
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
Codespaces is the more polished dev box for a person, with VS Code and files kept between days, but it stops after 12 hours at most. Cloudflare starts from a fresh disk after sleep unless your code snapshots it or mounts R2.
123rd cheapest of 371
$93 a month
144th of 371, with limits
$270 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 ships a desktop ready to use. On Cloudflare you build one into your image. A codespace can add a basic noVNC desktop through the desktop-lite feature, with no computer-use API. boat streams a 60 fps desktop with Chrome and computer tools.
207th of 367, with limits
$460 a month
297th of 367, with limits
$1,367 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
306th of 356, with limits
$678 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
324th of 343, with limits
$922 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
168th of 327, with limits
$5,741 a month
279th of 327, with limits
$18,637 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
284th of 351, with limits
$445 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 SandboxGitHub Codespacesboat
What it isSandbox SDK: Linux containers you start and drive from a Cloudflare WorkerCloud dev environment opened from a GitHub repository in VS Code, the browser or the CLISandbox API: full VMs you create, fork and drive from code
IsolationFirecracker microVM per container, own kernel and networkA Docker container on its own newly built VM, with its own virtual networkFull VM with its own kernel, on a physical host dedicated to boat (AMD Ryzen 7 9700X or Ryzen 9 9950X); vCPUs are shared
Largest machine4 vCPU / 12 GiB / 20 GB disk2, 4, 8, 16 or 32 cores, with 4 GB of memory per core16 vCPU / 32 GB / 251 GB disk (needs the $100 plan or higher)
How long it runsNo fixed maximum; stops after an inactivity timeout and wakes on the next request; runtime not guaranteedStops after 30 idle minutes by default (up to 240) and after 12 hours at most, even while in useAuto-stop 1 h by default; up to 30 days, or off on a paid plan with no session cap
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 bucketFiles are kept and storage is billed; a stopped codespace is deleted after 30 days by default (0 to 30 days)Disk 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
Fork a running sandboxSnapshot or back up a running sandbox, then start new sandboxes from it; no one-call forkNo copy or snapshot endpoint; new codespaces start from a repo, branch, pull request or prebuildOne call, without stopping it; the fork uses the last 1-minute snapshot
Docker and nested virtualizationdocker:dind with iptables and IP forwarding turned off; nested virtualization not documentedDocker inside through a dev container feature, with sudo; /dev/kvm not documentedDocker with BuildKit, root, systemd and /dev/kvm on every machine
Desktop and computer useBuilt-in desktop removed in SDK 0.10.2; build one into your own image, or use the separate Browser Run service for headless browsersVS Code, JupyterLab and a terminal; a Fluxbox desktop over noVNC through the desktop-lite feature, which you configure; no computer-use API1920x1080, 60 fps desktop and Chrome, computer tools, embeddable stream; no GPU
Reaching the sandboxHTTP and WebSocket previews routed through your Worker; SSH; no raw TCP inbound or public IPA URL per forwarded port, plus SSH and CLI tunnels; no public IPUp to 50 HTTPS URLs, token-gated by default; SSH; raw ports over public IPv6 (some sandboxes have no IPv4 of their own)
Egress controlallowedHosts deny-by-default list plus outbound handlers you write in Worker codeOpen internet; GitHub says there is no way to restrict itOpen internet; no provider-side allowlist
Keeping keys out of the sandboxYour outbound handler adds the token for any HTTP or HTTPS host; you write the codeSecrets are copied into the codespace as environment variablesOptional 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
Coding agentsGuides for Claude Code, Codex, OpenCode and Pi in your image, plus integrationsGitHub Copilot as a VS Code extension; other agents you install and run yourselfSeven installed (Claude Code, Codex, OpenCode and more), with a prompt, steer and events API
Sleep when idleStops after inactivity and wakes on the next requestStops after the idle timeout; you restart it from the editor, CLI or APIAuto-stop on a timer (1 h by default), not on idle; full rate while running
RegionsSeveral regions across Cloudflare's network; pin to a region or jurisdictionUS East, US West, Europe West and Southeast AsiaGermany, Finland and France; no US or Asia region; you cannot pick one
Every feature Battleships tracks (43)
FeatureCloudflare SandboxGitHub Codespacesboat
Full VM (own kernel)YesYesYes
Docker insideYesYesYes
Nested virtualizationNo documented wayNot publishedYes
RootYesYesYes
SystemdNot publishedNot publishedYes
Desktop GUINo documented wayWith your own setupYes
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 setupNo documented wayYes
Fork/cloneWith your own setupNo documented wayYes
Live fork (no pause)With your own setupNo documented wayYes
Memory forkNo documented wayNo documented wayNo documented way
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesNo documented wayYes
Idle auto-stopYesYesNo documented way
Wake on requestYesNo documented wayNo documented way
HTTPS preview URLsYesYesYes
Raw TCP inboundNo documented wayNo documented wayYes
Public IPv4No documented wayNo documented wayNo documented way
Egress allowlistYesNo documented wayNo 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 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 wayYesYes
Usage per sandbox (API)Not publishedNo documented wayYes
Audit logsYesYesNo documented way
SSOYesYesNo documented way
SOC 2YesYesNo documented way
HIPAAYesNo documented wayNo documented way
EU data residencyYesYesNo documented way
Zero data retentionNot publishedNot publishedYes

Performance

Cloudflare SandboxNot measured
GitHub CodespacesNot measured
boat28.06 runs/s

Neither Cloudflare Sandbox nor GitHub Codespaces 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. ComputeSDK measured a 671 ms median start for Cloudflare with 100 at once (2026-11-06, default size). Codespaces and boat are 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 and GitHub Codespaces 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 monthGitHub Codespaces, 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$51 · Personal account: GitHub Free$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$148 · Workers Paid$270 · Personal account: GitHub Free · 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$3,019 · Personal account: GitHub Free$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$850 · Personal account: GitHub Free · 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$1,889 · Personal account: GitHub Free · 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.

GitHub Codespaces: Codespaces bills $0.09 per core-hour while a codespace is active, used or not, plus $0.07 per GB-month of storage while it exists, stopped too. There is no 4-core 8 GB machine, so 4 vCPU / 8 GB is priced on the 4-core 16 GB machine. Personal accounts get a free monthly quota; organizations do not.

GitHub Codespaces: 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. Its 1,500 vCPU account cap is short of the 2,000 vCPU the 1,000-job burst needs, though Cloudflare raises it on request. Codespaces keeps files, but every codespace stops after 12 hours, so it misses the always-on scenario. GitHub does not publish how many codespaces can run at once, so 300 user sandboxes and 1,000 short jobs are not confirmed. boat does not fit the burst as is: 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 SandboxGitHub Codespacesboat
One coding agent, workdaysNone for this scenarioNone for this scenarioNone for this scenario
One agent that never stopsNone for this scenario
  • Personal account: GitHub Free: sessions capped at 12 h
None for this scenario
50 agents in parallelNone for this scenario
  • how many machines can run at once: limit not published, probably fine at 50 (the typical published limit is 50)
None for this scenario
Sandboxes for your usersNone for this scenario
  • not confirmed: how many machines can run at once (you need 300; the typical published limit is 50)
None for this scenario
1,000 short jobs at once
  • Workers Paid: max 1,500 vCPU running at once (needs 2,000)
  • not confirmed: how many machines can run at once (you need 1,000; the typical published limit is 50)
  • 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 many short sandboxes that sleep when idle, wake on the next request and follow egress rules you program.

  • Egress rules you can program. Useful when sandboxes run untrusted code: block every host except the ones you list, and run your own code on each outbound request.
  • Sleeps when idle, wakes on request. Useful for many short, spiky sessions: 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, in a region you can pick.

Use GitHub Codespaces when

your developers want a ready VS Code environment for a GitHub repository, opened from a branch or pull request, with files kept between days.

  • Built into GitHub. Useful if your team lives on GitHub: open a codespace from any repo, branch or pull request, with the dev container already set up.
  • Bigger machines for people. Useful for heavy local-style work: machines go up to 32 cores with 4 GB of memory per core, and files stay between days.
  • Free hours and compliance reports. A GitHub Free account includes 120 core-hours and 15 GB-month of storage each month, and GitHub Enterprise Cloud lists audit reports.

Where boat fits

If you run coding agents that work for hours, neither product was built for that: Cloudflare needs your code to keep files across sleep, and Codespaces is a dev box for people that stops at 12 hours. boat gives each agent a full VM that saves its disk with no code, with Docker, /dev/kvm, a desktop and the agents installed. boat runs only in the EU and has no SOC 2 report today.

Work that survives the night

On Cloudflare your code saves snapshots, automatic saves or R2 to keep files across sleep. A codespace keeps files but stops at 12 hours, ending its processes. boat runs with no session cap once auto-stop is off, saves the disk every minute and forks while running. Memory is not saved.

A full machine, not a container

On Cloudflare, Docker runs with iptables off and disk is 20 GB. Codespaces documents no /dev/kvm and no public IP, and its desktop is a noVNC feature you configure. boat has systemd, /dev/kvm, a 60 fps desktop and raw ports over IPv6.

Agents driven from outside

On Cloudflare you bake each agent into your image and write the outbound handler that adds tokens. On Codespaces you script agents over SSH, and secrets sit in environment variables. boat ships agents with a prompt, steer and events API, and an optional paid credentials proxy.

Use boat when your code starts agents that work for hours or days: full VMs with Docker, /dev/kvm and a desktop, coding agents installed, and machines that save their disk and fork while running. Compare it one to one: boat vs Cloudflare Sandbox and boat vs GitHub Codespaces.

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 GitHub Codespaces?

In our scenarios Cloudflare's estimate is lower in four of five: one agent on workdays is $39 against $51, one agent all month $148 against $270, 50 agents $1,660 against $3,019, and 300 user sandboxes $476 against $850. For 1,000 short jobs both come to $1,889, and neither fits as is. boat comes to $20, $26, $317, $200 and $8,800 for the five.

Which is faster, Cloudflare Sandbox or GitHub Codespaces?

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. boat also places some sandboxes on other hosts.

Can I run Docker in Cloudflare Sandbox or GitHub Codespaces?

Yes, with limits. Cloudflare supports docker:dind with iptables and IP forwarding turned off. Codespaces runs Docker inside the dev container through a dev container feature, with sudo. Neither documents /dev/kvm. boat runs Docker with systemd and /dev/kvm.

Can an AI agent run 24/7 on either one?

On Cloudflare, yes, if your code keeps files with snapshots, automatic saves or R2: a container has no fixed maximum runtime, but none is guaranteed. Codespaces stops every codespace after 12 hours, even while in use. A boat sandbox stops after 1 hour by default; on a paid plan you turn auto-stop off and it runs until you stop it.

Which one keeps my files?

Codespaces keeps files when a codespace stops, and deletes stopped codespaces after 30 days by default. Cloudflare starts from a fresh disk after sleep, unless your code saves a snapshot (public beta, 30 days), schedules automatic saves or works in a mounted R2 bucket. boat saves the disk every minute and at each stop, and keeps it at least 14 days after a stop.

Where do they run?

Cloudflare places containers in several regions of its network and lets you pin one. Codespaces runs in US East, US West, Europe West and Southeast Asia. boat runs on machines in Germany, Finland and France, and you cannot pick a region.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons