← Back
Cloudflare launches Dynamic Worker Loader in open beta, enabling 100x faster AI agent sandboxing
Cloudflare Workers · featurereleaseapiplatformsecurityintegration · blog.cloudflare.com ↗

Dynamic Worker Loader Goes Open Beta

Cloudflare has announced that Dynamic Worker Loader is now in open beta for all paid Workers users. This feature allows Workers to instantiate new Workers on-demand with runtime-specified code, enabling safe execution of AI-generated code in isolated sandboxes.

The Problem: Sandboxing AI-Generated Code at Scale

As AI agents increasingly write code to accomplish tasks—a practice popularized by Cloudflare's own Code Mode approach—the need for secure execution environments becomes critical. Containers have traditionally been the solution, but they're expensive and slow, requiring hundreds of milliseconds to start and hundreds of megabytes of memory. This overhead makes scaling to consumer-level agents impractical.

The Solution: JavaScript Isolates

Dynamic Worker Loader leverages Cloudflare's existing isolate-based infrastructure—the same technology powering the Workers platform for eight years. Isolates use V8 (Chrome's JavaScript engine) and offer dramatic improvements over containers:

  • 100x faster startup (milliseconds vs. hundreds of milliseconds)
  • 10-100x more memory efficient (megabytes vs. hundreds of megabytes)
  • Unlimited concurrent sandboxes with no rate limiting
  • Zero latency execution on local machines, no global routing needed
  • Available in all Cloudflare locations worldwide

API and TypeScript Integration

The API is straightforward: specify agent code at runtime, define which APIs the agent can access via TypeScript interfaces, and control global outbound access. Developers can restrict or intercept network calls, and agents receive RPC stubs for accessing approved APIs.

Cloudflare advocates for TypeScript to define agent-accessible APIs, noting it's more concise than OpenAPI and requires fewer tokens for LLMs to understand. Since AI models are polyglot, forcing agents to write JavaScript—which is naturally sandboxed and designed for web execution—aligns agent capabilities with optimal runtime characteristics.

Getting Started

Full documentation is available in the Cloudflare Workers runtime API docs. The feature works with dynamic code generation from any LLM, making it immediately applicable to AI agent frameworks and MCP server implementations.