Cloudflare — Bringing more agent harnesses and frameworks to Cloudflare¶
Summary¶
Cloudflare engineering post (2026-06-17) articulating the three-layer agent platform stack — framework → harness → runtime/platform — and demonstrating how the Agents SDK provides the runtime primitives that any harness or framework can build on. The post announces Flue (1.0 Beta), an open-source declarative agent framework built by the Astro team on the Pi harness, as the first third-party framework targeting the Agents SDK. The architectural contribution is the systematic decomposition of what production agent platforms need: durable execution (fibers), sandboxed code execution (Code Mode / Dynamic Workers), a durable virtual filesystem (@cloudflare/shell), dynamic workflows, and binding-based capability access — all without exposing credentials to agent-generated code.
Key takeaways¶
-
Three-layer agent platform stack emerges. Framework (Flue) → Harness (Pi, Project Think) → Runtime/Platform (Agents SDK). The framework owns DX and conventions; the harness owns the agentic loop, tool calling, and context management; the runtime owns compute, state, and storage primitives. (Source: article body, architecture diagram.)
-
Durable Streams: append-only event log for agent state recovery. Flue solves mid-turn crash recovery via "Durable Streams" — every prompt, tool response, and model choice is appended to an immutable ledger. On process death, a new instance replays the log from the exact interrupted step. This is the patterns/append-only-event-log-for-agent-state pattern applied to LLM agent turns. (Source: "Designed for production" section.)
-
Fibers as the runtime-level durable execution primitive.
runFiber()records progress to the Durable Object's SQLite storage;stash()checkpoints mid-turn;onFiberRecovered()delivers the last checkpoint on restart. The harness decides recovery strategy — full reconstruction (Project Think) or selective replay. Sub-10ms overhead per checkpoint. (Source: code sample + Flue GitHub link.) -
Code Mode: V8 isolate sandbox at $0.002/load, <10ms cold start. Rather than a growing tool list, the model writes TypeScript that calls APIs;
@cloudflare/codemodewraps Dynamic Workers to execute each snippet in a fresh isolate with only granted bindings. Drastically cheaper than booting a container per tool call. (Source: Code Mode section, cost + latency numbers.) -
@cloudflare/shell: virtual filesystem inside a Durable Object. SQLite-backed typed file operations (read, write, edit, search, grep, diff) inside the DO, avoiding full-container overhead for text-heavy agent workflows (review agents, code search, patch writing). For agents needing a full OS,@cloudflare/workspacekeeps the virtual FS in sync with a Cloudflare Container. (Source: workspace section.) -
Dynamic Workflows for agent-generated multi-step pipelines.
@cloudflare/dynamic-workflowslets the agent generate a workflow at runtime; the Workflows engine persists each step, retries failures, sleeps for hours, or waits for external events (human approval). The agent can go to sleep while the workflow executes, waking on completion via RPC callback. (Source: Dynamic Workflows section.) -
Bindings as capability-based access without credential exposure. The Agent class accesses Cloudflare services (AI Gateway, Browser Run, Email Service, Agent Memory, AI Search, Containers, inference across 14+ model providers) through bindings — the agent uses capabilities but keys never enter agent-generated code. (Source: "Direct access to the Cloudflare ecosystem" section.)
-
Flue's declarative model: describe what the agent knows, not what it does. No orchestration loop to write; define model, skills, sandbox, and instructions — the agent solves tasks autonomously. A triage agent (reproduce bug + diagnose) fits in ~25 lines of declarative config. (Source: Flue introduction section.)
-
Each Flue agent becomes a Durable Object on Cloudflare target. Per-agent isolated storage and compute; no server provisioning, sticky sessions, or noisy-neighbour concerns. On Node.js target, agents are long-lived processes deployable to any VM/container. (Source: "Deploy anywhere" section.)
Operational numbers¶
| Metric | Value |
|---|---|
| Code Mode isolate cold start | <10 ms |
| Code Mode cost per execution | $0.002/load |
| Flue declarative triage agent | ~25 lines |
| Model providers via unified inference | 14+ |
Systems extracted¶
- systems/flue — open-source declarative agent framework (Astro team), 1.0 Beta
- systems/pi-harness — the agentic-loop harness underneath Flue and OpenClaw
- systems/cloudflare-shell —
@cloudflare/shell, SQLite-backed virtual filesystem in DO - systems/cloudflare-workspace —
@cloudflare/workspace, DO-to-container FS sync - systems/cloudflare-agents-sdk — extended with fibers, shell, workspace, dynamic workflows
- systems/project-think — Cloudflare's first-party harness, battle-tested source of SDK primitives
- systems/code-mode —
@cloudflare/codemode, Dynamic Worker isolate sandbox - systems/cloudflare-dynamic-workflows —
@cloudflare/dynamic-workflows, agent-generated durable pipelines
Concepts extracted¶
- concepts/durable-execution — extended: fibers as agent-turn-scoped checkpointing
- concepts/durable-streams — append-only immutable event log for agent execution history
- concepts/three-layer-agent-platform-stack — framework → harness → runtime decomposition
- concepts/virtual-filesystem-over-sqlite — typed file ops in DO SQLite, avoiding container boot
- concepts/declarative-agent-definition — describe-what-it-knows vs script-what-it-does
- concepts/isolate-cold-start-cost — <10ms, $0.002 vs container boot cost
Patterns extracted¶
- patterns/append-only-event-log-for-agent-state — Durable Streams immutable ledger for crash recovery
- patterns/framework-harness-runtime-layering — separation of concerns in agent platform stacks
- patterns/code-generation-over-tool-calls — write code instead of selecting from N tools (Code Mode)
- patterns/virtual-filesystem-over-container — SQLite FS for text ops, container only when needed
Source¶
- Original: https://blog.cloudflare.com/agents-platform-flue-sdk/
- Raw markdown:
raw/cloudflare/2026-06-17-bringing-more-agent-harnesses-and-frameworks-to-cloudflare-s-0d906529.md