Cloudflare has just launched Dynamic Workers, a revolutionary new approach to running AI agent code that’s turning heads across the industry. The company claims this new isolate-based sandboxing system starts in milliseconds, uses only a few megabytes of memory, and can run on the same machine鈥攅ven the same thread鈥攁s the request that created it.
In a direct comparison with traditional Linux containers, Cloudflare says Dynamic Workers are roughly 100 times faster to start and between 10x and 100x more memory efficient.
The Problem with Containers in AI Infrastructure
Cloudflare’s argument is straightforward: for consumer-scale AI agents, containers are too slow and too expensive. When an agent needs to run one small computation, return a result, and disappear, containers become a bottleneck. They generally take hundreds of milliseconds to boot and hundreds of megabytes of memory to run鈥攃osts that add up quickly when AI-generated tasks only need to execute for moments.
Developers have traditionally faced a difficult choice: keep containers warm (which costs money) or tolerate cold-start delays (which hurts responsiveness). Some might even reuse a live sandbox across multiple tasks, which weakens isolation and creates security risks.
Dynamic Workers: A New Approach
Dynamic Worker Loader is Cloudflare’s answer. The API allows one Worker to instantiate another Worker at runtime with code provided on the fly, usually by a language model. Because these dynamic Workers are built on isolates, they can be created on demand, run one snippet of code, and then be thrown away immediately afterward.
In many cases, they run on the same machine and even the same thread as the Worker that created them, removing the need to hunt for a warm sandbox somewhere else on the network.
The Code Mode Revolution
Cloudflare has spent months pushing what it calls ‘Code Mode’鈥攖he idea that large language models often perform better when given an API and asked to write code against it, rather than being forced into one tool call after another.
The company says converting an MCP server into a TypeScript API can cut token usage by 81%. Dynamic Workers are now positioned as the secure execution layer that makes this approach practical at scale.
Security in the Fast Lane
Cloudflare doesn’t pretend this is easy to secure. The company explicitly acknowledges that hardening an isolate-based sandbox is trickier than relying on hardware virtual machines, and notes that security bugs in V8 are more common than those in typical hypervisors.
However, Cloudflare points to nearly a decade of experience with isolate-based multi-tenancy on the public web. The company highlights automatic rollout of V8 security patches within hours, a custom second-layer sandbox, dynamic cordoning of tenants based on risk, and extensions to the V8 sandbox using hardware features like MPK.
Why TypeScript Beats HTTP for Agents
One of the more interesting aspects is Cloudflare’s argument for a different interface layer. MCP defines schemas for flat tool calls but not for programming APIs. OpenAPI can describe REST APIs but is verbose in both schema and usage.
TypeScript, by contrast, is concise, widely represented in model training data, and can communicate an API’s shape in far fewer tokens. The Workers runtime can automatically establish a Cap’n Web RPC bridge between the sandbox and the harness code, letting a dynamic Worker call typed interfaces across the security boundary as if it were using a local library.
The Future of AI Agent Infrastructure
The launch highlights a growing split in the AI agent market. One side emphasizes fast, disposable, web-scale execution (Cloudflare’s approach). The other emphasizes deeper, more persistent environments with stronger machine-like boundaries (Docker Sandboxes using microVMs).
The trade-off isn’t simply security versus speed鈥攊t’s depth versus velocity. MicroVMs offer a sturdier private fortress and broader flexibility. Isolates offer startup speed, density, and lower cost at internet scale. That distinction may become one of the main dividing lines in agent infrastructure over the coming year.
Dynamic Workers are now in open beta, and Cloudflare is encouraging developers to explore what’s possible when sandboxing itself becomes a strategic layer in the AI stack.

Leave a Reply