The independent reference for AI agent sandboxesLast reviewed
Agent Sandboxesagentsandboxes.org
Sandbox profile · Hosted platform

Cloudflare Sandbox SDK

Answer in brief

A TypeScript SDK for Cloudflare Workers that runs untrusted code in Linux sandboxes backed by Cloudflare Containers and Durable Objects. A strong, programmable option for Workers developers; less suited to Python-first agent stacks.

By the Agent Sandboxes editors · Updated

Overview

Cloudflare’s Sandbox SDK lets a Worker create Linux sandboxes on demand, each a Durable Object paired with a Cloudflare Container. Containers and Sandboxes became generally available in April 2026, and Cloudflare documents each container instance as a microVM with its own kernel.

Its distinctive design is that your Worker sits in the network path: you can run a sandbox with no internet and intercept only the outbound requests you allow, injecting credentials in Worker code. For JavaScript-only workloads, Dynamic Workers (V8 isolates) offer a much lighter option.

Notable

  • Containers and Sandboxes generally available since April 13, 2026.
  • Docs include guides for running Claude Code, Codex and other coding agents.
  • SDK 1.0 in preview; 0.x docs marked legacy.

Cloudflare Sandbox SDK specifications

AttributeDetails
IsolationEach container instance is a microVM with its own kernel and network (per Cloudflare docs); Dynamic Workers (V8 isolates) available for JavaScript-only code
DeploymentHosted platform
Open sourceYes (SDK Apache-2.0 (runs only on Cloudflare))
SDKs and interfacesTypeScript (Workers)
Cold start (vendor claim)Container cold starts “often in the 1–3 second range” depending on image (vendor docs)
Max session lengthNo fixed cap; runs while its Durable Object is active, then up to a 6-hour inactivity timeout
PersistenceEphemeral disk by default; container snapshots (up to 20 GB, 30 days), directory backups to R2, S3/R2 bucket mounts and Durable Object storage
GPUNot documented
NetworkingEgress controlled from Worker code: disable internet and intercept outbound HTTP to allow specific hosts and inject credentials; preview URLs routed through your Worker
PricingCloudflare Containers rates in 10 ms increments: $0.000020 per vCPU-second (active) + $0.0000025 per GiB-second + disk; requires the $5/month Workers Paid plan
Free tierWorkers Paid includes 25 GiB-hours memory, 375 vCPU-minutes and 200 GB-hours disk per month
ComplianceNot documented
RegionsCloudflare’s global network

Facts from Cloudflare Sandbox SDK’s public documentation, verified November 8, 2026. Performance numbers are vendor claims.

Strengths and trade-offs

Strengths

  • You build on Cloudflare Workers and Durable Objects
  • You want egress and credentials controlled in your own code
  • You want global placement on Cloudflare’s network
  • You want a lighter isolate option for JS-only code

Trade-offs

  • TypeScript/Workers only — no Python SDK
  • 1–3 second cold starts are slower than microVM specialists
  • Cloudflare-only; no self-hosting

Best for: Teams building on Cloudflare Workers that want per-user sandboxes with egress and credentials controlled in code.

How Cloudflare Sandbox SDK compares

SandboxIsolationOpen sourceSelf-host / BYOCCold start (vendor)Max sessionSnapshots / pauseGPUSDKs
Cloudflare Sandbox SDKMicroVM (Containers)YesNo / No1–3 sNo fixed capYes / Not documentedNot documentedTypeScript (Workers)
Vercel SandboxFirecracker microVMNoNo / NoMilliseconds (claim)24 h (Pro)Yes / YesNot documentedJavaScript/TypeScript, Python
E2BFirecracker microVMYesYes / YesNot documented1 h / 24 h (Pro)Yes / YesNoPython, JavaScript/TypeScript
Fly.io SpritesMicroVMNoNo / No0.1–2 s wakeUnlimitedYes / YesNoJavaScript/TypeScript, Go, Python, Elixir
FreestyleVMNoNo / Not documented65 msUnlimited (paid)Yes / YesNot documentedTypeScript
DaytonaContainers or VMsNoNot documented / Yes<90 msUnlimitedYes / YesYesPython, TypeScript, Ruby, Go, Java

Head-to-head: E2B vs Cloudflare Sandbox SDK · Daytona vs Cloudflare Sandbox SDK · Modal Sandboxes vs Cloudflare Sandbox SDK · Vercel Sandbox vs Cloudflare Sandbox SDK · Cloudflare Sandbox SDK vs Fly.io Sprites

See all Cloudflare Sandbox SDK alternatives →

Frequently asked questions

What is Cloudflare Sandbox SDK?
A TypeScript SDK for Cloudflare Workers that runs untrusted code in Linux sandboxes backed by Cloudflare Containers and Durable Objects. A strong, programmable option for Workers developers; less suited to Python-first agent stacks.
How does Cloudflare Sandbox SDK isolate code?
Cloudflare Sandbox SDK documents its isolation as: Each container instance is a microVM with its own kernel and network (per Cloudflare docs); Dynamic Workers (V8 isolates) available for JavaScript-only code.
Is Cloudflare Sandbox SDK open source?
Yes (SDK Apache-2.0 (runs only on Cloudflare)).
How much does Cloudflare Sandbox SDK cost?
Cloudflare Containers rates in 10 ms increments: $0.000020 per vCPU-second (active) + $0.0000025 per GiB-second + disk; requires the $5/month Workers Paid plan Check the official pricing page for current rates.
What are the best Cloudflare Sandbox SDK alternatives?
Common alternatives include Vercel Sandbox, E2B, Fly.io Sprites, Freestyle, Daytona. See Cloudflare Sandbox SDK alternatives for a full comparison.

Sources

  1. developers.cloudflare.com/sandbox/
  2. developers.cloudflare.com/sandbox/concepts/lifetime/
  3. developers.cloudflare.com/sandbox/network/
  4. developers.cloudflare.com/containers/
  5. developers.cloudflare.com/containers/pricing/
  6. github.com/cloudflare/sandbox-sdk

Cite this page

Agent Sandboxes. (2026). Cloudflare Sandbox SDK. agentsandboxes.org. Last reviewed November 8, 2026. https://agentsandboxes.org/sandboxes/cloudflare-sandbox/

Found an error or a missing sandbox? Submit a correction — every entry links to the sources it relies on.