Modal vs CodeSandbox SDK
Modal gives you short-lived sandboxes on a big AI platform with GPUs and regions around the world. Each one ends within 24 hours, and filesystem snapshots carry its state to a new sandbox. 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). Your code can save a sandbox's disk as a filesystem snapshot and start new sandboxes from it. It suits teams that already run models on Modal and want 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 call it the deprecated 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. “15th cheapest of 336” means 14 of the other 335 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 | 106th of 365, with limits $633 a month | 32nd cheapest of 365 $3,731 a month | 5th cheapest of 365 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB An always-on agent hits Modal's 24-hour limit, so your code snapshots the filesystem and starts a new sandbox each day. CodeSandbox SDK has no hard session cap, at $4,811 a month here. boat ranks #6 at $657, with no session cap once auto-stop is off on a paid plan. | 61st of 361, with limits $1,574 a month | 50th cheapest of 361 $4,811 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 fit short code runs. Modal ranks #15 here at $140 a month, with fast starts and high concurrency. CodeSandbox SDK costs $642 and wakes a hibernated VM with its memory on the next request. | 15th cheapest of 336 $140 a month | 54th cheapest of 336 $642 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 Modal's Team plan fits 300 user sandboxes at once, at $671 a month. CodeSandbox SDK's Scale plan caps at 250. boat ranks #3 at $209; a stopped boat sandbox has no compute charge and keeps its disk for at least 14 days. | 18th cheapest of 349 $671 a month | 140th of 349, with limits $1,707 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 Modal is built for huge bursts of short sandboxes and ranks #6 here. CodeSandbox SDK's Scale plan stops at 250 VMs at once, so it is a compromise. | 6th cheapest of 349 $11,982 a month | 341st of 349, with limits $3,861 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 | 62nd cheapest of 359 $889 a month | 77th cheapest of 359 $1,335 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 that builds Docker images works on CodeSandbox SDK, at $860 a month, and on Modal with runtime="vm", at $1,112. boat ranks #2 at $86, with Docker in every sandbox. | 110th cheapest of 374 $1,112 a month | 96th cheapest of 374 $860 a month | 2nd cheapest of 374 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB A dev box that lives all month keeps its disk on CodeSandbox SDK and on boat. On Modal your code takes a filesystem snapshot and restores it into a new sandbox at least once a day. | 129th of 371, with limits $9.07 a month | 316th of 371, with limits $240 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 Modal ranks #45 here at $153 a month: its official example installs Xvfb, Chromium and noVNC in a VM sandbox. On CodeSandbox SDK you add a VNC desktop to your own template. boat ranks #7 at $200 and streams a 60 fps desktop with Chrome in every sandbox. | 45th cheapest of 367 $153 a month | 54th cheapest of 367 $1,236 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 | 57th of 356, with limits $121 a month | 125th of 356, with limits $741 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 | 98th cheapest of 343 $252 a month | 119th cheapest of 343 $871 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 | 171st of 327, with limits $5,957 a month | 194th of 327, with limits $7,390 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 | 289th of 351, with limits $464 a month | 29th cheapest of 351 $505 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 Modal rents GPUs from T4 to B300, and neither CodeSandbox SDK nor boat has GPUs. | 18th cheapest of 102 $1,116 a month | Not ranked: misses a requirement | Not 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 requirement | Not ranked: misses a requirement | Not ranked: misses a requirement |
Key features
| Feature | Modal | CodeSandbox SDK | boat |
|---|---|---|---|
| Isolation | gVisor by default; a VM runtime with its own kernel is available (Modal VM Sandboxes) | Firecracker microVM with its own kernel | Full VM with its own kernel, on AMD Ryzen 7 9700X and Ryzen 9 9950X hosts; vCPUs are shared |
| Docker inside | Yes with the VM runtime (runtime="vm"), at the same price; not documented on gVisor | Yes, and templates build from any Dockerfile | Yes, with systemd and root, in every sandbox |
| Nested virtualization | VM runtime only, Enterprise plan, as an experimental option | Not documented | Yes, /dev/kvm for Android emulators and VMs |
| Longest session | 24 hours (default 5 minutes); for longer work, a filesystem snapshot and a new sandbox | No hard cap; hibernates after an idle timeout of up to one day | No cap once auto-stop is off on a paid plan (default 1 hour, timer up to 30 days) |
| Pause and resume | A sandbox ends within 24 hours; filesystem snapshots (kept as long as you set) and memory snapshots (alpha, 7 days) restore its state into a new sandbox | Hibernates with a memory snapshot and resumes with processes running | Disk saved every minute and at each stop, kept at least 14 days with no compute charge; a resume is like a reboot |
| Fork | One filesystem snapshot boots many new sandboxes | Fork a hibernated sandbox, or a running one sharing its memory | Fork a running sandbox from its last 1-minute disk snapshot, 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 | Germany, Finland and France; no US or Asia region, and you cannot pick one |
| Outbound network rules | Block all, IP-range allowlist, domain allowlist (beta) | No allowlist documented | No provider-side allowlist |
| Shell access | Exec from code; encrypted and raw TCP tunnels | Terminals, commands and files through the SDK; SSH is not documented | 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, signed tokens for private sandboxes; raw TCP not documented | HTTPS URLs for up to 50 ports, token-gated by default; raw ports over IPv6 on sandboxes with no IPv4 of their own |
| Desktop and browser | You set it up: Modal's official example installs Xvfb, Chromium, x11vnc and noVNC in a VM sandbox | A headless Chromium template; you can install a VNC desktop in your own Dockerfile | Built-in 1920x1080, 60 fps Linux desktop with Chrome and computer-use tools |
| Coding agents and API keys | You install the harness in the image; secrets are environment variables or your own sidecar proxy (beta) | You install your own agent in the template; secrets passed in as environment variables | Seven harnesses installed, with an API to drive them from outside; optional paid proxy keeps supported providers' keys out |
Every feature Battleships tracks (43)
| Feature | Modal | CodeSandbox SDK | boat |
|---|---|---|---|
| Full VM (own kernel) | No documented way | Yes | Yes |
| Docker inside | No documented way | Yes | Yes |
| Nested virtualization | No documented way | No documented way | Yes |
| Root | Yes | Yes | Yes |
| Systemd | No documented way | Not published | Yes |
| Desktop GUI | With your own setup | With your own setup | Yes |
| Browser | With your own setup | With your own setup | Yes |
| Computer-use API | With your own setup | No documented way | Yes |
| SSH | With your own setup | No documented way | Yes |
| Persistent disk | With your own setup | Yes | Yes |
| Pause/resume | No documented way | Yes | Yes |
| Automatic snapshots | No documented way | Yes | Yes |
| Fork/clone | Yes | Yes | Yes |
| Live fork (no pause) | Not published | Yes | Yes |
| Memory fork | Yes | Yes | No documented way |
| Custom image (Docker or snapshot) | Yes | Yes | Yes |
| ≥24 h sessions | Yes | Yes | Yes |
| Idle auto-stop | Yes | Yes | No documented way |
| Wake on request | No documented way | Yes | No documented way |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | Yes | No documented way | Yes |
| Public IPv4 | No documented way | No documented way | No documented way |
| Egress allowlist | Yes | No documented way | No documented way |
| Secret proxy | No documented way | No documented way | Yes |
| Secret proxy for any API | No documented way | No documented way | Yes |
| Preinstalled agents | With your own setup | No documented way | Yes |
| Agent harness API | No documented way | No documented way | Yes |
| MCP server | No documented way | No documented way | No documented way |
| GPU | Yes | No documented way | No documented way |
| Windows | No documented way | No documented way | No documented way |
| Arm64 | No documented way | No documented way | No documented way |
| Self-hosting | No documented way | No documented way | No documented way |
| BYOC | No documented way | No documented way | No documented way |
| Open source | No documented way | No documented way | No documented way |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | Not published | Not published | Yes |
| Usage per sandbox (API) | Not published | No documented way | Yes |
| Audit logs | Yes | Not published | No documented way |
| SSO | Yes | Yes | No documented way |
| SOC 2 | Yes | Yes | No documented way |
| HIPAA | Yes | No documented way | No documented way |
| EU data residency | Yes | No documented way | No documented way |
| Zero data retention | Not published | Not published | Yes |
Performance
In StarSling's run of 3 October 2026 (run 37073680030), the V8 Web Tooling Benchmark at 4 vCPU / 8 GB did 28.06 runs/s on boat, 15.48 on Modal's VM runtime and 12.60 on Modal gVisor. StarSling ran Modal with cpu=4, and the sandbox saw 4 CPUs (PR #121). Every boat sandbox in that run ran on an AMD Ryzen 9 9950X host; boat also places some sandboxes on other hosts, and does not promise a CPU model. Providers ran on different hardware in different regions. CodeSandbox SDK is not in that run. For start time, ComputeSDK measured each provider at its default size: with 100 at once on 6 November 2026, Modal 796 ms median and CodeSandbox SDK 11.76 s. boat is 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. Modal measured on: Sandbox (gVisor), request = size, any region. 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. CodeSandbox SDK 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.
| 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 | $0 · Starter | $193 · Scale | $20 · $20/mo |
| One agent that never stops 4 vCPU / 8 GB, 50 GB disk, running 24/7 all month | $109 · 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 | $1,480 · 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 | $579 · 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 | $1,911 · Team · with limits | $1,632 · Scale · with limits | $8,800 · $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. Modal prices CPU per physical core, and one core equals 2 vCPU, so 4 vCPU / 8 GiB costs $0.476 an hour at a full request. StarSling ran Modal with cpu=4 (PR #121); sized that way, Modal bills 4 cores, $0.76 an hour. 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 at $0.01486 each, and each size burns a fixed number per hour: 20 for 4 vCPU / 8 GB, about $0.30. Billing is per started minute, including idle time before hibernation, and a hibernated VM costs nothing. The Scale plan adds a $170 monthly platform fee that is not usage credit. These prices are as checked on 28 September 2026.
CodeSandbox SDK: Plans cost $20, $100, $500 or $2,000 a month, and the whole plan price comes back as VM time for that month. A 4 vCPU / 8 GB sandbox costs $0.036 an hour, billed per second while it runs, busy or idle. A stopped sandbox has no compute charge. Saved snapshots above the plan's count ($0.056 a day each) and the optional AI credentials proxy still charge while sandboxes are stopped. Starts above the plan's included number cost $0.03 to $0.07 each.
Limits in those scenarios
Modal sandboxes last at most 24 hours. The workday, always-on and fleet scenarios carry state through a filesystem snapshot or a Volume, which your code sets up. The 50-agent fleet needs Docker, which the default gVisor sandbox does not document; Modal VM Sandboxes run it. CodeSandbox SDK's Scale plan allows 250 VMs at once, so 300 user sandboxes or 1,000 jobs at once need Enterprise. Its egress price and disk beyond 20 GiB are not published. boat fits every scenario except the 1,000-job burst: the $2,000 plan includes 90 starts a minute, extra starts cost $0.03 to $0.07, and starts above 270 a minute fail with 429.
| Scenario | Modal | CodeSandbox SDK | boat |
|---|---|---|---|
| One coding agent, workdays | None for this scenario |
| None for this scenario |
| One agent that never stops |
|
| None for this scenario |
| 50 agents in parallel |
|
| None for this scenario |
| Sandboxes for your users | None for this scenario |
| None for this scenario |
| 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 accept that Together calls this SDK deprecated.
- 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. On Modal your code carries work across the 24-hour limit with filesystem snapshots, and Docker needs the VM runtime. CodeSandbox SDK documents no SSH, desktop or raw TCP. boat gives each agent a full VM that saves its disk with no code, with agents and a desktop already set up.
A full machine that keeps its work with no code
On Modal your code takes a filesystem snapshot before the 24-hour limit and restores it into a new sandbox. CodeSandbox SDK keeps its disk, but documents no SSH or /dev/kvm, so emulator builds and nested VMs have no documented path. boat saves the disk every minute and has SSH and /dev/kvm.
Desktop and agents built in
On Modal and CodeSandbox SDK you set up the desktop and the agent harness yourself; Modal publishes an example for the desktop. boat streams a 60 fps desktop, installs seven agent harnesses, and offers an optional paid proxy that keeps supported providers' keys out of the sandbox.
More CPU work in one public run
In StarSling's run of 3 October 2026, boat did 28.06 runs/s, Modal's VM runtime 15.48 and Modal gVisor 12.60, on a 9950X host for boat. Providers ran on different hardware in different regions. CodeSandbox SDK is not in that run, so its CPU speed is not known.
Use boat when your agents work for hours or days: installs, builds, Docker, emulators, a desktop and servers others reach, on a full VM that saves its disk every minute. Compare it one to one: boat vs Modal and boat vs CodeSandbox SDK.
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 Modal cheaper than CodeSandbox SDK?
In most of our scenarios, yes. One agent that never stops costs $109 a month on Modal against $341 on CodeSandbox SDK, though Modal needs a new sandbox each day. 300 user sandboxes cost $579 against $815, and CodeSandbox SDK's Scale plan caps at 250. One agent on workdays costs $0 on Modal inside its $30 Starter credit, against $193. boat costs $26, $200 and $20 for those three.
Which is faster, Modal or CodeSandbox SDK?
On CPU we cannot say: CodeSandbox SDK is not in the public CPU benchmark we use. In StarSling's run of 3 October 2026, Modal's VM runtime did 15.48 runs/s and its gVisor runtime 12.60 at 4 vCPU / 8 GB; boat did 28.06 on an AMD Ryzen 9 9950X host. For 100 sandboxes started at once, ComputeSDK measured Modal at 796 ms median and CodeSandbox SDK at 11.76 s on 6 November 2026.
Can Modal and CodeSandbox SDK run Docker?
CodeSandbox SDK runs Docker inside its Firecracker VMs and builds templates from any Dockerfile. Modal runs Docker with its VM runtime (runtime="vm"), at the same price; its default gVisor runtime does not document Docker. 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; for longer work, Modal recommends a filesystem snapshot and a new sandbox. CodeSandbox SDK has no hard cap and hibernates after an idle timeout of up to one day. On boat, auto-stop defaults to 1 hour; turn it off on a paid plan for no session cap.
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. The last SDK release was 2.4.2 in December 2025. 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