Cloudflare、エージェントハッチスとフレームワークの拡充へ、まずは「Flue」から
Cloudflare は、生産環境での AI エージェント構築を支援する新しい 3 レイヤー・スタックを発表し、基盤となる SDK と、その上に構築された宣言型フレームワーク「Flue」のベータ版リリースを同時に発表した。
キーポイント
生産環境向け AI エージェントの課題と解決
エージェントが中断時の復元や不審なコードの実行、コンテキスト管理など直面する分散システム上の課題に対し、Cloudflare は「Project Think」での知見を基盤として SDK に実装し、プラットフォーム層で解決を図っている。
AI エージェント構築の 3 レイヤー・スタックの確立
開発者体験(フレームワーク)、エージェントループ(ハネス)、計算・状態管理(ランタイム/SDK)という 3 つの層を明確に定義し、各層が独立して機能しながら連携する標準的なアーキテクチャを提案した。
宣言型アプローチを採用した新フレームワーク「Flue」
Astro チームが開発したオープンソースの「Flue」は、エージェントの動作をスクリプトで記述するのではなく、モデルやスキルなどの文脈を宣言的に定義することで、オーケストレーションループを書かずに自律的なタスク実行を可能にする。
Cloudflare Agents SDK の基盤機能提供
永続的な実行(durable execution)、動的コード実行、永続ファイルシステムなどの機能を SDK として公開し、あらゆるハネスやフレームワークがこれらの強力なプラットフォームプリミティブを利用できるようにした。
統合された開発体験
Slack や GitHub などの既存ツールにエージェントを直接配置でき、@flue/react を使用すればリアルタイムの UI 連携も容易に行えます。
Durable Streams による堅牢性
実行履歴を不変のログとして記録する Durable Streams により、システム障害発生時も状態を保持して正確な位置から再開できます。
Cloudflare での自動スケーリング
Cloudflare 上で各エージェントが独立した Durable Object として動作するため、サーバー管理不要で自動的にスケールし、隔離された環境を提供します。
影響分析・編集コメントを表示
影響分析
この発表は、AI エージェント開発が単なるプロトタイプ段階から、堅牢なインフラとして運用される段階へと移行する転換点を示しています。特に、複雑な状態管理や実行環境の課題をクラウドプラットフォーム側で解決し、開発者は「何をさせるか」に集中できる宣言型アプローチを標準化することで、AI エージェントの実装コストとリスクを大幅に低下させると予想されます。
編集コメント
Cloudflare が AI エージェント開発の「OS」としての役割を明確にし、Flue の宣言型アプローチによって開発体験を劇的に改善する可能性を示した画期的な記事です。
2026 年は、エージェント・ハーネスが生産環境へ移行する年となる。モデルの外部世界へのアクセスを制御するソフトウェア——Codex、Claude Code、OpenCode、Pi、Project Think といったハーネス——は成熟し、チームがエージェントを実際の負荷を支えるインフラストラクチャとして、単なるプロトタイプではなく本格的に展開できる段階に至っている。
しかし、生産環境で生き残るエージェントを構築するのは容易ではない。
これは、私たちがファーストパーティのエージェント・ハーネスである Project Think を構築する過程で身をもって学んだことだ。顧客と協力して生産環境でエージェントを実行する中で、クラウド上で動作する際にすべてのエージェントが直面する共通の分散システム上の課題を発見した。エージェントが中断された場合、コンテキストを失わずトークンを無駄にすることなく、どこからでも自動的にかつ優雅に再開するにはどうすればよいか?不審なコードを安全に実行させるにはどうすればよいか?トレーニングで用いたツールを利用できるようにするにはどうすればよいか?
ハーネス単体ではこれらの課題を解決できない。これらは状態(state)、ストレージ、計算リソースと密接に関連しており、つまりエージェントが動作するプラットフォームに依存している。そこで私たちは、Project Think を生産環境向けに堅牢化する過程で得た知見を Cloudflare Agents SDK の基盤層として提供することにした。永続的な実行(durable execution)、動的コード実行、永続ファイルシステム、そして動的ワークフロー——これらはすべて、Agents SDK をベースに構築されるあらゆるハーネスで利用可能となった。
⟦CODE_0⟧
同時に、ハーンサーの上層に新たなレイヤーが出現しました。Flue などのフレームワークは、エージェントを効率的に構築するためのプロジェクト構造、規約、統合、そして開発者体験を備えたハーンサーを包み込むことで機能します。
これらのスケーリング課題に対処するため、本格的な AI を構築するための新たな 3 レイヤー構成が出現しています。ユーザー facing の開発者体験から下位のプラットフォーム基盤へと至るまでの各要素の連携は以下の通りです:
フレームワーク(Flue)— エージェントを構築するためのプロジェクト構造、規約、統合、CLI、および開発者体験。
ハーンサー(Pi, Project Think)— ツールを呼び出し、結果を読み取り、コンテキストを管理し、タスクが完了するまで継続するエージェントループ。
ランタイム/プラットフォーム(Cloudflare Agents SDK)— 上記すべてが依存する計算、状態、ストレージの基盤プリミティブ。
Agents SDK はその最下層レイヤーであり、永続実行などのプリミティブをあらゆるハーンサーおよびフレームワークに提供します。Astro のチームが開発した新しいオープンソースフレームワークである Flue が、これをベースに構築された最初の例となります。以下にその仕組みを示します。
Flue
Flue は今週、1.0 ベータ版をリリースしました。これは OpenClaw が構築されているのと同じ Pi ハーネス(harness)の上に作られています。エージェントフレームワークとしての違いはアプローチにあります:エージェントが何をするかをスクリプト化するのではなく、何がわかるかを記述するのです。エージェントが必要とするコンテキスト——モデル、スキル、サンドボックス、そして指示——を定義すれば、与えられたタスクを自律的に解決します。オーケストレーションループ(orchestration loop)を書く必要はありません。
この宣言型モデルが、エージェントの作成を容易にする理由です。以下は、バグレポートをインターセプトし、サンドボックス内で再現して 25 行未満で問題診断を行うトライアージエージェントの例です。

Flue の開発者体験
Flue の強みは、エージェントが孤立して存在しないという事実にあります。彼らはユーザーがすでに作業している場所に存在し、好みのツールチェーンと統合するように設計されています。
どこでも動作するエージェント:Slack、GitHub、Linear、Discord にエージェントを配置できます。イベント検証やディスパッチのボイラープレート(boilerplate)を自動的に処理する事前設定済みのチャンネルを使用可能です。
ヘッドレスだが UI 対応済み:エージェントはブラックボックスの中に住むべきではありません。Flue エージェントはバックグラウンドタスクのために完全にヘッドレスで実行できますが、@flue/react はネイティブのフロントエンドフックを提供し、カスタムのリアルタイム基盤をゼロから構築する必要なく、エージェントの状態、ツール実行、ライブメッセージを直接フロントエンドアプリケーションにストリーミングします。
エコシステム対応済み:Flue を使えば、「flue add channel slack」のようなコマンドで統合を追加・アップグレードするのが容易になり、Markdown の青写真が生成されます。これにより、あなたのコーディングエージェントが読み取り、修正し、コードベースにきれいに直接統合することが可能になります。
単なるプロトタイプのためではなく、本番環境向けに設計されています
エージェントをローカルターミナルから本番エコシステムへ移行すると、従来の分散システムの障害が発生します。ホストのクラッシュ、LLM プロバイダーからの API タイムアウト、予期せぬ再起動は、実行中のエージェントのターンにおける短期記憶を消去する恐れがあります。
Flue は Durable Streams(永続ストリーム)によってこれを解決します。実行履歴の各イベントは、追加専用ログに追加されます。すべてのプロンプト、ツール応答、モデル選択を不変の台帳として処理することで、エージェントの状態は決して不安定になりません。プロセスが終了しても、別のプロセスがそのログを引き継ぎ、中断した正確なステップから継続します。
Cloudflare を含むあらゆる場所にデプロイ可能
Flue はマルチクラウドフレームワークです。Node.js では、各エージェントは長期間実行されるプロセスとして動作します。任意の VM やコンテナにデプロイしたり、GitHub Actions で実行したり、既存のサーバーに埋め込んだりできます。しかし、Cloudflare をターゲットとする場合、各エージェントは Durable Object になります。
Flue エージェントをそれぞれの Durable Object 内で実行することで、Cloudflare は必要な数のエージェントまで自動的にスケールし、それぞれが独立したストレージと計算リソースを持つことができます。サーバーのプロビジョニングやスティッキーセッションの管理、ノイジーネイバーへの懸念は不要です。また、Flue エージェントを Cloudflare にデプロイすると、Agents SDK の runFiber()、stash()、onFiberRecovered() メソッドを使用して永続的な実行が可能になります。さらに、Flue は @cloudflare/codemode と @cloudflare/shell を使用して、永続的なワークスペースに対してサンドボックス化されたコード実行を行います。
エージェントプラットフォームからハッチが必要とするもの
Flue の Cloudflare ターゲットがこれほど効果的に機能するのは、Agents SDK に組み込まれた中核的なプリミティブに明確に対応しているからです。Flue ソースコードを詳しく見て、基盤となるハッチである Pi がどのように Cloudflare Agents SDK で動作するように適応されているかを理解することもできます。
ここでは、Flue が内部でどのように Agents SDK を活用し、現代のエージェントハッチを大規模かつ確実に実行するために何が必要かが説明されます。
すべてのエージェントハッチは永続的な実行を必要とします
エージェントのターンは単一のリクエストではありません。モデルはトークンをストリーミングし、ツールを呼び出し、結果を待ち、人間からの承認を求めるか、あるいはサブエージェントに作業を委譲します。この一連の流れには数秒から数分がかかることもあり、その過程でプロセスが中断されたりクラッシュしたりする可能性があります。そのような事態が発生すると、メモリ上に存在していたすべてのエージェント状態が失われます:ストリーミング接続、保留中のツール呼び出し、そしてそのターンにおけるエージェントの位置です。もちろん会話履歴はディスクに永続化されていますが、ユーザーには解決しないスピナーが表示されることになります。これは壊れたユーザー体験です。
Fibers は、ネイティブのチェックポイント機構をエージェントの基盤となる Durable Object の内部に直接提供することでこの問題を解決します。runFiber() は、エージェントのターン内の作業が始まる前に進捗を Durable Object の SQLite ストレージに記録し、stash() を用いてターンが進行するたびにチェックポイントを保存します。中断後に新しいエージェントインスタンスが起動すると、onFiberRecovered() が最後のチェックポイントを受け渡すため、あなたのエージェントはターンが中断されたこと、どこまで到達したかを知り、どのように継続するかを判断できます。
import { Agent } from "agents";
import type { FiberRecoveryContext } from "agents";
class MyAgent extends Agent {
async doWork() {
await this.runFiber("my-task", async (ctx) => {
const step1 = await expensiveOperation();
ctx.stash({ step1 });
const step2 = await anotherExpensiveOperation(step1);
this.setState({ ...this.state, result: step2 });
});
}
}
async onFiberRecovered(ctx: FiberRecoveryContext) {
if (ctx.name !== "my-task") return;
const { step1 } = (ctx.snapshot ?? {}) as { step1?: unknown };
if (step1) {
const step2 = await anotherExpensiveOperation(step1);
this.setState({ ...this.state, result: step2 });
}
}
}
Flue は、まさにこのために Cloudflare ターゲット上で runFiber() を使用します。onFiberRecovered() フックにより、ハルネスはターン実行の再開方法を決定できます。具体的には、Project Think のような完全な再構築モデルでターンの状態を修復する試みを行うか、あるいはターンの特定の部分を再生するかを選択します。
エージェントにツールを過剰に負荷させるよりもコードを実行する方が優れています
Agent ハルネスは、ツールを通じてモデルが外部世界にアクセスできるようにします。しかし、ツールの表面(インターフェース)は急速に拡大し、リストが長くなり、コンテキストウィンドウがツールの定義で埋まるとともに、モデルは適切なツールを選択する能力が低下します。より良いパターンは、コードを実行するための 1 つのツールをモデルに与えることです。モデルは必要な API を呼び出す TypeScript 関数を書き、ハルネスがそれを実行します。私たちは Code Mode(コードモード)を導入した際にこの点について言及しました。
問題は、そのコードがどこで実行されるかです。LLM が生成したコードを安全に実行するにはサンドボックスが必要です。しかし、一般的なサンドボックスでは、各ツール呼び出しを実行する際に遅く、コストが高額になり、非効率的になります。そこで、Agents SDK は@cloudflare/codemode を提供しており、これは Dynamic Workers をラップして、LLM が生成したコードを、あなたが提供するバインディングのみを持つ独自の Worker イソレート内で実行できるようにします。

Code Mode は、各スニペットに対して新しい Dynamic Worker を作成し、実行した後に破棄します。イソレートの起動は 10 ミリ秒未満で完了し、ロードあたり 0.002 ドルというコストで、エージェントが短いコードを実行するたびにコンテナを起動する場合と比較して、劇的に高速かつ低コストな実行を実現します。Flue は、その Cloudflare ターゲット上で@cloudflare/codemode を使用してコードツールを機能させています。エージェントはワークスペースに対して JavaScript を記述し、Code Mode で実行します。
ほとんどのワークスペースタスクには完全なコンテナは不要です
Agent ハーネスでは、ファイルの読み込み、出力の書き込み、コードの検索や差分の理解など、ファイルシステムが必要になることがよくあります。特にコーディングエージェントはファイルシステム上で動作します。しかし、ハーネスがサーバーレス環境で実行されている場合、どのようにして実行を跨いで永続する耐久性のあるファイルシステムを取得できるのでしょうか?
一般的な答えはコンテナです。これは機能しますが、エージェントが主に実行する作業に対してはコストがかかります。エージェントのターンにおけるファイルシステムの操作の大部分はテキスト処理です。例えば、ファイルを読み込み、ソースコードを grep 検索したり、パッチを書いたりするレビュー用エージェントを考えてみてください。それには完全な Linux の起動は必要ありません。
@cloudflare/shell は、Durable Object 内に永続的な仮想ファイルシステムを提供し、そのバックエンドとして SQLite を使用します。これは、エージェントハネスがツールとして利用可能な型付きのファイル操作(read, write, edit, search, grep, diff)を提供します。
個別のツールを呼び出すのではなく、Cloudflare ターゲット上で実行される Flue エージェントは、ワークスペース仮想ファイル状態 API に対して JavaScript を記述します。Durable Object 内でより多くの操作を実行することで、エージェントはアイソレートモデルのより効率的な実行プロセスの恩恵を受け、コンテナオーバーヘッドを完全に回避できます。
async () => {
const files = await state.glob("src/**/*.ts");
const results = [];
for (const file of files) {
const content = await state.readFile(file);
const todos = content.match(/\/\/ TODO:.*/g);
if (todos) results.push({ file, todos });
}
return results;
}
これは、シェルやファイルシステム操作を実行して作業を完了させる必要があるエージェントにとって、より高速でコスト効率の高いサンドボックス環境を実現します。また、npm install や git、コンパイラを実行するために完全な OS が必要となるエージェント向けには、Cloudflare Containers が提供されます。さらに、@cloudflare/workspace を構築中であり、特定の Durable Object の仮想ファイルシステムとコンテナのそれを同期させることで、軽量な Workers から Linux 環境へのシームレスな移行を、必要な場合にのみ可能にします。
ダイナミックワークフロー:エージェントが自らワークフローを記述してタスクを一貫して反復実行
しかし、エージェントがファイルの読み取りや単一のコードスニペットの実行を超えた作業を必要とする場合、あるいは時間を通じて一貫して反復される大規模な多段階パイプライン(例えば、バグを正常に解決するコードレビューや、良好な結果を生み出す研究ワークフローなど)をオーケストレーションする必要が生じた場合はどうなるでしょうか?ハーン単体では、永続的な多段階実行を提供することはできません。各ステップの永続化、失敗時の再試行、中断からの再開にはプラットフォーム側のサポートが必要です。
このパターンは注目を集めています。Claude Code は最近、動的ワークフローを実装しました。これは、Claude が実行時に JavaScript スクリプトを記述して数十人のサブエージェントに作業を引き渡し、ランタイムがそれを永続的に実行するものです。@cloudflare/dynamic-workflows は、Agents SDK 上で動作するあらゆるハッチ(harness)に対してこの機能を提供します。あなたのエージェントは実行時にワークフローを生成し、Workflows エンジンは各ステップを永続化し、失敗を再試行し、数時間の待機や人間の承認のような外部イベントの待ち受けも可能です。
Agent クラスから runWorkflow() を呼び出すと、エージェントが Workflows エンジンに接続されます。エージェントはワークフローを開始して待機状態に入ることができます。ワークフローは RPC を介してエージェントにコールバックし、進捗を報告したり状態を更新したり、承認を要求したりします。ワークフローが完了すると、エージェントは結果を持って起動します。
Cloudflare エコシステムへの直接アクセス
計算リソースやストレージだけでなく、エージェントハッチは外部機能へのアクセスも必要です:ウェブブラウジング、メール、メモリ、検索、推論など。各機能を個別に統合したり、それぞれに対して API キーを管理したり、エージェント生成コードを通じて認証情報が漏洩することを心配したりする必要はありません。
⟦CODE_0⟧
Agent クラスを使用すると、バインディングを通じて Cloudflare の他の機能にアクセスできます。具体的には、エージェントごとの支出追跡と制限管理のための AI Gateway、Web 自動化のための Browser Run、受信トレイワークフローのための Email Service、永続的な記憶保持のための Agent Memory、検索のための AI Search、フル OS が必要なワークロード向けの Containers、そして 14 以上のモデルプロバイダーにわたる推論機能です。バインディングは認証情報を公開することなく機能を付与します。エージェントがこれらを使用しますが、キーがエージェント生成コード内に直接入力されることはありません。

エージェントをアジェンティッククラウドへ持ち込もう
このアプローチが機能することは、私たちがファーストパーティのエージェントハネスである Project Think を構築する際に使用したのと同じアーキテクチャ基盤を採用していることから明らかです。Project Think は、ネイティブな Cloudflare エージェント体験のための非常に最適化された即戦力ソリューションとして引き続き提供されますが、Agents SDK により、より広範なオープンソースエコシステムも、Flue を含むこれらの実証済みの基本機能(プリミティブ)を活用できるようになります。
今日 Flue でエージェントを構築している場合、数回のクリックで Cloudflare へデプロイできます。また、独自のエージェントハネスやエージェントフレームワークを構築している場合は、Agents SDK をターゲットとし、プラットフォーム統合を無料で利用してください。
Agents SDK: developers.cloudflare.com/agents
Flue: flueframework.com, npm install @flue/runtime
Think: docs
Cloudflare Community: community.cloudflare.com
Cloudflare は、エージェントのハルネスとフレームワークをさらに強化し、まずは Flue から始めます。
原文を表示
2026 is the year agent harnesses go to production. The software that controls the model’s access to the outside world — harnesses like Codex, Claude Code, OpenCode, Pi, and Project Think — has matured to the point where teams are deploying agents as real, load-bearing infrastructure, not just prototypes.
But building agents that survive production is hard.
We learned this firsthand building Project Think as our first-party agent harness. In working with our customers to run agents in production, we found a common set of distributed systems problems that every agent faces when running in the cloud. When an agent is interrupted, how can it automatically and gracefully resume from where it left off, without losing context or wasting tokens? How can agents run untrusted code securely? How can agents use the tools they were trained for?
A harness can’t solve these problems on its own. They’re tied to state, storage and compute — which means they’re dependent on the platform the agent runs on. That’s why we’re taking our learnings from hardening Project Think for production and bringing them to the Cloudflare Agents SDK as a base layer. Durable execution, dynamic code execution, a durable filesystem and dynamic workflows, now available to any harness building on Agents SDK.
At the same time, a new layer has emerged above the harness. Frameworks like Flue wrap a harness with the project structures, conventions, integrations and developer experience that make agents productive to build.
To solve these scaling challenges, there’s a new, three-layer stack that is emerging for building production-grade AI. Here is how the pieces fit together, moving from the user-facing developer experience down to the underlying platform primitives:
The framework (Flue) — the project structure, the conventions, the integrations, the CLI and the developer experience for building agents.
The harness (Pi, Project Think) — the agentic loop that calls tools, reads results, manages context and keeps going until the task is done.
The runtime/platform (the Cloudflare Agents SDK) — the compute, state, and storage primitives everything above depends on
The Agents SDK is that bottom layer: it makes primitives like durable execution available to any harness and any framework. Flue, our new open-source framework from the team behind Astro, is the first to build on it. Here’s how.
Flue
Flue shipped 1.0 Beta this week, built on the Pi harness, the same harness that OpenClaw is built on. What makes it different as an agent framework is the approach: you don’t script what your agent does, you describe what it knows. Define the context an agent needs — its model, skills, sandbox, and instructions — and it solves whatever task you give it, autonomously. There’s no orchestration loop to write.
This declarative model is what makes writing agents easy: here’s a triage agent that intercepts a bug report, reproduces it in a sandbox, and diagnoses the issue in under 25 lines.
image
The Flue developer experience
Flue’s power comes from the fact that agents don’t live in isolation. They are built to exist where your users already work, and integrate with your preferred tooling:
Anywhere agents: Drop your agents into Slack, GitHub, Linear, or Discord with pre-configured Channels that handle event verification and dispatch boilerplate automatically.
Headless, but UI-ready: Agents shouldn’t live in a black box. Flue agents can run completely headlessly for background tasks, but @flue/react provides native frontend hooks that stream an agent’s state, tool execution, and live messages straight into your frontend application, without you having to build custom real-time plumbing from scratch.
Ecosystem-ready: Flue makes it easy to add and upgrade integrations with commands like flue add channel slack, generating a Markdown blueprint that your own coding agent can read, modify, and cleanly integrate straight into your codebase.
Designed for production, not just prototypes
Moving an agent out of a local terminal and into a production ecosystem introduces traditional distributed systems failures. Host crashes, API timeouts from LLM providers, and unexpected restarts threaten to erase the short-term memory of a running agent turn.
Flue solves this via Durable Streams. Each event in the execution history is added to an append-only log. By processing every prompt, tool response and model choice as an unchangeable ledger, an agent’s state is never volatile. If a process dies, another simply picks up the log and continues from the exact step it left off.
Deploy anywhere, including Cloudflare
Flue is a multi-cloud framework. On Node.js, each agent runs as a long-lived process. You can deploy it to any VM or container, run it in GitHub Actions, or embed it on an existing server. But when you target Cloudflare, each agent becomes a Durable Object.
By running each Flue agent inside its own Durable Object, Cloudflare can automatically scale to as many agents as you need, each with their own isolated storage and compute. You don’t have to provision servers, manage sticky sessions, or worry about noisy neighbors. And when Flue agents are deployed to Cloudflare, they get durable execution using Agents SDK’s runFiber(), stash(), and onFiberRecovered() methods. Flue also uses @cloudflare/codemode and @cloudflare/shell for sandboxed code execution against a durable workspace.
What harnesses need out of an agentic platform
Flue’s Cloudflare target works so effectively because it maps cleanly to the core primitives we built into the Agents SDK. You can even dig into the Flue source code to understand how Pi, the underlying harness, is adapted to work on Cloudflare Agents SDK.
Here’s how Flue leverages the Agents SDK under the hood, and what it takes to run any modern agent harness reliably at scale.
Every agent harness needs durable execution
An agent turn is not a single request. The model streams tokens, calls tools, waits for results, maybe asks a human for approval, or delegates work to a subagent. That sequence can take seconds or minutes, and at any point the process can be interrupted or crash. When that happens, all of the agent state that was in memory is gone: the streaming connection, the pending tool calls, where the agent was in its turn. Sure, the conversation history is persisted on disk, but the user sees a spinner that never resolves. That’s a broken user experience.
Fibers solve this problem by providing a native checkpointing mechanism directly inside the Agent’s underlying Durable Object. runFiber() records the progress to the Durable Object’s SQLite storage before the work in the Agent turn starts and checkpoints with stash() as the turn advances. When a fresh agent instance boots after an interruption, onFiberRecovered() delivers the last checkpoint, so your agent knows a turn was interrupted, where it got to, and can decide how to continue.
import { Agent } from "agents";
import type { FiberRecoveryContext } from "agents";
class MyAgent extends Agent {
async doWork() {
await this.runFiber("my-task", async (ctx) => {
const step1 = await expensiveOperation();
ctx.stash({ step1 });
const step2 = await anotherExpensiveOperation(step1);
this.setState({ ...this.state, result: step2 });
});
}
async onFiberRecovered(ctx: FiberRecoveryContext) {
if (ctx.name !== "my-task") return;
const { step1 } = (ctx.snapshot ?? {}) as { step1?: unknown };
if (step1) {
const step2 = await anotherExpensiveOperation(step1);
this.setState({ ...this.state, result: step2 });
}
}
}
Flue uses runFiber() on its Cloudflare target for exactly this. With the onFiberRecovered() hook, your harness can decide how to resume the execution of the turn, whether it attempts a full reconstruction model like Project Think that repairs turn state or whether it replays certain parts of the turn.
Executing code is better than overloading agents with tools
Agent harnesses give models access to the outside world through tools. But tool surfaces grow fast, and models get worse at selecting the right tool as the list gets longer and the context window fills up with tool definitions. A better pattern: give the model one tool that executes code. The model writes a TypeScript function that calls the APIs it needs, and the harness runs it. We wrote about this when we introduced Code Mode.
The question is where that code runs. To run LLM-generated code securely, you need a sandbox. But typical sandboxes would be slow, cost-prohibitive and inefficient to run each tool call. That’s why the Agents SDK provides @cloudflare/codemode, which wraps Dynamic Workers, to execute LLM-generated code in its own Worker isolate with only the bindings you provide.
image
Code Mode creates a fresh Dynamic Worker for each snippet, runs it, and discards it. Isolates start in under 10ms and $0.002 per load, resulting in drastically faster and cheaper cost of execution than booting a container every time your agent needs to execute a short piece of code. Flue uses @cloudflare/codemode on its Cloudflare target to power its code tool. The agent writes JavaScript against the workspace and runs it with Code Mode.
You don’t need a full container for most workspace tasks
Agent harnesses often need a filesystem, whether it’s to read files, write outputs, search through code and understand diffs. Coding agents in particular live in the filesystem. But if the harness is running in a serverless environment, how can it get a durable filesystem that persists across executions?
The usual answer is a container. That works, but it’s expensive for what agents mostly do. The majority of filesystem operations in an agent turn are text. Consider a review agent that reads files, greps through source code, or perhaps writes a patch. You don’t need a full Linux boot for that.
@cloudflare/shell gives your agent a durable virtual filesystem inside its Durable Object, backed by SQLite. It provides typed file operations — read, write, edit, search, grep, diff — that agent harnesses can use as tools.
Instead of calling individual tools, a Flue agent running on the Cloudflare target writes JavaScript against the workspace virtual file state API. By running more operations within the Durable Object, the agent benefits from the isolate model’s more efficient execution process, entirely avoiding container overhead:
async () => {
const files = await state.glob("src/**/*.ts");
const results = [];
for (const file of files) {
const content = await state.readFile(file);
const todos = content.match(/\/\/ TODO:.*/g);
if (todos) results.push({ file, todos });
}
return results;
}
This translates into a faster and more cost-efficient sandbox environment for agents that need to run shell and filesystem operations to get their work done. And for agents that need a full OS, to run npm install, git, or compilers, Cloudflare Containers provides that. We’re also building @cloudflare/workspace, to keep the virtual file system of a given Durable Object in sync with a container’s, allowing for seamless transition from lightweight Workers to a Linux environment only when it needs one.
Dynamic Workflows: let agents write their own workflows to repeat tasks consistently
But what happens when an agent needs to do more than read files or execute single code snippets? What happens when it needs to orchestrate a massive, multi-step pipeline that must repeat consistently over time, like a code review that successfully resolves bugs or a research workflow that produces good results? A harness can’t provide durable multi-step execution on its own. It needs the platform to persist each step, retry failures, and resume after interruptions.
This pattern is gaining traction. Claude Code recently shipped dynamic workflows, where Claude writes a JavaScript script at runtime to hand off work to dozens of subagents, and the runtime executes it durably. @cloudflare/dynamic-workflows provides this for any harness running on the Agents SDK. Your agent generates a workflow at runtime, and the Workflows engine persists each step, retries failures, and can sleep for hours or wait for external events like human approval.
From the Agent class, runWorkflow() connects your agent to the Workflows engine. The agent kicks off the workflow and can go to sleep. The workflow calls back into the agent via RPC to report progress, update state, or request approval. When the workflow finishes, the agent wakes up with the result.
Direct access to the Cloudflare ecosystem
Beyond compute and storage, agent harnesses need access to external capabilities: web browsing, email, memory, search, inference. A harness shouldn't have to integrate each of these separately, manage API keys for each, or worry about credentials leaking through agent-generated code.
The Agent class gives your harness access to the rest of Cloudflare through bindings: AI Gateway for per-agent spend tracking and limits, Browser Run for web automation, Email Service for inbox workflows, Agent Memory for persistent recall, AI Search for retrieval, Containers for workloads that need a full OS, and inference across 14+ model providers. Bindings grant capabilities without exposing credentials: your agent uses them, but the keys never enter agent-generated code.
image
Bring your agents to the agentic cloud
We know this approach works because it is the exact architectural foundation we used to build Project Think, our first-party agent harness. While Project Think remains our highly optimized, out-of-the-box solution for native Cloudflare agent experiences, the Agents SDK ensures that the broader open-source ecosystem can leverage those exact same battle-tested primitives, including Flue.
If you're building agents today with Flue, you can deploy in just a few clicks to Cloudflare. And if you're building your own agent harness or you’re building an agent framework, target the Agents SDK and get the platform integration for free.
Agents SDK: developers.cloudflare.com/agents
Flue: flueframework.com, npm install @flue/runtime
Think: docs
Cloudflare Community: community.cloudflare.com
関連記事
独自の脆弱性ハーンを構築する
クラウドフレアは、最先端セキュリティモデルを企業コードベースに適用した「グラスウィング・プロジェクト」の初期調査結果を発表し、AI 脅威からインフラと顧客を守るための防御構造の適応について解説している。
Vercel がオープンソース AI エージェントフレームワーク「Eve」をリリース:各エージェントは機能にマッピングされたファイルディレクトリとして定義される
Vercel は、生産環境で百以上のエージェントを実行している自社開発の基盤となるオープンソースフレームワーク「Eve」を公開した。このツールでは、エージェントの動作を定義する際にインフラ構築の手間を省き、各機能をファイルディレクトリにマッピングして管理できる仕組みを提供する。
エージェント駆動型デプロイメントを特徴とする「Cloudflare One」スタックの発表
クラウドフレアは、ゼロトラストネットワークアーキテクチャへの移行や採用が抱える課題に対し、セキュリティポリシーやルーティングの意図を解読する手作業を軽減するため、「エージェント駆動型デプロイメント」機能を備えた「Cloudflare One」スタックを発表した。
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み