cloudflare

Bringing more agent harnesses to Cloudflare, starting with Flue (opens in new tab)

Cloudflare argues that production AI agents need more than an agent harness: they require platform primitives for durable state, execution, storage, and secure compute. It presents a three-layer stack—framework, harness, and runtime—and introduces Flue as the first framework built on the Cloudflare Agents SDK. Flue uses a declarative approach based on Pi, while Cloudflare supplies the infrastructure needed to resume interrupted work and run agents reliably at scale.

The Three-Layer Agent Stack

  • Framework — Flue
    • Provides project structure, conventions, integrations, CLI commands, and developer experience.
  • Harness — Pi or Project Think
    • Runs the agentic loop: calls tools, processes results, manages context, and continues until a task is complete.
  • Runtime/platform — Cloudflare Agents SDK
    • Supplies compute, state, storage, durable execution, sandboxing, and workflow primitives.
  • Cloudflare’s goal is to make these runtime capabilities available to any harness or framework.

Flue’s Declarative Agent Model

  • Flue 1.0 Beta is built on the Pi harness, which also powers OpenClaw.
  • Developers describe what an agent knows rather than explicitly scripting its orchestration.
  • An agent is defined through its:
    • Model
    • Skills
    • Sandbox
    • Instructions
  • This allows relatively compact agents to autonomously handle tasks such as reproducing and diagnosing bug reports.

Flue’s Developer Experience

  • Integrated channels
    • Preconfigured integrations let agents work in Slack, GitHub, Linear, and Discord.
    • Channels handle event verification and dispatch boilerplate.
  • Headless and UI-ready operation
    • Agents can run as background processes.
    • @flue/react provides hooks for streaming agent state, tool execution, and messages into frontend applications.
  • Ecosystem integrations
    • Commands such as flue add channel slack generate Markdown blueprints that coding agents can modify and integrate into a project.

Durable Execution with Durable Streams

  • Production agents face host crashes, LLM API timeouts, restarts, and interrupted tool calls.
  • Flue records prompts, tool responses, model decisions, and other execution events in an append-only log.
  • This durable event history prevents in-memory state from being lost.
  • If a process fails, another process can replay the log and resume from the exact point of interruption.

Deployment Across Clouds

  • On Node.js, Flue agents run as long-lived processes on VMs, containers, GitHub Actions, or existing servers.
  • On Cloudflare, each agent runs in its own Durable Object.
  • This provides:
    • Isolated storage and compute
    • Automatic scaling
    • No need to provision servers or manage sticky sessions
    • Protection from noisy neighbors
  • Cloudflare deployments use Agents SDK features including runFiber(), stash(), and onFiberRecovered() for durable execution.
  • Sandboxed code execution uses @cloudflare/codemode and @cloudflare/shell with a durable workspace.

Requirements for Production Agent Harnesses

  • An agent turn is a multi-step process that may involve token streaming, tool calls, human approval, or delegated subagents.
  • These operations can last seconds or minutes and may fail at any point.
  • Persisting only conversation history is insufficient because it does not preserve active execution state, pending tool calls, or the agent’s current position.
  • Cloudflare’s fiber-based primitives provide checkpointing so interrupted agent turns can recover instead of leaving users with stalled requests.

Cloudflare’s recommendation is to treat the framework, harness, and runtime as separate but coordinated layers. Frameworks like Flue make agents easy to build, while the Agents SDK supplies the durable execution and infrastructure primitives required to operate them reliably in production.