Sandboxing AI agents, 100x faster
Mar 24, 2026Kenton Varda, Sunil Pai, Ketan Gupta

Summary
This post introduces the Dynamic Worker Loader API, a new feature for Cloudflare Workers that allows a Worker to dynamically instantiate and sandbox new Workers at runtime. This provides a lightweight and performant sandbox for AI agents, leveraging the existing isolate-based execution model of Cloudflare Workers. The API supports specifying code, environment variables, and network access policies, and integrates with TypeScript for defining agent APIs. It offers significant advantages over container-based sandboxing in terms of speed, memory efficiency, scalability, and latency.