Menu
Cloudflare Blog·August 3, 2026

Cloudflare's Hybrid Runtime for AI Agents: Isolates and Containers for Scalable Compute

Cloudflare introduces @cloudflare/computer, a new abstraction designed to provide AI agents with a scalable and efficient compute environment. It leverages a hybrid architecture combining Cloudflare Workers' lightweight isolates with traditional container sandboxes, optimizing for both rapid execution and full Linux compatibility. This approach addresses the massive compute demands of agentic systems by dynamically selecting the most appropriate execution environment for various tasks.

Read original on Cloudflare Blog

The article introduces Cloudflare's vision for scaling AI agents by providing them with a 'computer' abstraction, rather than solely relying on heavy containerization. This approach is born from the observation that traditional container-per-agent models are unsustainable for the projected growth of agentic systems, which will require compute on the order of hundreds of millions or billions of concurrent agents. Cloudflare's solution leverages its decade-long investment in isolates (Cloudflare Workers, Durable Objects) combined with on-demand container sandboxes.

The Challenge of Scaling AI Agents

Initially, agents were typically run inside dedicated containers. While offering a complete environment, this model faces significant scalability and cost challenges due to the overhead of provisioning and managing numerous containers. The article highlights a growing industry demand for CPU compute (beyond just GPU) to support the operational requirements of these agents. Cloudflare posits that a more efficient, horizontally scalable primitive is essential.

Hybrid Compute Architecture: Isolates and Containers

Cloudflare's architecture for agents combines the best of both worlds: isolates for lightweight, infinitely scalable, and fast execution, and containers for tasks requiring a full Linux environment (e.g., specific packages, native binaries). Durable Objects, which are built on isolates, provide statefulness and enable agents to hibernate and spin up other isolates or containers as needed. This allows for a flexible system where heavier compute resources are only utilized when strictly necessary, optimizing both performance and cost.

💡

The Power of Isolates

Isolates (like Cloudflare Workers) offer extremely fast cold start times, minimal memory footprint, and high density, making them ideal for event-driven, short-lived tasks. They provide strong sandboxing without the overhead of virtual machines or full containers. This makes them perfectly suited for the bulk of agent operations that don't require a full OS environment.

@cloudflare/computer: A Unified Abstraction

The @cloudflare/computer package simplifies this hybrid approach by providing a unified runtime abstraction. It offers: a durable, virtual filesystem (backed by SQLite) that can sync with external sources like Git or cloud storage; and multiple execution runtimes (isolate-based for shell commands via `just-bash`, and container-based for full Linux). Agents can intelligently choose the appropriate backend for a task, leveraging the speed and cost efficiency of isolates for file manipulation or data processing, and falling back to containers for more demanding operations.

  • Workspace: Central component providing a virtual filesystem and API for file manipulation.
  • Isolate Runtime: Uses `just-bash` to execute shell commands within a lightweight Workers isolate.
  • Container Runtime: Utilizes Cloudflare Containers for full Linux environment, with filesystem access via FUSE.
  • AI SDK Toolkit: Provides tools (`read`, `write`, `edit`, `ls`, `exec`) that guide agents to select the optimal runtime.
AI agentsserverlessisolatescontainersdistributed computescalabilityCloudflare WorkersDurable Objects

Comments

Loading comments...