
Cloudflare's September 30 Sandbox SDK 1.0 puts each sandbox under a Durable Object class you write, which picks the Linux image, instance size, lifetime, and saved filesystem — with 0.x bug fixes ending December 31.
Sandbox class to configure. You write a Durable Object class instead, and that class controls each sandbox container directly through the Durable Object container API on this.ctx.container. 1@cloudflare/sandbox 0.x is in production. Cloudflare ships bug and security fixes for 0.x through December 31, 2026, and then stops adding them; applications already deployed on 0.x keep running, and the 0.x package stays on npm. 2| Aspect | Before September 30, 2026 | Now | Action, and when |
|---|---|---|---|
| Who owns a sandbox | The Sandbox class inside @cloudflare/sandbox ran the container and exposed its own feature set | Your Durable Object class calls this.ctx.container and exposes only the methods you write | Rewrite the class as part of the 1.0 move. Before December 31, 2026 if 0.x is in production 1 |
| Image and instance size | One application-wide image and instance type, set in Wrangler | The Durable Object passes an image and an optional instance size to ctx.container.start() | Use the durable_object policy for sandboxes, keep default for uniform services 5 |
| Start to first command | About 4 s on 0.x | Under 600 ms on a prepared image | Time one start on a staging Worker before migrating 2 |
| Filesystem across a stop | Disk is ephemeral, so a stopped instance restarts from its image | snapshotContainer() saves the writable root filesystem, and start({ containerSnapshot }) brings it into the next instance | Snapshot before an instance stops. The handle lives 30 days from its last restore 6 |
| Deploys and image updates | A deploy or an application-wide rollout replaced the sandbox | A running instance keeps running, and Durable-Object-managed instances ignore rollouts until your code restarts them | Build the restart into the class if you want image updates to land 7 |
| If you run 0.x today | Sandbox class, roughly 4 s starts | Bug and security fixes end December 31, 2026 | Pin @cloudflare/sandbox 0.12.10 now, then rehearse the one-way switch on a staging Worker 2 |
| Plan and billing | Sandboxes require Workers Paid; memory, CPU, and disk bill per 10 ms an instance runs | Same | Model usage against the included 25 GiB-hours of memory, 375 vCPU-minutes, and 200 GB-hours of disk 89 |
@cloudflare/sandbox keeps the parts the raw API leaves out. Files streams files in and out of a running sandbox, S3Mount mounts an S3-compatible bucket such as R2 while your Worker signs each request, and DirectoryBackup saves a directory to R2 and restores it into any sandbox, including one running a newer image. 1start() to the first command is under 600 ms in 1.0, against about 4 s in 0.x. 2default policy reads one image and one instance type from Wrangler and rolls that configuration across the whole application. The new durable_object policy moves the decision into your code: you declare named images in Wrangler, Wrangler builds or resolves each one and exposes a digest-pinned reference as ctx.container.images.<name>, and the Durable Object passes one of those references, plus an optional instance size, to ctx.container.start(). A single application can hold both policies, so a Worker can run centrally managed service containers alongside Durable Object-managed sandboxes. 5cloudflare/debian-trixie image directly; it carries Node.js 24.20.0 on Debian Trixie slim. 35| Instance | vCPU | Memory | Disk |
|---|---|---|---|
lite | 1/16 | 256 MiB | 2 GB |
basic | 1/4 | 1 GiB | 4 GB |
standard-1 | 1/2 | 4 GiB | 8 GB |
standard-2 | 1 | 6 GiB | 12 GB |
standard-3 | 2 | 8 GiB | 16 GB |
standard-4 | 4 | 12 GiB | 20 GB |
vcpu, memoryMib, and diskMb; leave instance out and the container starts at lite. A custom size runs from 1 to 4 vCPU, caps memory at 12 GiB and disk at 20 GB, and keeps at least 3 GiB of memory per vCPU. The runtime rejects the legacy dev and standard aliases in an instance value, so an old configuration needs a look before it moves. 10snapshotContainer() captures the writable root filesystem of a running container and returns a handle that is plain data. Store that handle, then pass it back to start({ containerSnapshot }) later, including from another Durable Object of the same class. Snapshots are immutable, so a change you make after a restore needs a new snapshot, and a handle stays tied to the image it was created from. 46/run live in memory and never make it into a snapshot. 7 Cloudflare restores a snapshot only when your application passes the handle to start(); nothing happens on its own. 7durable_object means creating a new application and replacing every running instance, because the policy cannot change afterwards. 5max_instances disappears. The durable_object policy does not support it. Running instances count against the account limits instead: 6 TiB of concurrent memory, 1,500 vCPU, and 30 TB of disk. 510ctx.container.images reflects the Worker version running the Durable Object, so two Durable Objects can start from different images until the deployment finishes. 5start(). The call throws while an instance runs, and a deploy leaves that instance running with the image, entrypoint, and environment variables it started with. 712exec() runs inside an already-running container. It starts another process and waits for a container that is still starting, while a stopped container stays stopped. Output collected by output() sits in the Durable Object's memory and counts against the Worker memory limit, so a large output wants the streams read as they arrive. 12linux/amd64, and a cold start from a fully stopped state commonly takes one to three seconds. 13@cloudflare/sandbox 0.12.10 with the matching docker.io/cloudflare/sandbox:0.12.10 image while you plan, because the migration pages compare 1.0 against 0.12. 2getSandbox, createSession, exposePort, mountBucket, createBackup, and the rest; Cloudflare prints the full list, and each name leads to one migration page. 2Sandbox class with a Durable Object class that starts its own container under the durable_object policy. Every application needs this one change. 2start(). A live preview server is one thing a snapshot leaves behind, so your class starts it again. 27setInactivityTimeout(), up to 6 hours, and code running inside the instance does not by itself count as activity, so a build, a test suite, or a long agent task needs an alarm checking on it. Snapshots carry files, so a server that was running still needs your code to start it again. 7developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
developers.cloudflare.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.