Modal vs CodeSandbox SDK
Modal gives you short-lived gVisor sandboxes on a big AI platform with GPUs and regions around the world, but each one ends within 24 hours. CodeSandbox SDK gives each sandbox a Firecracker VM that runs Docker, has no hard session cap, and hibernates with its memory to wake on the next request.
The companies and products
Modal
Modal is a serverless cloud for AI work: inference, training, batch jobs and sandboxed code, all driven from Python, TypeScript or Go code.
Modal Sandboxes are containers you create from code, run commands in, and then terminate. By default they run under gVisor, a user-space kernel from Google; since October 2026 you can also pick a VM runtime with its own Linux kernel for Docker and FUSE (Battleships tracks that as a separate card, Modal VM Sandboxes). It suits teams that already run models on Modal and want short-lived, scalable code execution next to their GPUs.
CodeSandbox SDK
CodeSandbox SDK is an API from CodeSandbox, now a Together AI company, that starts sandboxed development VMs on the same infrastructure as the CodeSandbox editor.
Each sandbox is a Firecracker microVM built from a template or any Dockerfile. When it goes idle it hibernates with a memory snapshot, and it resumes or forks from that snapshot in seconds. You drive it from a TypeScript SDK through terminals, commands, files and HTTPS hosts. Together's docs now call it the legacy offering and point new users to its successor, the together-sandbox SDK.
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. “19th cheapest of 345” means 18 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 | Modal: price rank | CodeSandbox SDK: price rank | boat: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month | Can't run it | 178th of 367, with limits $1,939 a month | 3rd cheapest of 367 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB An always-on agent hits Modal's 24-hour sandbox limit, while CodeSandbox SDK and boat have no hard session cap. | 196th of 366, with limits $1,924 a month | 215th of 366, with limits $2,478 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; Modal starts many sandboxes fast with high concurrency, while CodeSandbox SDK wakes a hibernated VM with its memory on the next request. | 19th cheapest of 345 $181 a month | 46th cheapest of 345 $642 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 Modal's Team plan fits 300 user sandboxes at once and CodeSandbox SDK's Scale plan caps at 250; boat fits too and keeps each user's disk while it is stopped. | 11th cheapest of 361 $811 a month | 140th of 361, with limits $1,707 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 Modal is built for huge bursts of short sandboxes, while CodeSandbox SDK's Scale plan stops at 250 VMs at once. | 5th cheapest of 360 $19,038 a month | 348th of 360, with limits $3,861 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 | 59th cheapest of 364 $1,244 a month | 64th cheapest of 364 $1,335 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 works on CodeSandbox SDK and on every boat sandbox, while Modal needs its separate VM runtime for Docker. | 126th cheapest of 377 $1,793 a month | 92nd cheapest of 377 $860 a month | 4th cheapest of 377 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB A dev box that lives all month loses its packages on Modal every day, keeps its disk on CodeSandbox SDK, and keeps its disk on boat too. | 138th of 368, with limits $23 a month | 310th of 368, with limits $240 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 Modal nor CodeSandbox SDK ships a desktop, so computer-use agents need one built by hand; boat streams a 60fps desktop with Chromium in every sandbox. | 98th of 369, with limits $183 a month | 206th of 369, with limits $691 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 | 177th of 367, with limits $136 a month | 251st of 367, with limits $443 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 | 267th of 346, with limits $394 a month | 281st of 346, with limits $508 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 | 223rd of 338, with limits $8,795 a month | 193rd of 338, with limits $7,390 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 | Can't run it | 240th of 360, with limits $326 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 Modal rents GPUs from T4 to B300, and neither CodeSandbox SDK nor boat has GPUs. | 19th cheapest of 98 $1,187 a month | 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 | Modal | CodeSandbox SDK | boat |
|---|---|---|---|
| Isolation | gVisor container by default; a VM runtime is sold as Modal VM Sandboxes | Firecracker microVM with its own kernel | Full VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts |
| Docker inside | Only with the VM runtime | Yes, and sandboxes build from any Dockerfile | Yes, with systemd and root, in every sandbox |
| Nested virtualization | VM runtime only, Team and Enterprise, on request | Not documented | Yes, /dev/kvm for Android emulators and VMs |
| Longest session | 24 hours (default 5 minutes) | No hard cap; hibernates after an idle timeout of up to one day | No cap on paid plans; you set the time to live |
| Pause and resume | No paused state; a finished sandbox is gone, only Volumes keep files | Hibernates with a memory snapshot and resumes with processes running | Disk saved every minute and on stop; a stopped sandbox costs nothing and resume boots it again |
| Fork | Snapshot the filesystem into an image and boot new sandboxes from it | Fork a hibernated sandbox, or a running one sharing its memory | Fork a running sandbox with its disk, without stopping it |
| Wake on request | No | Yes; an HTTP request to a host wakes the sandbox | No; a stopped sandbox is started by API |
| GPUs | T4 to B300; 10 at once on Starter, 50 on Team | None | None |
| Regions | US, EU and Asia-Pacific; pinning a region costs 1.15x to 1.75x | A country hint steers scheduling, with no guaranteed placement | EU only: Germany, Finland, France |
| Outbound network rules | Block all, IP-range allowlist, domain allowlist (beta) | No allowlist documented | No provider-side allowlist |
| Shell access | SSH and exec from code | Terminals, commands and files through the SDK; no SSH | SSH, plus exec and files over the API |
| Inbound access | Encrypted and raw TCP tunnels, connect tokens, inbound IP allowlist | HTTPS host per port, public by default; no raw TCP | HTTPS URLs for up to 50 ports, token-protected by default, plus raw TCP |
| Desktop and browser | Not offered; an example shows how to set up VNC yourself | No desktop; a headless Chromium template | 60fps Linux desktop, Chromium and a computer-use API built in |
| Coding agents and API keys | Examples only; secrets are environment variables or your own sidecar proxy | Run your own agent; secrets passed in as environment variables | Claude Code, Codex and others preinstalled with an API to drive them from outside; a credentials proxy keeps real keys out |
Every feature Battleships tracks (43)
| Feature | Modal | CodeSandbox SDK | boat |
|---|---|---|---|
| Full VM (own kernel) | No | Yes | Yes |
| Docker inside | No | Yes | Yes |
| Nested virtualization | No | No | Yes |
| Root | Yes | Yes | Yes |
| Systemd | Yes | Not published | Yes |
| Desktop GUI | No | No | Yes |
| Browser | No | No | Yes |
| Computer-use API | No | No | Yes |
| SSH | Yes | No | Yes |
| Persistent disk | Yes | Yes | Yes |
| Pause/resume | No | Yes | Yes |
| Automatic snapshots | No | Yes | Yes |
| Fork/clone | Yes | Yes | Yes |
| Live fork (no pause) | No | Yes | Yes |
| Memory fork | Yes | 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 | No | Yes | No |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | Yes | No | Yes |
| Public IPv4 | No | No | No |
| Egress allowlist | Yes | No | No |
| Secret proxy | No | No | Yes |
| Secret proxy for any API | No | No | Yes |
| Preinstalled agents | No | No | Yes |
| Agent harness API | No | No | Yes |
| MCP server | No | No | No |
| GPU | Yes | No | No |
| Windows | No | No | No |
| Arm64 | No | No | No |
| Self-hosting | No | No | No |
| BYOC | No | No | No |
| Open source | No | No | No |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | Not published | Not published | Yes |
| Usage per sandbox (API) | Not published | No | Yes |
| Audit logs | Yes | Not published | No |
| SSO | Yes | Yes | No |
| SOC 2 | Yes | Yes | No |
| HIPAA | Yes | No | No |
| EU data residency | Yes | No | Yes |
| Zero data retention | Not published | Not published | Yes |
Performance
On the StarSling hpc-sandbox-benchmarks Node.js build-and-test loop at 4 vCPU / 8 GB, run on 29 September 2026, boat finished 26.69 runs per second and Modal's default gVisor sandbox 12.79, so boat did about twice the work. CodeSandbox SDK was not part of that run, so there is no comparable CPU score for it.
Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Modal measured on: Sandbox (gVisor), request = size, any region. CodeSandbox SDK has 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 | Modal, a month | CodeSandbox SDK, a month | boat, 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 | $15 · Starter · with limits | $193 · Scale | $20 · $20/mo |
| One agent that never stops 4 vCPU / 8 GB, 50 GB disk, running 24/7 all month | $178 · Starter · with limits | $341 · Scale | $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 | $2,229 · Starter · with limits | $2,500 · Scale | $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 | $792 · Team | $815 · Scale · 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 | $3,193 · Team · with limits | $1,632 · Scale · with limits | $2,000 · $2000/mo · with limits |
Modal: Modal bills by the second for the higher of what you request and what you use, and an idle sandbox pays until it is terminated. Starter is free with $30 of monthly credit; Team is $250 a month with $100 of credit, and pinning a region multiplies the price by 1.15x to 1.75x.
CodeSandbox SDK: CodeSandbox SDK sells VM credits, and each size burns a fixed number per hour, billed per started minute, including idle time before hibernation. The Scale plan adds a $170 monthly platform fee that is not usage credit, and a hibernated VM costs nothing.
CodeSandbox SDK: boat charges one hourly rate per machine size, by the second, only while a sandbox runs. Plans start at $20 a month, the whole fee becomes usage credit, and a stopped sandbox costs nothing.
Limits in those scenarios
Modal sandboxes last at most 24 hours and lose everything outside a Volume when they end, so the workday, always-on and fleet scenarios do not fit, and the 50-agent fleet also lacks Docker on the default runtime. CodeSandbox SDK's Scale plan allows 250 VMs at once, so 300 user sandboxes or 1,000 jobs at once need Enterprise, and its egress price and disk beyond 20 GiB are not published. boat fits every scenario except the 1,000-job burst, where even the $2,000 plan queues starts.
| Scenario | Modal | CodeSandbox SDK | boat |
|---|---|---|---|
| One coding agent, workdays |
|
| None that bite |
| One agent that never stops |
|
| None that bite |
| 50 agents in parallel |
|
| None that bite |
| Sandboxes for your users | None that bite |
| None that bite |
| 1,000 short jobs at once |
|
|
|
Which one should you use?
Use Modal when
your sandboxes need GPUs, must run outside Europe, or are huge bursts of short jobs that finish well inside a day.
- GPUs on the same platform. Useful if your agent trains or runs models: Modal rents GPUs from T4 to B300 next to its sandboxes.
- Regions and outbound rules. Modal runs in the US, EU and Asia-Pacific, and can block a sandbox's outbound traffic or allow only chosen domains.
- Very large bursts. Good for huge bursts of short jobs: Modal runs up to 5,000 containers at once on Team.
Use CodeSandbox SDK when
you run previews or code runs that sleep between visits and should wake on the next HTTP request with their memory intact, and you are fine building on what Together now calls its legacy SDK.
- Hibernation with memory. Useful for sandboxes that sleep between visits: a hibernated VM wakes on the next HTTP request with its processes still running.
- Docker and no 24-hour cutoff. Each sandbox is a Firecracker VM that runs Docker and keeps going while it is in use, with no hard session cap.
- Forks that share memory. Good for branching many runs from one warm state, since a fork can share memory with its running parent.
Where boat fits
If your sandboxes are AI agents that work for hours on code, browsers or servers, look at boat. Modal cuts sandboxes off at 24 hours and needs a separate runtime for Docker, and CodeSandbox SDK has no SSH, desktop or raw TCP. boat gives each agent a full VM that keeps its disk and has the agent, desktop and key proxy already set up.
A full machine that keeps its work
On Modal a sandbox ends within 24 hours and only Volume files survive, so agents reinstall every session. CodeSandbox SDK keeps its disk but has no SSH or /dev/kvm, so emulator builds and nested VMs cannot run.
Desktop, agents and keys built in
Neither Modal nor CodeSandbox SDK ships a desktop or agent harness, so you wire up VNC and the agent yourself, and keys sit in environment variables a prompt injection can read. boat streams a 60fps desktop and keeps keys in a proxy.
More CPU work per hour
In the same benchmark run, boat did about twice the build-and-test work of Modal's default sandbox. CodeSandbox SDK has no comparable measurement, so its speed for installs and tests is unknown.
Use boat when your agents work for hours or days: installs, builds, Docker, emulators, a desktop and servers others reach, on a fast full VM that keeps its disk. Compare it one to one: boat vs Modal and boat vs CodeSandbox SDK.
Questions people ask
Is Modal cheaper than CodeSandbox SDK?
Often, yes. One agent that never stops costs $178 a month on Modal against $341 on CodeSandbox SDK, and 300 user sandboxes cost $792 against $815. But Modal's 24-hour limit means the always-on agent does not really fit, and boat does it for $26 a month.
Which is faster, Modal or CodeSandbox SDK?
Only Modal was measured: its default sandbox did 12.79 runs per second on a Node.js build-and-test loop at 4 vCPU / 8 GB. CodeSandbox SDK has no comparable score. boat did 26.69 in the same run.
Can Modal and CodeSandbox SDK run Docker?
CodeSandbox SDK runs Docker inside its Firecracker VMs and builds sandboxes from any Dockerfile. Modal runs Docker only on its VM runtime, not the default gVisor sandbox. Every boat sandbox runs Docker with systemd and root.
How long can a sandbox run on each?
A Modal sandbox lasts 5 minutes by default and 24 hours at most. CodeSandbox SDK has no hard cap and hibernates after an idle timeout of up to one day. boat has no session cap on paid plans.
Is CodeSandbox SDK still maintained?
CodeSandbox is now part of Together AI. Together's docs call the CodeSandbox-based SDK deprecated and name together-sandbox as its successor, while self-serve sign-up still runs through CodeSandbox.
Does either have GPUs?
Modal rents GPUs from T4 to B300 on its gVisor sandboxes. CodeSandbox SDK and boat have no GPUs, so pick Modal if your sandbox needs one.
Try boat
Install the CLI, then run boat new.
7-day free trial