Cloudflare Reimagines Containers for On-Demand Agent Sandboxes
Cloudflare has significantly rearchitected its Containers service to optimize for dynamic agent workloads, enabling faster, on-demand sandbox creation and runtime customization.

Cloudflare has announced a major overhaul of its Containers service, fundamentally rearchitecting it to better serve the needs of agent workloads. The update focuses on enabling on-demand sandbox creation, allowing code to dynamically select sandbox images and instance types at runtime. This shift promises a dramatic improvement in startup times, with benchmarks showing a 6x faster median startup, falling from over four seconds to just 648 milliseconds. Additionally, the service is introducing filesystem snapshots in public beta, a feature crucial for agents that need to save and restore their working environments.
The core of this transformation lies in a complete rethinking of the Containers infrastructure. A new scheduling policy has been implemented, shifting control over sandbox configuration from deployment time to application code. This allows agents to specify precisely the environment they need for each task, rather than relying on pre-configured, static deployments. The redesigned runtime further accelerates the process of bringing a container online, ensuring that agents can begin their work with minimal delay.
This new approach is particularly suited for agent-based tasks, which differ significantly from traditional application deployments. Agents create sandboxes on demand, often for short durations, and require them to be immediately ready for use. They may also need to pause and resume their work, necessitating the ability to save and restore state. The rearchitected Containers service directly addresses these requirements, making it a more natural fit for workloads like those seen in app-building environments, cloud-agent sessions, and integrations with AI coding assistants.
Cloudflare's existing model, where each Container is managed by a persistent Durable Object, provides a strong foundation for these new capabilities. The Durable Object acts as a programmable controller for the container's lifecycle and network traffic. The update enhances this by bringing more control directly to the native ctx.container API, allowing the Durable Object to manage its associated Container more seamlessly. This refined model is also being carried forward into the new Sandbox SDK 1.0.
Previously, configuring different sandbox environments required separate deployments. For instance, an agent needing a small Node.js sandbox and another requiring a large Python sandbox for builds would necessitate two distinct applications, each with its own Durable Object namespace. The new durable_object scheduling policy eliminates this complexity. Now, the image and instance type are simply arguments passed when the sandbox starts, allowing a single Durable Object class to provision diverse environments side-by-side. This makes adding new environments a matter of code modification rather than a new deployment process.
The implications for AI agents and developers are substantial. The ability to dynamically provision and customize sandboxes at runtime means that AI agents can be more efficient and adaptable. For example, coding agents can select environments with specific compilers, package managers, or development servers tailored to the task at hand. This flexibility is crucial for complex workflows, such as those involving code compilation, testing, or the execution of machine learning models.
Furthermore, the introduction of filesystem snapshots in public beta addresses the need for persistent agent workspaces. This feature allows agents to save their progress, configurations, and generated data, enabling them to resume tasks later without starting from scratch. This is invaluable for longer-running agent processes or for scenarios where iterative development and testing are required.
By making Containers more programmable and optimized for agent workloads, Cloudflare is enhancing its ecosystem of services, including Workers, Dynamic Workers, and Durable Objects. This evolution positions Cloudflare Containers as a more robust and flexible platform for developers and AI agents requiring isolated Linux workspaces, streamlining development and execution for a new generation of cloud-native applications.