Home / Compare / Modal Sandboxes vs Cloudflare Sandbox SDK
Modal Sandboxes vs Cloudflare Sandbox SDK
Short answer: Modal Sandboxes is the better agent sandbox on our published method, 57/100 vs 56/100. Cloudflare Sandbox SDK is cheaper: $18.26 vs $41.88 a month for our reference workload. Checked 2026-11-14.
Verdict (2026-11-16): Modal Sandboxes scores higher: 57/100 vs 56/100 as AI agent sandboxes. Choose Modal Sandboxes for bursty agent workloads where average CPU and memory use is far below peak, since billing follows actual usage when no request is set. Choose Cloudflare Sandbox SDK for apps already on Cloudflare Workers that need a full Linux environment per user or task.
Modal Sandboxes
Highest scoreContainers for untrusted code on Modal's serverless platform, billed per second on max(request, actual usage).
$41.88 a month
Cloudflare Sandbox SDK
Linux sandboxes on Cloudflare Containers, started and controlled from a Worker and a Durable Object.
$18.26 a month
Score by part
Cost at four workloads
| Workload | Modal Sandboxes | Cloudflare Sandbox SDK |
|---|---|---|
| Short tasks: 1 vCPU, 1 GiB, 50 h/month | $0.00 | $5.86 |
| Dev agent: 2 vCPU, 4 GiB, 176 h/month | $11.88 | $18.26 |
| Fleet: 2 vCPU, 4 GiB, 1,760 h/month | $388.81 | $143.72 |
| Always on: 4 vCPU, 8 GiB, 730 h/month | $317.42 | $162.01 |
Per month, cheapest plan for each, without storage, network or GPU. Lowest cost in bold.
Choose Modal Sandboxes if
- Bursty agent workloads where average CPU and memory use is far below peak, since billing follows actual usage when no request is set.
- Sandboxes that need GPUs, from T4 up to B300.
- Teams already running Python, JS or Go workloads on Modal who want sandboxes on the same account and credit.
Choose Cloudflare Sandbox SDK if
- Apps already on Cloudflare Workers that need a full Linux environment per user or task
- Bursty agent workloads that can stop instances quickly, since CPU is billed only when active
- Running untrusted code with internet access turned off or outbound traffic routed through the Worker
Side by side
| Modal Sandboxes | Cloudflare Sandbox SDK | |
|---|---|---|
| Category | agent sandbox, GPU sandbox | agent sandbox |
| Our score | 57/100 | 56/100 |
| Isolation | gVisor container runtime, or a VM runtime with its own Linux kernel (selectable per sandbox) | microVM per container instance (own kernel and network) |
| vCPU per hour | $0.07096 | $0.072 (active CPU only) |
| Memory per GiB-hour | $0.02401 | $0.009 |
| Storage per GiB-month | $0.09 | — |
| Billing | per second | per 10 ms |
| Free tier | Starter plan: $0/month with $30 of compute credit every month (CPU, memory, GPU for Functions and Sandboxes). | None for sandboxes: Containers require the Workers Paid plan ($5/month), which includes 375 vCPU-minutes, 25 GiB-hours of memory and 200 GB-hours of disk each month. |
| Pause and resume | No | No |
| Snapshots | Yes | Yes |
| GPU | Yes | No |
| Custom images | Yes | Yes |
| Network controls | Yes | Yes |
| Max session | 24 hours | Not stated |
| Max vCPU | Not stated | 4 vCPU |
| Max memory | Not stated | 12 GiB |
| Open source | No | No |
| Self-host | No | No |
| SDKs and interfaces | Python, JavaScript/TypeScript, Go | TypeScript (Workers / @cloudflare/sandbox) |
| Regions | Runs in Modal's multi-cloud fleet; optional region pinning (us, eu, ap and narrower regions such as us-west, uk, jp) at a 1.15x (broad) or 1.75x (narrow) price multiplier. | Runs on Cloudflare's network; the pages checked do not document choosing a region. |
| Facts checked | 2026-11-14 | 2026-11-14 |
Modal Sandboxes alternatives · Cloudflare Sandbox SDK alternatives
Sources
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
Sandboxes are billed at non-preemptible rates of 3x list price.
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
Physical core (2 vCPU equivalent) $0.00003942
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
Memory (non-preemptible) $0.00000667
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
Nvidia H100 SXM5 $0.001097
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
$250 + compute / month
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
$30 / month free credits
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
$100 / month free credits
- Modal Sandboxes: https://modal.com/pricing, checked 2026-11-14:
Volumes $0.09
- Modal Sandboxes: https://modal.com/docs/guide/resources, checked 2026-11-14:
For CPU and memory, you'll be charged based on whichever is higher: your request or actual usage.
- Modal Sandboxes: https://modal.com/docs/guide/resources, checked 2026-11-14:
Disk requests are billed by increasing the memory request at a 20:1 ratio.
- Modal Sandboxes: https://modal.com/docs/guide/sandboxes, checked 2026-11-14:
You can change this by passing a timeout of up to 24 hours to the Sandbox.create(...) function.
- Modal Sandboxes: https://modal.com/docs/guide/sandbox-resources, checked 2026-11-14:
By default, each Sandbox requests 0.125 CPU cores and 128 MiB of memory
- Modal Sandboxes: https://modal.com/docs/guide/sandbox-resources, checked 2026-11-14:
Unlike CPU Sandboxes, GPU Sandboxes are subject to preemption.
- Modal Sandboxes: https://modal.com/docs/guide/region-selection, checked 2026-11-14:
A multiplier on top of our base usage pricing will be applied to any Function or Sandbox that has a container region defined.
- Modal Sandboxes: https://modal.com/docs/guide/sandbox-networking, checked 2026-11-14:
Modal provides three levels of outbound network restriction
- Modal Sandboxes: https://modal.com/docs/guide/sandbox-snapshots, checked 2026-11-14:
Memory Snapshots expire 7 days after creation and cannot currently be extended.
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/containers/platform/pricing/, checked 2026-11-14:
Containers are billed for every 10ms that they are actively running ... 375 vCPU-minutes/month + $0.000020 per additional vCPU-second ... 25 GiB-hours/month included +$0.0000025 per additional GiB-second
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/containers/platform/pricing/, checked 2026-11-14:
Memory and disk usage are based on the provisioned resources for the instance type you select, while CPU usage is based on active usage only.
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/containers/platform/pricing/, checked 2026-11-14:
Snapshots are available at no charge during the public beta.
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/workers/platform/pricing/, checked 2026-11-14:
The Workers Paid plan includes Workers, Pages Functions, Workers KV, Hyperdrive, and Durable Objects usage for a minimum charge of $5 USD per month for an account.
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/containers/platform/limits/, checked 2026-11-14:
vCPU per instance | 4 ... Memory per instance | 12 GiB
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/sandbox/, checked 2026-11-14:
Each instance is a microVM with its own kernel and network, so no other workload shares it.
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/sandbox/concepts/lifetime/, checked 2026-11-14:
After the Durable Object becomes inactive, the instance keeps running for the time set with setInactivityTimeout(), up to 6 hours.
- Cloudflare Sandbox SDK: https://developers.cloudflare.com/containers/platform/limits/, checked 2026-11-14:
Snapshot retention | 30 days from creation or the most recent restore
Questions
Is Modal Sandboxes or Cloudflare Sandbox SDK better?
Modal Sandboxes scores higher on our published method: 57/100 vs 56/100 as AI agent sandboxes. Choose Modal Sandboxes for bursty agent workloads where average CPU and memory use is far below peak, since billing follows actual usage when no request is set. Choose Cloudflare Sandbox SDK for apps already on Cloudflare Workers that need a full Linux environment per user or task. Checked 2026-11-14.
Is Modal Sandboxes or Cloudflare Sandbox SDK cheaper?
Cloudflare Sandbox SDK is cheaper: Modal Sandboxes $41.88, Cloudflare Sandbox SDK $18.26 a month for 2 vCPU, 4 GiB, 176 hours a month (8 h × 22 days), CPU busy 30%.
How do Modal Sandboxes and Cloudflare Sandbox SDK isolate code?
Modal Sandboxes: gVisor container runtime, or a VM runtime with its own Linux kernel (selectable per sandbox). Cloudflare Sandbox SDK: microVM per container instance (own kernel and network).