Skip to content
Rush Commerce
Software & Dev3 min read

Cloudflare: your AI agent needs a computer, not a container

Cloudflare open-sourced @cloudflare/computer, a runtime that routes agent commands between JS isolates and real Linux containers. Why the split matters to your bill.

Every AI agent that does real work eventually needs somewhere to run a command. Read a file, clone a repo, run a script. The default answer for two years has been "give it a container," and that answer is quietly expensive. On August 3, during Agents Week, Cloudflare shipped a different one: @cloudflare/computer, an open-source runtime that decides per command whether your AI agent needs a full Linux box or just a fast JavaScript sandbox.

What actually happened

Cloudflare's announcement post makes the economics explicit: there is nowhere near enough compute on the planet to hand every user's agent its own containerized environment. So the library separates the agent's logic from its execution environment and orchestrates between two primitives.

Isolates handle the common case. Shell commands get translated into JavaScript and run inside a dynamic Worker with direct filesystem access — file edits, data munging, git operations. Cloudflare targets this path for 90%+ of agent workloads.

Containers handle everything else. When the agent needs npm, Node, a package manager, or a native binary, it falls through to a full Linux environment, with the filesystem exposed over a FUSE mount.

The piece that makes the split work is a SQLite-backed virtual filesystem both runtimes read and write, so files stay consistent no matter which backend executed the last command. The API is a Workspace class instantiated on a Durable Object, exposing read, write, edit, mkdir, git clone, and exec(). It's compatible with AI SDK tool definitions.

It's an early preview: npm install @cloudflare/computer. Cloudflare published no pricing, latency benchmarks, or concurrency limits with it.

Why agent compute architecture matters for your business

The reason to care isn't that Cloudflare built something clever. It's that this is the first vendor to say out loud what the unit economics of agents actually are.

If you're building an internal agent for your team — ten people, occasional runs — a container per session is fine. Nobody notices. The moment an agent becomes a customer-facing feature, the math flips hard. A container that spins up for a 40ms file read and idles for the rest of the session is the same mistake as leaving an EC2 instance running for a cron job, except you make it once per user per session.

Two things to take from this even if you never touch Cloudflare. First: look at what your agent actually executes. Most agent "tool calls" are file reads, small edits, and greps. If yours are too, you're renting a Linux kernel to do work fs.readFile would do. Second: the filesystem is the state, not the container. Cloudflare's design works because the SQLite volume is the durable thing and the compute is disposable. That's a portable idea — you can build the same separation on Fly, on Lambda plus S3, on your own boxes.

The caution: early preview means the API will move, and a JS-translated bash layer will have edge cases that a real shell doesn't. Don't put it under a customer-facing path this month. Do read the design, because the cost problem it solves is coming for anyone shipping agents to more than a handful of users.

Key takeaways

  • @cloudflare/computer is open source and in early preview — npm install @cloudflare/computer, no pricing or benchmarks published
  • It routes commands between JS isolates (target: 90%+ of workloads) and full Linux containers, with a SQLite-backed virtual filesystem shared between them
  • The API is a Workspace class on a Durable Object with read/write/edit/mkdir/git-clone/exec, compatible with AI SDK tools
  • The portable lesson: make the filesystem durable and the compute disposable — a container per agent session doesn't survive contact with real user counts

Agent infrastructure decisions are cost decisions you make once and pay for monthly. We build agent systems on architectures you can price out before you ship them — see how we build, or tell us what you're running.

Sources: Cloudflare Blog, Cloudflare Agents Week.

  • #cloudflare
  • #ai-agents
  • #containers
  • #developer-tools
  • #infrastructure
TR

Tommy Rush — Founder, Rush Commerce

Operator turned builder. 15+ years running operations — now shipping the systems businesses run on. More

Get The Rush Report weekly — one email, zero fluff.