Article summary — original
Cloudflare Introduces Early Preview of @cloudflare/computer for Agentic Workloads
Cloudflare has introduced an early preview of @cloudflare/computer, an open-source library that provides an agent runtime combining a virtual filesystem with multi-runtime execution across isolates and container sandboxes.
Traditional full-container provisioning for every agent does not scale to meet global CPU compute demands.
Cloudflare's runtime architecture separates the agent harness running on Durable Object isolates from heavier container sandboxes called on demand.
The central workspace provides a SQLite-backed virtual filesystem compatible with node:fs, cloud storage, and git repositories.
The package includes AI SDK-compatible tools allowing models to dynamically choose between lightweight worker backends and full containers.
Scaling Beyond Containers with Isolates
Cloudflare argues that provisioning dedicated container environments for millions or billions of concurrent agents is unsustainable due to global compute constraints. Instead of running full agent harnesses inside containers, Cloudflare advocates separating the agent brain from its execution tools. By running the agent loop inside fast-starting, hibernating Durable Object isolates, systems can scale horizontally while reserving resource-heavy container sandboxes for on-demand tool execution.
The @cloudflare/computer Architecture
To eliminate the need for developers to manually coordinate multiple compute primitives, @cloudflare/computer provides a unified workspace abstraction. The package features a durable virtual filesystem backed by SQLite, compatible with cloud storage, git, and node:fs wrappers. All file operations and shell commands are gated, audited, and observable to give operators control over agent actions.
Runtime Selection and Goals
The library offers an AI SDK-compatible execution tool that guides frontier models to decide between different backends using a uniform exec interface. Fast, low-cost tasks like file manipulation and git workflows run directly in worker isolates, while native binaries or full Linux environments fall back to containers. Cloudflare aims for agents using @cloudflare/computer to handle tasks such that containers are needed for less than 10% of their total work.
Saved original article
The most capable agents have something simple in common: they are given their own computer to work with.
Coding agents work this way. You give them a filesystem, a shell, tools, packages, and the ability to run code. They inspect the environment, make changes, test their work, and keep going. The computer gives the model a familiar way to act on the world. At Cloudflare, we’re working hard to provide the right primitives on which to build the most capable agents.
**Today we’re introducing an early preview of [@cloudflare/computer](https://github.com/cloudflare/workspace).** The @cloudflare/computer package provides an agent runtime where the details and mechanics of what code runs in an isolate, a container sandbox, or a web browser are handled by the platform. Each agent gets a computer, the runtime optimizes for efficiency, and scalability.
We believe that in order to meet the growing demand for compute required by agentic systems we need to look to solutions beyond traditional containerization.
We’ve seen a subtle evolution of this story over the past six months. At the start of the year, spinning up a container and running an agent inside of it was the norm. In recent months, we’ve seen a rapid move for agent harnesses to provide sandboxed code execution via tools. This separates the hands (the sandbox where work is done) from the brain (the agent loop).
No matter where the harness runs, giving every agent a container presents a challenge — across all the clouds, all the hyperscalers, there’s nowhere near enough compute in the world for every company to give each of their users’ agents their own containerized compute environment. This will not scale to hundreds of millions, then billions, of concurrent agents. This is why there is desperate, panicked industry demand for CPU compute, not just GPU compute.
We’ve been working on this problem for a long time at Cloudflare, creating a more efficient compute primitive: isolates. We made that out-of-consensus bet almost 10 years ago when we [introduced Cloudflare Workers](https://blog.cloudflare.com/introducing-cloudflare-workers/). We made it again when we [introduced Durable Objects](https://blog.cloudflare.com/introducing-workers-durable-objects/) almost six years ago. We made this bet because isolates are infinitely horizontally scalable. They spin up and tear down incredibly quickly. They can [hibernate](https://developers.cloudflare.com/durable-objects/examples/websocket-hibernation-server/) when the agent is idle, [store the agent’s own state](https://blog.cloudflare.com/sqlite-in-durable-objects/), and even [spin up their own isolates](https://blog.cloudflare.com/dynamic-workers/) to run untrusted code. Isolates are the best way to scale horizontally, and horizontal scale is what agents demand.
Last year, we [gave isolates the ability to spin up their own container sandboxes](https://blog.cloudflare.com/containers-are-available-in-public-beta-for-simple-global-and-programmable/). From day one, Cloudflare’s architecture has been designed to run the agent harness in the isolate (in a Durable Object) and call an attached container on-demand as a tool. This allows you to utilize heavier compute primitives only when required, optimizing performance and cost. Durable Objects scale infinitely horizontally, and the attached container lets it scale vertically to perform any task. This is how we build agents ourselves, and we’re seeing customers build incredible things this way too.
But when we look at this need to have multiple underlying compute primitives to build agents (isolates and containers) and the need for our customers and developers to combine them themselves in userspace, we think we can do better. We think that we can provide a simpler abstraction.
That’s why we’re starting this experiment by shipping @cloudflare/computer as an open-source library, to learn with our customers who are pushing the bounds of running agents at scale.
The @cloudflare/computer package starts with a simple premise: what if we give an agent a primed filesystem, declaratively defined, containing everything required for the task at hand and a selection of execution environments to operate on those files, each with their own pros and cons regarding speed, capability and cost?
It turns out that agents today are surprisingly capable of selecting the right environment for the task at hand. A job that only needs to manipulate files, process data, or manage a git repository can run inside an isolate. A command that needs Linux, `npm`, or a native binary can run inside a container. Both work against the same files that are kept in sync with the source filesystem.
The @cloudflare/computer package provides a durable filesystem that you can use with git repositories, storage buckets or any files you choose. It provides tools that let you read, write and edit files using [Code Mode](https://blog.cloudflare.com/code-mode/) or bash commands. All operations are gated, audited and observed, giving you fine-grained control over changes the agent is allowed to perform as well as a clear paper trail showing what the agent did.
An instance of a @cloudflare/computer workspace can be instantiated on any Durable Object to provide a virtual filesystem and execution runtime.
It is installed via npm:
The primary use case is to provide that filesystem and tooling to an agent. For example, here’s how to instantiate the workspace on an agent powered by @cloudflare/think intended to triage bug reports.
Several execution backends are provided as part of the @cloudflare/computer package, or you can write your own. Here we wire up a Cloudflare Container.
Expose the file, git, and shell tools alongside product specific tools to reply to reported issues.
The model can use tools during the agent loop, but you can also use the workspace API directly, for example, to prepare the environment before prompting the agent.
Check out the [workspace repository](https://github.com/cloudflare/computer) for more examples of how to use the different backends and tools including a [step-by-step tutorial](https://github.com/cloudflare/computer/tree/main/examples/tutorial) walking through building an agent from scratch.
The central piece of @cloudflare/computer is the workspace. A virtual filesystem backed by SQLite that can be populated from various sources including cloud storage and source control.
The workspace supports optional execution runtimes that allow code to be run against the file system. All runtimes support the same interface `exec(string, options)` and currently two are provided out of the box (but you can write your own):
The `Workspace` class provides an API interface for manipulating the filesystem directly as well as a `node:fs` compatible wrapper so that it can be used easily with third-party JavaScript libraries.
For use with agents, we provide an AI SDK compatible toolkit that provides the most common tools: read, write, edit, ls and exec. The exec tool is a little special as it works across the runtimes taking a `backend` argument. The tool description guides the agent into choosing the correct runtime for the task at hand: either a fast, cheap worker backend or the fully featured container. In our testing, the frontier models are very good at making the correct decision and falling back to using containers only when needed.
Here at Cloudflare we’re already seeing agents exclusively using isolates to build, test, and deploy JavaScript applications with modern tooling, generate tailored documentation for each of our customers, and use web browsers to perform complex tasks.
Our goal with @cloudflare/computer is to provide an agent with a runtime where a container is required for less than 10% of its work, and coding tasks, audio/video manipulation, and document creation can all be handled by isolates.
Try out the [early preview today](https://github.com/cloudflare/computer) - we can’t wait to hear your thoughts.