Home / Companies / Cloudflare / Blog / Post Details
Content Deep Dive

Sandboxing AI agents, 100x faster

Blog post from Cloudflare

Post Details
Company
Date Published
Author
Kenton Varda, Sunil Pai, and Ketan Gupta
Word Count
3,177
Language
English
Hacker News Points
-
Summary

Cloudflare's introduction of Code Mode emphasizes the shift from tool-based task execution to code-driven processes, where agents write code to call APIs. By converting an MCP server into a TypeScript API, token usage is significantly reduced, and the new Cloudflare MCP server can expose the entire Cloudflare API using fewer resources. The Dynamic Worker Loader API, now in open beta, allows Cloudflare Workers to instantiate new Workers with runtime-specified code in isolated sandboxes, promising rapid scalability and security. This approach leverages V8 isolates, which are considerably faster and more memory-efficient than containers, enabling seamless scaling to millions of requests per second. The system supports JavaScript as the primary language due to its web-sandboxing nature, while TypeScript is favored for its concise API representation. The platform also provides robust security measures, including automatic V8 security patches and additional sandboxing layers. With helper libraries like @cloudflare/codemode and @cloudflare/worker-bundler, developers can efficiently run model-generated code against AI tools, bundle modules, and manage virtual filesystems. Applications range from custom automation creation to AI-generated app platforms, with pricing set at $0.002 per unique Worker loaded per day, though waived during the beta period.