Cloudflare’s sandbox story is elegant if your application is already a Worker. A Durable Object starts a container instance, your Worker sends it commands, and the Worker is the single place that decides what the sandbox can reach and which credentials get attached on the way out. For untrusted JavaScript, Python or WebAssembly that only needs methods you pass in, Dynamic Workers skip the Linux machine entirely.
The reasons to look elsewhere follow from the same design. This page covers them and the options that fit each. We build Sandscale, one of those options. Cloudflare facts are from its Sandboxes overview, lifetime, security and Containers pricing pages as of November 2026.
Where Cloudflare Sandboxes stand
- Shape: available on the Workers Paid plan ($5 a month) and reached through a Worker. Each instance is described as a microVM with its own kernel and network.
- Lifetime: an instance runs while its Durable Object is active, then for an inactivity timeout of up to 6 hours. Cloudflare’s docs say “code that runs inside the instance does not count as activity”.
- State: when an instance stops, processes and disk end with it. Container snapshots (public beta) save the writable root filesystem, not memory, and expire after 30 days.
- Billing: every 10 ms an instance runs, CPU on active use, memory and disk on the instance type you provision. The docs say “an idle instance is still billed”.
- Sizes: from
lite(1/16 vCPU, 256 MiB) tostandard-4(4 vCPU, 12 GiB, 20 GB disk). - Network and credentials: internet off by default; credentials can be added by an outbound handler in your Worker so the sandbox never holds them.
Why teams look elsewhere
- The agent is not a Worker. If the orchestrator is a Node service, a Python worker or a CI job, wiring a Worker and a Durable Object in front of every sandbox is extra infrastructure.
- Long work inside the box. A long build that produces no outside activity is stopped when the inactivity timeout ends unless something keeps the Durable Object busy.
- Processes must survive a wait. Snapshots keep files, not memory, so a dev server or loaded session restarts.
- Bigger boxes. 4 vCPU and 12 GiB is the largest instance type.
- Governance as a product. Approvals, policy and audit are code you write in the Worker.
Quick picks
- Sandscale. Best for: a standalone microVM API (REST, SDK, CLI, MCP) where the box lives until you stop it, pause keeps memory, and approvals, policy, DLP, Vault and audit are built in.
- E2B. Best for: a standalone Firecracker SDK with pause and resume that keeps memory.
- Vercel Sandbox. Best for: another platform-native option, if you deploy on Vercel.
- Fly.io Sprites. Best for: persistent agent computers with automatic checkpoints.
- Daytona. Best for: larger or unusual machine shapes, including GPU and Windows.
- Stay on Cloudflare (Dynamic Workers). Best for: untrusted JavaScript, Python or WebAssembly that needs no Linux machine.
A standalone API with long-lived boxes: Sandscale
A Sandscale sandbox is a Firecracker microVM created with one request to the API, the TypeScript SDK, the CLI, or from your agent through the MCP server at https://mcp.sandscale.dev/mcp. It does not depend on where the rest of your app runs.
Lifetime. A sandbox lives until you stop it or its timeoutSeconds runs out: one hour by default, up to 24 hours on Pro and Team, 4 hours on Free. It does not need outside requests to stay alive. Between calls an idle sandbox is hibernated and woken by the next call; keepAwake() holds it awake when you need that. Pause keeps memory and files, so processes survive.
Meter. Awake vCPU-hours with 4 GiB per vCPU included; paused time is not counted. Free includes 100 hours a month, Pro is $20 a month billed annually or $25 monthly with 1,500 hours, and boxes go up to 16 vCPU on Pro. See pricing.
Governance. Approvals, agent policy, DLP, Vault and a hash-chained audit log, on every plan.
Where Cloudflare is stronger. Cloudflare’s outbound-handler pattern keeps credentials out of the sandbox entirely; Sandscale’s Vault puts secrets into the box’s memory for the run and keeps them out of prompts and logs, but code inside can read its own environment. Cloudflare also has a global network, and Sandscale runs in one US region today. Our Sandscale vs Cloudflare Sandboxes post covers both in depth.
Standalone Firecracker: E2B
E2B is another API-first option: Firecracker microVMs, pause and resume that keep memory and files, per-second billing that stops on pause, 1-hour sessions on Hobby and 24 hours on Pro. See E2B alternatives for its trade-offs.
Platform-native elsewhere: Vercel Sandbox
If what you like is the sandbox living next to your app, Vercel Sandbox is the equivalent on Vercel: Firecracker microVMs, Active CPU billing, persistence by default and 19 regions. See Vercel Sandbox alternatives.
Persistence: Sprites, Freestyle, Sandbox0
If snapshots that keep only files are the problem, Fly.io Sprites keep a persistent filesystem with automatic checkpoints, Freestyle VMs pause with memory intact, and Sandbox0 keeps a whole root filesystem across pauses on gVisor.
Comparison table
As of November 2026. “Not published” means not found on the pages we read.
| Option | How you call it | What keeps it alive | Pause or snapshot keeps | Largest box | Meter | Credentials |
|---|---|---|---|---|---|---|
| Cloudflare Sandboxes | Through your Worker | Durable Object activity, then timeout up to 6 h | Filesystem (beta) | 4 vCPU, 12 GiB | 10 ms active; memory and disk provisioned | Outbound handler keeps them outside |
| Sandscale | REST, TypeScript SDK, CLI, MCP | Its own lifetime, up to 24 h | Memory and files | 16 vCPU (Pro) | Awake vCPU-hours | Vault, in memory for the run |
| E2B | SDK, CLI, MCP | Session up to 1 h or 24 h | Memory and files | 8 vCPU (Hobby) | Per second, CPU and RAM | Stored secrets |
| Vercel Sandbox | SDK, CLI | Session up to 45 min or 24 h | Persistent by default | 8 vCPU, 16 GB (Pro) | Active CPU plus memory | Project credentials |
| Fly.io Sprites | API, CLI, MCP | Persistent | Filesystem, checkpoints | Not checked | CPU and memory on use | Connectors |
| Daytona | SDK, CLI, MCP | Until stopped; 15 min auto-stop | Memory on VM classes | 4 vCPU default | Per second, reserved | Secrets |
When Cloudflare is still the right pick
- Your app already runs on Workers, R2 and Durable Objects.
- You want credentials never to enter the sandbox.
- Your untrusted code fits a Dynamic Worker and needs no Linux machine.
- You want previews and storage served from Cloudflare’s network.
FAQ
What is the best alternative to Cloudflare Sandboxes?
If your agent does not run in a Worker, a standalone API: Sandscale for a microVM per run with approvals, policy, DLP and audit built in, or E2B for a hosted Firecracker SDK. For persistent agent computers, Fly.io Sprites.
Do Cloudflare Sandboxes stay alive while code runs inside?
Not on their own. Cloudflare’s lifetime docs say code running inside the instance does not count as activity; the instance runs while its Durable Object is active and then for an inactivity timeout of up to 6 hours.
Which Cloudflare Sandbox alternatives keep memory when paused?
Sandscale, E2B and Freestyle pause with memory and processes kept. Cloudflare’s container snapshots save the filesystem only.
Do I need a Worker to use Sandscale?
No. Sandscale is a standalone API with a TypeScript SDK, a CLI and an MCP server. You can call it from any service, CI job or agent.
Can a sandbox alternative keep credentials out of the box like Cloudflare does?
Cloudflare’s outbound-handler pattern is the strongest version of that. Sandscale’s Vault keeps secrets out of prompts, logs and the API’s answer and ends them with the run, but code inside the box can read them. If the sandbox must never hold a credential, keep a proxy in front.
Related
- Sandscale vs Cloudflare Sandboxes
- The best AI agent sandboxes in 2026
- Vercel Sandbox alternatives, E2B alternatives
- WebAssembly vs microVMs for agent code
Sources
Read in November 2026:
- Cloudflare: https://developers.cloudflare.com/sandbox/, https://developers.cloudflare.com/sandbox/concepts/lifetime/, https://developers.cloudflare.com/sandbox/concepts/security/, https://developers.cloudflare.com/containers/pricing/
- E2B: https://e2b.dev/pricing
- Vercel: https://vercel.com/docs/vercel-sandbox
- Fly.io Sprites: https://docs.sprites.dev/
- Freestyle: https://www.freestyle.sh/docs/vms
- Sandbox0: https://sandbox0.ai
- Daytona: https://www.daytona.io/docs/en/sandboxes