Durable Objects give AI agents a persistent, addressable compute unit that supports background work, hibernation, streaming, and synchronization.
2
Dynamic Workers run generated JavaScript in isolated workers with no ambient access, while the application grants specific capabilities such as restricted fetch permissions.
3
Cloudflare's Agents SDK is designed to remove userland distributed-systems work from features such as resumable streaming, multi-tab synchronization, scheduling, and persistent agent sessions.
Summary
Sunil Pai and Matt Carey explain why Cloudflare uses Durable Objects as the foundation for AI agents. A Durable Object gives each identifier a persistent location where requests, WebSocket connections, background tasks, and agent state can meet. The Agents SDK builds on that model with scheduling, client hooks, tool calls, resumable streaming, and synchronization across tabs and browsers. The talk then introduces Dynamic Workers, which run a string of generated JavaScript in an isolate with no default access to fetch, APIs, or environment variables. The caller grants only the capabilities the code needs. Pai describes this as a way to revisit the use of eval after decades of avoiding it. They connect the model to generated interfaces, MCP servers, agent extensions, and a planned coding-agent harness that can be reached from terminals, phones, chats, and web apps. They are candid that some pieces are still new, while other storage and shell functionality is already usable.
Durable Objects keep state where serverless functions normally lose it
A normal request function that increments a counter loses the value when its isolate disappears, so the counter returns to zero unless the application adds a database. Pai describes Durable Objects as a class tied to a given ID. It starts once, and later requests and WebSocket connections return to the same place. Cloudflare calls this "stateful serverless": it scales across the network while retaining state. The model avoids putting every piece of coordination into a separate database and lets an agent have a stable address.
Durable Objects fit agents because they can persist and work between requests
Pai says Durable Objects have the properties an agent needs: they are addressable, persistent, able to run long-lived work, able to run in the background when no request is active, and able to hibernate. He gives a latency example from London of about 15 milliseconds, compared with a little over 16 milliseconds for one frame at 60 FPS. In his example, a shared drawing surface built on this technology stays in sync across several phones. That same compute model became Cloudflare's original bet for agents.
The Agents SDK packages agent coordination instead of leaving it to application code
The Agents SDK extends an agent class and lets developers schedule work, define callables, connect clients, and run background tasks. Pai gives a deliberately comic example of a Friday-night job that reads a Git history, wiki, and Notion content before sending a summary to a manager. The SDK also provides React hooks and plain JavaScript clients. Cloudflare added support around the AI SDK for production concerns such as tool calls, synchronization, and resumability. The underlying Durable Object supplies the persistent place where those operations can continue.
Durable Objects make stateful MCP connections easier to deploy
When MCP became popular, its original design required a stateful connection between client and server. Pai says that connection was awkward to deploy in a conventional cloud environment. Durable Objects already maintain a stateful connection, so Cloudflare used them for early MCP servers. The speakers name integrations including PayPal, Sentry, Linear, and Intercom, while noting that some customers cannot be named. This experience led them toward code mode, where a client can generate code that calls a broader set of tools instead of relying on a large collection of individually described endpoints.
Dynamic Workers run generated code inside an isolate with explicit capabilities
Dynamic Workers let one Worker take a string of code from a customer, user, or LLM and run it in its own isolated Worker. Pai distinguishes this from a full VM: the isolate does not have the weight of a complete file system or virtual machine, and Cloudflare says billions can be started on demand. The sandbox begins with JavaScript and no ambient access. It cannot fetch, use APIs, or read environment variables unless the outside application grants those capabilities. Permissions can be limited to a specific destination such as github.com or even a narrower path.
Generated code can replace restrictive intermediate formats
Carey uses generative UI as an example of where the new primitive changes an application design. Many systems generate JSON and then render it because their platform cannot safely render untrusted code. With a sandbox that can execute generated code, an agent could generate HTML or React and render it in the cloud. Carey compares this idea with Cloud Artifacts, where HTML is rendered in the browser, and says the security concern becomes sharper when rendering happens on a server. Dynamic Workers give developers another option besides building a domain-specific language or translating form-generated JSON into code.
Resumable streams and multi-client sync come from the persistent agent location
Pai describes a long story generated by an LLM while a user refreshes the page. In a conventional serverless setup, continuing the stream may require a database, replication, and sticky sessions. With a Durable Object and the Agents SDK, the client reconnects to the same object. If a stream is active, it receives the earlier part and then continues receiving bytes. The same arrangement gives synchronization across multiple tabs, browsers, phones, and laptops. Pai argues that applications can get these behaviors without implementing distributed-systems machinery in userland.
Cloudflare is building a persistent coding-agent harness on Workers
The speakers describe an agent loop for Cloud Code that would run in the Agents SDK. Because the server is persistent, clients could connect from a terminal, chat, phone, iOS application, or web application, with state and streams synchronized between them. Carey says Cloudflare is building this harness and hopes to ship it soon. Their broader design lets Workers run stateful agents, generate and execute code quickly, and delegate work to containers, browsers, or other sandbox products when needed. The Agents SDK is intended to connect those execution environments rather than require every workload to use only Cloudflare's own tools.
"In the durable objects world in the agents SDK world, you just reconnect to it and if there's a stream going on, it just says well, here's the beginning of the stream and I'm just going to continue giving you bytes."13:52
Who should watch
You are building an AI agent and are deciding whether state, streaming, scheduling, and client synchronization should live in separate infrastructure.
Your product lets users or LLMs generate code, plugins, UI, or extensions, and you need a sandbox with narrowly granted permissions.
You are deploying MCP servers or coding agents and want persistent sessions that can be reached from several kinds of clients.