
Most AI agents in production today are running on borrowed time. They live inside a long-lived process — a container, a VM, a Python worker — and that process is billed by the second whether the agent is thinking or waiting. Worse, when the process dies mid-run, the agent's twelve-step research task dies with it.
Cloudflare's answer, announced as Project Think on April 15, 2026 and expanded through Agents Week, is to stop treating agents as applications and start treating them as infrastructure. The pitch: agents that survive failures, cost nothing when idle, and enforce security through architecture rather than good behavior.
This is a meaningful shift, and it is worth understanding what is actually new versus what is repackaging.
The problem with the process model
The cloud we have was designed around a simple assumption: one application serves many users. A web server handles thousands of concurrent requests because each request is short, stateless, and interchangeable.
Agents break every part of that assumption.
An agent session is long — a single LLM call takes roughly 30 seconds, and a multi-turn agentic loop can run for hours. It is stateful — the agent accumulates memory, tool results, and conversation history that cannot be reconstructed from the next request. And it is per-user — each knowledge worker running three or four agents means infrastructure must accommodate tens of millions of simultaneous sessions rather than tens of millions of sequential requests.
The naive fix is one container per agent. That is also the expensive fix. If you have 10,000 agents and each is genuinely active 1% of the time, you are paying for 10,000 always-on containers to do the work of 100.
Fibers: durable execution as a language primitive
The central technical idea in Project Think is the fiber — a durable invocation that checkpoints its own progress into a co-located SQLite database.
A standard serverless function call is atomic and disposable: it either completes or it never happened. A fiber is neither. It runs, it records where it got to, and if the platform restarts underneath it, it resumes from the last checkpoint rather than from the beginning.
async startResearch(topic: string) {
void this.runFiber("research", async (ctx) => {
const findings = [];
for (let i = 0; i < 10; i++) {
const result = await this.callLLM(`Research step ${i}: ${topic}`);
findings.push(result);
ctx.stash({ findings, step: i, topic });
this.broadcast({ type: "progress", step: i });
}
return { findings };
});
}The ctx.stash() call is the whole trick. Each iteration writes the accumulated state to SQLite before moving on. If the worker is evicted at step seven, an onFiberRecovered hook rehydrates the agent and the loop continues from step seven — not step zero, and not from a re-run of seven expensive LLM calls.
If you have used Temporal or Inngest, this will feel familiar, and that is the point. What is different is where it lives. Temporal gives you durable execution as a service you call out to. Project Think gives you durable execution as a method on the class your agent already extends, with the checkpoint store sitting in the same isolate as the agent's memory. We covered the standalone orchestrators in durable execution for AI agents; Project Think is the same idea collapsed into the runtime.
Hibernation and the economics of idle
Every Think agent is a Durable Object — Cloudflare's actor primitive, where each instance has a stable identity, its own SQLite database, and the ability to wake on an incoming message.
The consequence is that an agent waiting for a webhook, a human approval, or a scheduled tick is not running. It is hibernating: its state persists, its address stays valid, and it consumes no compute. Cloudflare's own framing of the math is that 10,000 agents each active 1% of the time need roughly 100 active instances, not 10,000.
For anyone who has watched a bill for idle agent containers, this is the number that matters more than any benchmark. It converts agent hosting from a capacity-planning problem into a usage-billing problem.
Sub-agents with real isolation
Multi-agent systems usually decompose into a supervisor and some workers. The typical implementation shares one process and one memory space, which means the "isolation" between agents is a naming convention.
Project Think uses Durable Object Facets so each child agent is a genuinely separate Durable Object with its own SQLite database, addressed over typed RPC that TypeScript checks at compile time.
const researcher = await this.subAgent(ResearchAgent, "research");
const reviewer = await this.subAgent(ReviewAgent, "review");
const [research, review] = await Promise.all([
researcher.search(task),
reviewer.analyze(task)
]);Two things follow. First, a sub-agent cannot accidentally read its sibling's state, because there is no shared store to read from — a real answer to the context-bleed failures we discussed in long-horizon agent coherence. Second, the RPC surface is a typed interface, so a sub-agent's contract is enforced by the compiler rather than by prompt discipline.
The execution ladder
Agents that write and run their own code are the most useful and the most dangerous. Project Think structures this as a five-tier execution ladder, from Tier 0 (Workspace — plain filesystem operations) up through Tier 1 (Dynamic Workers — fresh V8 isolates) to Tier 4 (Sandboxes — full OS access with shell and background processes).
The security model is worth naming precisely, because it inverts the usual one. Dynamic Workers start with no ambient authority and receive capabilities only through explicit bindings. You are not locking down a general-purpose machine; you are handing a locked box exactly the keys it needs.
Dynamic Workers boot in milliseconds — roughly 100x faster than a container — which is what makes it practical for an agent to generate a tool, run it, and throw it away inside a single turn. Agents can even author their own TypeScript extensions that persist across hibernation. That is a different security posture from the container-based approach in self-hosted agent sandboxes, and it trades some flexibility for a much smaller blast radius.
Sessions, memory, and the token budget
Conversations in Think are stored as trees, not lists. Messages carry parent references, which means you can fork a conversation to try a different direction without destroying the original branch.
Memory is declared rather than manually pruned:
configureSession(session: Session) {
return session
.withContext("memory", {
description: "Important facts learned during conversation.",
maxTokens: 2000
})
.withCachedPrompt();
}The maxTokens budget is the important detail. Context blocks are compacted to fit, and sessions support FTS5 full-text search so an agent can retrieve an old fact without carrying the entire transcript in its prompt. This is the same architecture we recommended in persistent agent memory, now provided by the runtime instead of assembled by hand.
Getting started
The minimum viable Think agent is genuinely small. Install the packages:
npm install @cloudflare/think @cloudflare/ai-chat agents ai @cloudflare/shell zod workers-ai-providerExtend the base class and supply a model. That is the only required method — Think handles the WebSocket chat protocol, message persistence, the agentic loop, message sanitization, stream resumption, and workspace file tools:
import { Think } from "@cloudflare/think";
import { createWorkersAI } from "workers-ai-provider";
export class MyAgent extends Think<Env> {
getModel() {
return createWorkersAI({ binding: this.env.AI })(
"@cf/moonshotai/kimi-k2.6",
);
}
}Then wire the Durable Object binding and the SQLite migration in wrangler.jsonc:
{
"compatibility_date": "2026-07-10",
"compatibility_flags": ["nodejs_compat"],
"ai": { "binding": "AI" },
"durable_objects": {
"bindings": [
{ "class_name": "MyAgent", "name": "MyAgent" }
]
},
"migrations": [
{ "new_sqlite_classes": ["MyAgent"], "tag": "v1" }
]
}Turns are admitted through runTurn() in one of three modes. Use "wait" when the caller blocks on a result, "submit" for durable fire-and-forget work with an idempotency key, and "stream" when you want events pushed to a callback:
const result = await this.runTurn({ input: "Your prompt" });
const submission = await this.runTurn({
mode: "submit",
input: "Process webhook",
idempotencyKey: eventId
});The "submit" mode with an idempotency key is the one to reach for when an agent is triggered by a webhook. A retried delivery will not start a second turn.
Where Think sits in the stack
On June 17, 2026, Cloudflare published a follow-up that clarified the layering, and it is the clearest statement of strategy so far. The platform is now explicitly three layers:
The Agents SDK is the runtime — compute, state, storage, and the fiber primitives. A harness sits above it and runs the agentic loop, managing tools and context; Project Think is Cloudflare's own opinionated harness, and Pi is another. A framework sits on top for developer experience and integrations; the first third-party one is Flue, an open-source framework from the team behind Astro that ships Slack, GitHub, Linear, and Discord integrations plus React hooks via @flue/react.
That structure matters because it means Cloudflare is not betting solely on developers adopting Think. It is opening the durable primitives underneath to any harness, which is a considerably better position than a single framework competing with LangGraph and the Claude Agent SDK on ergonomics alone.
Honest limitations
Project Think is in experimental preview. The API surface will move, and building a production system on preview primitives is a decision, not a default.
The lock-in is also real and should be priced in. Fibers, Facets, and Dynamic Workers are Cloudflare-specific in a way that a LangGraph or Pydantic AI application is not. There is no meaningful portability story here — you are choosing an architecture, and the exit cost is a rewrite.
Finally, the actor model rewards a particular shape of problem. Agents that are long-lived, mostly idle, per-user, and stateful map beautifully onto Durable Objects. A short, stateless, high-throughput classification pipeline does not, and would be better served by a plain Worker or a batch job.
The takeaway
The interesting claim inside Project Think is not any single primitive. Durable execution exists elsewhere. Sandboxing exists elsewhere. Persistent memory exists elsewhere.
The claim is that these should be runtime guarantees rather than libraries you assemble. When crash recovery is a method call, isolation is a storage boundary, and idle cost is zero by construction, a whole category of agent engineering — the retry wrappers, the checkpoint tables, the container autoscaling — stops being your problem.
Whether Cloudflare can hold that position as the frameworks above it consolidate is the open question. But the direction is right, and it is the clearest articulation yet of what "agents as infrastructure" is supposed to mean.
Building agents for production? Noqta helps MENA teams design, deploy, and govern AI agent infrastructure that survives contact with real users. Talk to our team.
Sources
- Project Think: building the next generation of AI agents on Cloudflare — Cloudflare Blog, April 15, 2026
- Building the agentic cloud: everything we launched during Agents Week 2026 — Cloudflare Blog
- Bringing more agent harnesses and frameworks to Cloudflare, starting with Flue — Cloudflare Blog, June 17, 2026
- Think harness documentation — Cloudflare Developers
- Cloudflare Introduces Project Think: a Durable Runtime for AI Agents — InfoQ