Skip to content

Changelog

New updates and improvements at Cloudflare.

Send up to 10 custom metadata entries per request

AI Gateway now saves up to 10 custom metadata entries per request, up from five. You can use the extra entries in log filtering, spend limits and dynamic routing conditions.

Metadata that AI Gateway adds, such as the Access user ID cf.user_id, no longer counts toward the limit and no longer replaces your last entry.

Custom metadata can be up to 12,288 bytes (12 KB) per request. If it is larger, AI Gateway removes entries from the end until the rest fit.

--header 'cf-aig-metadata: {"team": "AI", "user": 12345, "project": "chat", "cost_center": "cc-42", "env": "prod", "region": "us", "tier": "pro"}'

For details, refer to Custom metadata.

Introducing Search for Agents

Search for Agents makes your website searchable by AI agents without manually configuring a search integration. Turn it on under Quick Actions on your domain's Overview page in the Cloudflare dashboard. Cloudflare creates an AI Search instance, starts indexing your content, and exposes a search endpoint on your domain.

Search for Agents toggle turned on in the Cloudflare dashboard, with a Beta badge and a link to feature documentation.

Cloudflare adds discovery metadata to your HTML pages and, when Markdown for Agents is on, to Markdown responses. Agents can discover the endpoint and search with keywords or natural-language queries:

curl --get "https://example.com/.well-known/search" \
  --data-urlencode "q=How do I verify webhook signatures?"

The endpoint supports both GET and HTTP QUERY requests. It returns relevant content in Markdown, not an AI-generated answer, so agents can use the results with their own models.

Search for Agents is available on all plans. Usage is subject to AI Search pricing and plan limits. You can customize configurable settings in the AI Search instance created for your domain.

Read the announcement blog post ↗︎ and refer to the Search for Agents guide for setup instructions and default settings.

Activate Cloudflare subscriptions from the CLI and MCP

You and your agents can now activate Cloudflare subscriptions from the Cloudflare CLI (cf) or Cloudflare Model Context Protocol (MCP) servers, without switching to the dashboard.

Previously, OAuth sessions used by cf and MCP could not create subscriptions, so activating a product meant leaving your terminal or agent session to complete checkout in the dashboard. You can now activate subscriptions in place for common workflows:

  • Workers Paid: Move beyond Free plan limits such as 100,000 requests per day and 10 ms of CPU time, with 10 million requests and 30 million CPU milliseconds included each month for $5 per month plus usage.
  • R2: Activate an R2 subscription to start creating buckets, with 10 GB of free monthly storage plus usage-based billing beyond the free tier.
  • Zero Trust: Sign up for Zero Trust (with up to 50 users included on the Free plan) to put a Worker behind Cloudflare Access.

To use this from the CLI, update to cf 1.0.0-rc.5 or later and reauthenticate with cf auth login so your session receives the updated OAuth scopes. Your account must also have a verified email address and an existing billing profile with a payment method on file.

In MCP clients that support the MCP 2026-07-28 specification and MCP elicitation ↗︎, Cloudflare displays the plan price and asks for your permission before activating a subscription on your account. Clients that do not support elicitation are directed to the dashboard.

For more information, refer to Usage-based billing and Use cf with coding agents.

Agents SDK now supports Pi 1.6 with tools that wait without keeping your agent awake

Agents SDK v0.34.0 upgrades PiHarness to Pi 1.6 ↗︎. A Pi tool can now wait for a person, a deadline, or another session without keeping the Durable Object awake, and a session can start from a history that your application already has.

Tools that wait

  • Park until a signal or a deadline. A tool can return a "tool park" (Pi's ToolPark type) instead of a result. The tool park registers what the call waits for, and Pi runs it again when a signal arrives or the deadline passes. While it waits, the call holds no invocation, so the Durable Object can hibernate. Deliver signals with the new harness.signal(). Refer to Tools that wait.
  • Wait for a subagent. submit() and continue() take notify, so a parked tool wakes when another session's input settles. Refer to Wait for a subagent.
  • Approval gates. A beforeTool hook can park a tool call before it runs, for example until a person approves it.

Session updates

  • Start a session from an existing history. harness.root(), sessions.create(), and sessions.fork() take Pi's init, which writes messages into the transcript in the commit that creates the session. The root session is now created on its first use, so harness.root() can seed it. Refer to Seed a session with an existing history.
  • Keep queued input across an abort. With submit(input, { onAbort: "keep" }), stopping an answer does not drop the message that the user or another agent sent next.
  • Steadier runs. Pi retries more dropped provider connections. When Anthropic can no longer continue a message thread, agents/models/pi-ai sends the whole conversation again instead of failing the turn. PiHarness.dispose() frees Pi AI's per-session state.

Wait for a person's answer

This tool asks the user a question, then parks until your agent delivers the answer. Each time it runs, it checks for the answer first, so the question is shown once:

A sequence diagram of a tool that asks the user a question. The model calls the tool, and run 1 of execute() starts. readSignal() finds no answer, so the tool shows the question with its task id and returns a tool park naming the signal key it waits for. Run 1 ends there. Pi stores the tool park: the call's task id and the signal key. Between the runs the object can hibernate, with no tool code in memory and only the stored tool park kept. Later your app calls harness.signal() with the task id and the answer. Pi matches the stored tool park and starts run 2 of execute() with the same arguments. This time readSignal() returns the answer, and the tool returns it to the model as its result.
import { defineSignal } from "@earendil-works/pi-durable";
import { obj, str } from "@earendil-works/pi-schema";

const Answer = defineSignal({
	name: "app.answer",
	version: 1,
	schema: obj({ text: str() }),
});

const AskParameters = obj({ question: str() });

const askUser = {
	name: "ask_user",
	description: "Ask the user a question and wait for the answer.",
	parameters: AskParameters,
	async execute({ question }, api, context) {
		const answer = await api.readSignal(Answer, "answer", context);
		if (answer !== undefined && "value" in answer) {
			return { output: [{ type: "text", text: answer.value.text }] };
		}
		await showQuestion(api.taskId, question);
		return { sleep: { signals: [Answer.key("answer")] } };
	},
};

// Later, in your agent, when the user answers:
await this.harness.signal(taskId, Answer, "answer", { text: "Yes" });
import {
	defineSignal,
	type ToolRegistration,
} from "@earendil-works/pi-durable";
import { obj, str } from "@earendil-works/pi-schema";

const Answer = defineSignal({
	name: "app.answer",
	version: 1,
	schema: obj({ text: str() }),
});

const AskParameters = obj({ question: str() });

const askUser: ToolRegistration<typeof AskParameters> = {
	name: "ask_user",
	description: "Ask the user a question and wait for the answer.",
	parameters: AskParameters,
	async execute({ question }, api, context) {
		const answer = await api.readSignal(Answer, "answer", context);
		if (answer !== undefined && "value" in answer) {
			return { output: [{ type: "text", text: answer.value.text }] };
		}
		await showQuestion(api.taskId, question);
		return { sleep: { signals: [Answer.key("answer")] } };
	},
};

// Later, in your agent, when the user answers:
await this.harness.signal(taskId, Answer, "answer", { text: "Yes" });

While the question is open, the session's run is still going, and the object can hibernate or be evicted. harness.signal() wakes the object, and Pi runs the tool again with the answer.

Other changes

  • MCP re-authorization. A request that needs the user to sign in again throws MCPAuthorizationRequiredError with a link. A failed server stays failed until you call the new reconnectMcpServer(id). Refer to Failures and reconnecting.
  • Failed requests no longer send error details. A failed request gets a generic 500 response, and a failed WebSocket upgrade closes with code 1011. Use onFetchError() to choose the response. Refer to Failed requests.
  • Chat fixes. Stop, clear, regenerate, and resume now work across tabs and during recovery.
  • Scheduling fixes. A schedule, queue item, or Task run that is cancelled or replaced no longer runs again.
  • Models. ai.image() and Pi AI's ai.images() run the FLUX.2 image models. claudeCode() defaults to claude-sonnet-5-5. Examples move off the Workers AI models retired on November 20, 2026.

Upgrade

Once a conversation runs on Pi 1.6, Pi 1.5 cannot run its tool calls or model requests. After upgrading, roll forward to fix deployment issues rather than rolling back to Pi 1.5.

Deliver signals with harness.signal() instead of (await harness.pi()).signal(), and call harness.root() before you reach the root session through harness.pi(). If you use Pi Durable directly, RunEndTask is now HookTask, and code mode namespaces come from Extension.namespace. Refer to the Pi Durable 1.6.0 changelog ↗︎ for the full list of breaking changes.

If you use the MCP client, catch MCPAuthorizationRequiredError and send the user to error.authUrl, and give users a way to call reconnectMcpServer(id) for a failed server. If you relied on error details in failed responses, implement onFetchError().

The Agents SDK v0.34.0 changelog ↗︎ has step-by-step upgrade instructions. Point your coding agent at them and upgrade today:

Run custom scripts in Browser Run with /script

Browser Run now runs custom browser automation written with Playwright, Puppeteer, or the raw Chrome DevTools Protocol (CDP) in a single API request, with the new /script endpoints. Submit a JavaScript function, and Browser Run executes it in an isolated Worker connected to a browser session, so you do not need to deploy a Worker.

curl -i -X POST "https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-run/script" \
  -H "Authorization: Bearer <apiToken>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "async ({ page }) => { await page.goto(\"https://example.com\"); return { title: await page.title() }; }",
    "library": "playwright"
  }'
HTTP/2 200
content-type: application/json
cf-browser-session-id: 8f7c2e3a-1b4d-4c6e-9a0f-2d5b7e9c1a3f
cf-browser-target-id: A1B2C3D4E5F60718293A4B5C6D7E8F90

{
  "success": true,
  "result": {
    "title": "Example Domain"
  }
}
  • POST /script acquires a browser, runs your function, and returns its result as { "success": true, "result": ... }. The session and page are returned in the cf-browser-session-id and cf-browser-target-id response headers (except Kitesurf runs).
  • POST /script/<sessionId> runs follow-up scripts in a session you already hold, from /script or from POST /devtools/browser. Pass targetId to attach to a specific page, or create extra pages to run scripts concurrently in one session.
  • Session launch options (keep_alive, recording, lab) go in the /script query string. Use browser=kitesurf to run a CDP script on Kitesurf.
  • From a Worker, call the same endpoints through the browser binding with env.BROWSER.script(), without an API token.
  • From the Cloudflare dashboard, write and run scripts against a live browser in Script Studio, without an API token.
  • Neither endpoint closes the session after your script runs. Close it with DELETE /devtools/browser/<sessionId> or browser.close(). Otherwise, it ends at its idle timeout.

For more information, refer to Custom scripts.

Capture PDFs, links, scraped elements, and extracted JSON with /snapshot

Browser Run's /snapshot endpoint can now return four more formats from a single page load: pdf, links, scrape, and json. Before, /snapshot returned HTML, screenshots, Markdown, and the accessibility tree, so a workflow that also needed a PDF or structured data had to prepare the same page again in a second request.

Use the new formats when you need to:

  • PDF: print the page, with the same pdfOptions as the /pdf endpoint.
  • Links: collect the links on the page, with the same visibleLinksOnly and excludeExternalLinks options as /links.
  • Scraped elements: return the elements matched by elements, the same payload as /scrape. elements is required when you request it.
  • Extracted JSON: extract structured data from the page HTML with Workers AI, with the same prompt, response_format, and custom_ai fields as /json. prompt or response_format is required, and the request incurs Workers AI usage.

Request them through formats, the same way as the existing formats. This example returns a PDF, the page links, and the text of each paragraph:

const response = await env.BROWSER.quickAction("snapshot", {
	url: "https://example.com/",
	formats: ["pdf", "links", "scrape"],
	elements: [{ selector: "p" }],
});

const { result } = await response.json();
console.log(result.pdf);
console.log(result.links);
const response = await env.BROWSER.quickAction("snapshot", {
	url: "https://example.com/",
	formats: ["pdf", "links", "scrape"],
	elements: [{ selector: "p" }],
});

const { result } = await response.json();
console.log(result.pdf);
console.log(result.links);

Formats are captured in a fixed order rather than the order of the formats array, and the PDF is printed last because print handlers can change the page. A live page can change between captures, and any format that fails fails the whole request. For JSON snapshots, one actionTimeout budget (default 60 seconds, maximum 120 seconds) covers navigation, captures, retries, and the AI request.

You still need to request at least two distinct formats. If you only need one, use the corresponding single-format endpoint.

Refer to the /snapshot documentation for the full list of accepted values and options.

Attach images, PDFs, and text files to Agent Lee

You can now attach files to a message in Agent Lee. Share a screenshot of an error, a PDF, or a log, HAR, or configuration file, and Agent Lee reads it as part of your question.

Previously, you had to describe what you were seeing or paste file contents into the chat by hand. A screenshot of a dashboard error or a long log was hard to get across that way.

How it works

  • Select the paperclip next to the message box, paste an image, or drag files onto the chat panel.
  • Each file appears as a chip above the message box. Remove any you did not mean to add, then send your message.
  • Agent Lee reads images directly, converts PDFs to text and reads them from the start, and reads text files in full or, for long files, from the start and the end.

Example requests:

  • "Here is a screenshot of the error I get when I open my site. What is wrong?"
  • "This HAR file is from a slow page load. Which requests are taking the longest?"
  • "Here is the error log from my Worker. What is causing these failures?"

Good to know

  • Supported files. PNG, JPEG, and WebP images up to 3.5 MiB, PDFs up to 5 MiB, and text files (.txt, .log, .json, .har, .csv, .yaml, .yml, .toml, .md, .xml) up to 100 MiB. You can attach up to four files per message, up to 14 MiB in total after trimming.
  • Text files are trimmed in your browser. A text file over 1 MiB (2 MiB for JSON, HAR, YAML, TOML, and XML) keeps its first and last lines. HAR files are always compacted before sending: request and response bodies and cookies are removed, and credential headers such as Authorization and Cookie are replaced with [redacted].
  • Scanned PDFs are not read. Agent Lee reads the text in a PDF. A PDF that is only scanned images, with no text layer, cannot be read.
  • Older attachments age out. Agent Lee keeps attachments from your most recent messages in view. Attach a file again to bring an older one back into the conversation.
  • Attachments are stored with the conversation. When an attachment ages out, it is removed from the stored conversation. Do not attach files that contain passwords, API tokens, or other secrets. For how Agent Lee uses your data, refer to Data usage.

Agent Lee remains in beta. Features and behaviors may change as the product evolves.

For details, refer to Agent Lee.

AI Search can generate file summaries during indexing

AI Search can now summarize your files while it indexes them. For each text document that produces at least three chunks, AI Search uses a large language model (LLM) to generate a summary, topics, and keywords:

  • The summary and keywords are stored in the item's context metadata. A context value you already set is kept.
  • The topics are added to the context header of the file's chunks to help retrieval.

Turn on file summaries in the dashboard, or set indexing_options.file_summary to true when you create or update an instance. File summaries are off by default, and changing the setting triggers a full reindex.

indexing_options is replaced as a whole on every update. Include the current value of every option, or the options you leave out return to their defaults.

The LLM costs are billed to your account. File summaries are not part of the AI Search ingestion allotment. AI Search uses a Workers AI model suited to summarization and calls it through your instance's AI Gateway, or the default gateway if none is set, and the calls are billed as Workers AI usage. Each new or modified file is summarized once, so costs grow with the amount of content you index.

For more information, refer to File summaries.

Browser Run Quick Actions now work in local development

You can now test Browser Run Quick Actions locally. Under npx wrangler dev, the browser binding's .quickAction() method runs against a Chrome instance on your machine. Before, .quickAction() worked only in remote mode, and local calls failed with The RPC receiver does not implement the method "quickAction".

For details, refer to Test Quick Actions locally.

Manage AI Search instances in any namespace with Terraform

Starting with Cloudflare Terraform provider ↗︎ v5.29.0, you can manage AI Search instances in any namespace, not only default.

The cloudflare_ai_search_instance resource has a new namespace argument. It defaults to default, so existing configurations keep managing the same instances.

resource "cloudflare_ai_search_namespace" "support" {
  account_id = var.account_id
  name       = "support"
}

resource "cloudflare_ai_search_instance" "docs" {
  account_id = var.account_id
  id         = "docs"
  namespace  = cloudflare_ai_search_namespace.support.name
}

You can import existing instances and namespaces:

terraform import cloudflare_ai_search_instance.docs <account_id>/support/docs
terraform import cloudflare_ai_search_namespace.support <account_id>/support

The data sources read instances from the namespace you set:

data "cloudflare_ai_search_instance" "docs" {
  account_id = var.account_id
  namespace  = "support"
  id         = "docs"
}

data "cloudflare_ai_search_instances" "support" {
  account_id = var.account_id
  namespace  = "support"
}

When you upgrade to v5.29.0, review these changes:

  • The cloudflare_ai_search_instance import ID now includes the namespace: <account_id>/<namespace>/<id>. For instances in the default namespace, use <account_id>/default/<id>.
  • The cloudflare_ai_search_instance and cloudflare_ai_search_instances data sources require namespace. Set namespace = "default" for instances in the default namespace.
  • cloudflare_ai_search_instances returns the instances in one namespace. The filter.namespace argument of cloudflare_ai_search_instance is removed.
  • Changing namespace replaces the instance.

AI Search supports D1 databases as a data source (beta)

AI Search can now use a D1 database as a data source. AI Search runs a read-only query that you provide and indexes each returned row as a separate document. Scheduled syncs keep the index current as rows are added, changed, or removed.

Create D1-backed instances from the dashboard, the REST API, or the Workers binding.

Selecting a D1 database as the data source when creating an AI Search instance in the dashboard
curl -X POST "https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/ai-search/namespaces/default/instances" \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  --data '{
    "id": "help-center",
    "type": "d1",
    "source": "<D1_DATABASE_ID>",
    "token_id": "<SERVICE_TOKEN_ID>",
    "source_params": {
      "d1": {
        "query": "SELECT article_id AS id, title, content, category AS meta_category\nFROM articles\nWHERE published = 1"
      }
    }
  }'

Learn more in D1 data source.

Kitesurf is now open source

Kitesurf ↗︎, Cloudflare's browser engine for AI agents, is now open source on GitHub ↗︎ under the Apache 2.0 license. You can inspect the source, run it locally, and deploy your own instance to your Cloudflare account.

Kitesurf runs entirely on Cloudflare Workers. It parses HTML, applies CSS, executes page JavaScript, and renders screenshots without a browser container. It supports the Chrome DevTools Protocol (CDP), so you can connect clients such as Puppeteer.

Kitesurf is still experimental and under heavy development. The team continues to improve web standards support, rendering fidelity, and performance.

Run locally or deploy to your account

Developers can run Kitesurf locally with Wrangler. After following the build requirements and setup instructions ↗︎, run pnpm run dev. This builds the engine and starts wrangler dev.

To run your own instance on Cloudflare, follow the deployment instructions ↗︎. Protect your deployment with Cloudflare Access or another authentication layer. Kitesurf does not provide built-in authentication.

Contribute and follow progress

Contributions and pull requests are welcome. The team remains focused on compatibility, reliability, and performance, with limited review capacity. Keep changes focused and follow the contribution guidelines ↗︎, including opening an issue and getting vouched by a maintainer before submitting a pull request.

Visit kitesurf.dev ↗︎, the main Kitesurf website and playground. Track Web Platform Tests (WPT) progress ↗︎ and performance benchmarks ↗︎ as development continues.

For background and technical details, refer to the introductory blog post ↗︎ and the Kitesurf update ↗︎. To use Kitesurf through Browser Run, refer to the Kitesurf documentation.

EmbeddingGemma 2 now available on Workers AI

@cf/google/embeddinggemma-2 is now available on Workers AI. EmbeddingGemma 2 is an open multimodal embedding model from Google DeepMind. It maps text (including code), images, video, and audio into a single 768-dimensional vector space, so you can search a mixed collection of products, documents, and media with one text query.

Key capabilities:

  • Multimodal: Embed text, images, video, audio, or any combination of them in one input. Every embedding shares the same vector space.
  • Multilingual and code: Understands more than 100 languages and improves code retrieval over the original EmbeddingGemma.
  • Flexible dimensions: Set dimensions to 128, 256, or 512 to return shorter vectors and reduce storage, with a small cost to quality.
  • Long context: An 8,192 token context window, shared across all content in an input.
  • Task prefixes: Add short instructions such as task: search result | query: ... to tune embeddings for search, classification, clustering, or similarity.

Send text with input. Send images, video, and audio as base64 data URIs in messages:

const response = await env.AI.run("@cf/google/embeddinggemma-2", {
	messages: [
		[
			{
				role: "user",
				content: [
					{ type: "text", text: "Waterproof running shoes." },
					{ type: "image_url", image_url: { url: imageDataUri } },
				],
			},
		],
		[
			{
				role: "user",
				content:
					"task: search result | query: waterproof shoes for trail running",
			},
		],
	],
});
const response = await env.AI.run("@cf/google/embeddinggemma-2", {
	messages: [
		[
			{
				role: "user",
				content: [
					{ type: "text", text: "Waterproof running shoes." },
					{ type: "image_url", image_url: { url: imageDataUri } },
				],
			},
		],
		[
			{
				role: "user",
				content:
					"task: search result | query: waterproof shoes for trail running",
			},
		],
	],
});

Pricing is $0.0017 per million input tokens.

For more information, refer to the EmbeddingGemma 2 model page and pricing.

Inkling 2 Small now available on Workers AI

@cf/thinkingmachines/inkling-2-small is now available on Workers AI. Inkling 2 Small is the second generation of Inkling models from Thinking Machines Lab, and the first frontier open model from a US lab on Workers AI.

Inkling 2 Small is more capable than the previous generation. It is a multimodal Mixture-of-Experts model with 594B total parameters and 18B active parameters. Thinking Machines trained it much faster than previous models because of improvements to their pre-training and infrastructure.

Inkling 2 Small works well for:

  • Agentic coding: Plan, write, and edit code across multi-step tasks.
  • Vision understanding: Interpret images sent alongside text in the same request.
  • General agentic knowledge work: Research, analyze, and act on information with tools.

Key capabilities:

  • Vision: Accepts text and image inputs.
  • Reasoning: Reasoning is on by default at high effort. Set reasoning_effort to max, medium, low, or minimal to change the effort, or to none to turn reasoning off.
  • Function calling: Build agents that invoke tools and APIs across multiple conversation turns.
  • Long context: A full 1,048,576 token context window.

Inkling 2 Small requires the Workers Paid plan or prepaid AI Gateway credits. The default rate limit is 20 requests per minute with standard Workers AI billing and 50 requests per minute with prepaid AI Gateway credits. For details, refer to limits.

Use Inkling 2 Small through the Workers AI binding (env.AI.run()), the REST API, the OpenAI-compatible endpoint, or AI Gateway.

For more information, refer to the Inkling 2 Small model page and pricing.

Run the Codex agent loop on Cloudflare Workers

Run the Codex agent loop in a Cloudflare Durable Object with this experimental Agents SDK example ↗︎. Conversations, files, and completed model and tool results persist across restarts, allowing the agent to recover after interruptions.

The example adapts Codex’s Rust turn-processing code ↗︎ to WebAssembly and uses Agents SDK capabilities for storage and recovery.

The harness combines Agents SDK capabilities for durable execution:

  • Tasks journals model calls and tool execution. Completed steps reuse their recorded results after a restart. Interrupted steps can run again.
  • Sessions stores conversation history and compacts the model context.
  • Streams stores ordered events for replay after reconnecting.
  • Workspace provides tools to read and write persistent files.

For example, use OpenAI's GPT-6.1 Sol through AI Gateway. Configure the model with createAI and install the capabilities on a Durable Object:

import { DurableObject } from "cloudflare:workers";
import { Workspace } from "@cloudflare/computer";
import { Lifecycle } from "agents/lifecycle";
import { createAI } from "agents/models/ai-sdk";
import { Sessions } from "agents/sessions";
import { Streams } from "agents/streams";
import { Tasks } from "agents/tasks";
import { CodexHarness } from "./codex-harness";

export class Coder extends DurableObject {
	tasks = new Tasks();
	streams = new Streams();
	sessions = new Sessions();
	workspace = new Workspace({ storage: this.ctx.storage });

	codex = new CodexHarness({
		tasks: this.tasks,
		streams: this.streams,
		sessions: this.sessions,
		workspace: this.workspace,
		model: createAI({ binding: this.env.AI, id: "default" })(
			"openai/gpt-6.1-sol",
		),
	});

	lifecycle = Lifecycle.install(this)
		.use(this.tasks)
		.use(this.streams)
		.use(this.sessions)
		.use(this.codex);
}
import { DurableObject } from "cloudflare:workers";
import { Workspace } from "@cloudflare/computer";
import { Lifecycle } from "agents/lifecycle";
import { createAI } from "agents/models/ai-sdk";
import { Sessions } from "agents/sessions";
import { Streams } from "agents/streams";
import { Tasks } from "agents/tasks";
import { CodexHarness } from "./codex-harness";

export class Coder extends DurableObject<Env> {
	tasks = new Tasks();
	streams = new Streams();
	sessions = new Sessions();
	workspace = new Workspace({ storage: this.ctx.storage });

	codex = new CodexHarness({
		tasks: this.tasks,
		streams: this.streams,
		sessions: this.sessions,
		workspace: this.workspace,
		model: createAI({ binding: this.env.AI, id: "default" })("openai/gpt-6.1-sol"),
	});

	lifecycle = Lifecycle.install(this)
		.use(this.tasks)
		.use(this.streams)
		.use(this.sessions)
		.use(this.codex);
}

To use this model, configure the default gateway with Unified Billing or a stored OpenAI API key.

For setup, models, tools, and recovery behavior, refer to the Codex harness guide.

Run Exo agents on Cloudflare

You can now run Exo agents on Cloudflare, with Durable Objects coordinating conversations and Cloudflare Sandboxes running Linux tools. Define an agent in Markdown, then use Exo's CLI or HTTP API to run it.

After deploying the Cloudflare adapter and configuring your Exo provider ↗︎, add an openai vault credential and save this definition as agent.md:

---
harness: basic
model:
  name: gpt-6.1-sol
  credential: openai
---

Help the user with their task.

Run the agent against your Cloudflare deployment with Exo's CLI:

exo --provider cloudflare agent run --agent-file agent.md

The Exo project maintains the Cloudflare adapter independently of Cloudflare. It does not require the Agents SDK.

Follow the Exo guide for architecture, recovery behavior, and upstream setup instructions.

Run the Nanocode agent harness in Cloudflare Durable Objects

You can now run Nanocode ↗︎ coding agents in Cloudflare Durable Objects, with persistent session history and recovery after interruptions.

Nanocode's Rust engine runs as WebAssembly and implements Codex and Claude Code prompt and tool conventions. Its Cloudflare host saves turn progress and tool results in SQLite and uses alarms to resume pending work. The Nanocode project maintains the host independently of Cloudflare; it does not require the Agents SDK.

Start with the reference Worker ↗︎ and follow Nanocode on Workers for setup, models, and recovery limits.

Review provider key activity in AI Gateway

AI Gateway now shows usage activity for your stored provider keys. Use this information to review credentials for rotation or removal.

In Provider Keys, keys are grouped by provider with masked previews, aliases, and last-used and last-updated dates. The Key security section highlights keys with recorded activity older than 90 days. You can review these keys and delete them after checking their dependencies.

Usage tracking starts November 2026.

For details on storing, rotating, and removing provider keys, refer to Bring your own keys.

Planned model deprecations on Workers AI

We are refreshing the Workers AI model catalog to make room for new releases and updated models. Update your apps to remove references to the models listed below before November 20, 2026. We originally stated these models would be deprecated on November 15, 2026, and have moved the deprecation date to November 20, 2026.

Starting November 20, 2026, these models will stop returning responses. Requests to them will fail with an HTTP 410 Gone error and error code 5028.

We recommend moving to newer models for the best token efficiency and throughput. For pricing, refer to the Workers AI pricing page.

Models deprecated on November 20, 2026

LLMs

  • @cf/deepseek-ai/deepseek-r1-distill-qwen-32b
  • @cf/nvidia/nemotron-3-120b-a12b
  • @cf/deepseek-ai/deepseek-v4-pro-0813
  • @cf/deepseek-ai/deepseek-v4-flash-0731
  • @cf/qwen/qwq-32b
  • @cf/qwen/qwen3-30b-a3b-fp8
  • @cf/moonshotai/kimi-k2.6
  • @cf/moonshotai/kimi-k2.7-code
  • @cf/zai-org/glm-5.2
  • @cf/zai-org/glm-5.3-flash
  • @cf/meta-llama/llama-2-7b-chat-hf-lora
  • @cf/google/gemma-2b-it-lora
  • @cf/google/gemma-7b-it-lora
  • @cf/meta/llama-3.1-8b-instruct-fp8
  • @cf/meta/llama-3.2-1b-instruct
  • @cf/meta/llama-3.2-3b-instruct

Other models

Each deprecated model is followed by its suggested replacement.

For the full list of available models, refer to the Workers AI model catalog.

Route across a pool of models with model aliases

AI Gateway now supports model aliases. A model alias is a pool of models that your application calls by one name, such as custom/support-fast. AI Gateway tries the models in the order you set and falls back to the next one if a request fails, or uses smart routing to choose a model for each request.

Because your application only references the alias, you can swap models or change the routing algorithm on your gateway without redeploying. Create and manage aliases on your gateway's Routing page, alongside dynamic routes.

To call an alias through the REST API, use its name as the model. For example, send this body to /accounts/{account_id}/ai/run:

{
	"model": "custom/support-fast",
	"input": {
		"messages": [{ "role": "user", "content": "Reply with a short greeting." }]
	}
}

Include the cf-aig-gateway-id header to select the gateway where you created the alias. Aliases are scoped to individual gateways.

For setup instructions and routing options, refer to Model aliases.

Agents SDK now supports Pi 1.5 with fewer storage writes and lower memory use

Agents SDK v0.33.0 upgrades PiHarness to Pi 1.5 ↗︎. The release reduces storage transactions while streaming, improves throughput across many sessions, and reduces memory use when streaming large tool calls.

Performance improvements

  • Far fewer storage writes while streaming. Pi stores streamed answers and tool output in batches, within a second of each update, instead of on every update. Over SQLite, this cuts storage transactions by about 27x for long answers and 5.7x for turns with parallel tools, and CPU by about a quarter.
  • Higher throughput across many sessions. Pi's scheduler no longer rechecks every conversation on each commit. In a SQLite benchmark with 2,048 sessions, one Pi harness went from 88 to 459 agent runs per second.
  • Less memory on large answers. Streaming a 500 KB tool call used to take about 20 seconds of CPU and a 100 MB heap. Pi now appends new text instead of copying it on every update.

Streaming updates remain visible immediately, but are persisted in batches. With the default settings, a crash can lose up to about one second of streamed progress. Refer to Recovery to configure this interval.

Session and tool updates

  • A view of each session. session.watch() replaces session.events(). It returns the newest transcript entries and the session's live state, such as the answer being streamed, running tools, and why the last run ended without an answer.
  • Continue without adding a message. The new session.continue() API starts a new run using the existing transcript, for example after a model error or when a run reaches its turn limit.
  • Turn limit. defaults.maxTurns caps the tool rounds a run can take in new sessions.
  • Tasks that keep crashing end. Pi now ends a task cut off by its restart limit instead of parking it. retry() and the parked status are removed.
  • Browser in Pi's code mode. Scripts in Pi's code mode can call browserTool and pass its screenshots to image(). browserTool also stops when the harness aborts its call.

Continue an unanswered conversation

For an existing session and submission operationId, check the result before offering a continuation. For example, after resolving a model error:

const result = await session.wait(operationId);

if (result.status === "unanswered" && result.reason === "model_error") {
	const receipt = await session.continue({
		operationId: `${operationId}:continue`,
	});
	const continued = await session.wait(receipt.operationId);
	console.log(continued.status, continued.text);
}
const result = await session.wait(operationId);

if (result.status === "unanswered" && result.reason === "model_error") {
	const receipt = await session.continue({
		operationId: `${operationId}:continue`,
	});
	const continued = await session.wait(receipt.operationId);
	console.log(continued.status, continued.text);
}

This starts a new run without appending a user message. The session must be idle. If the transcript already ends in an answer, the operation returns unanswered with reason nothing_to_answer. Refer to Work with sessions.

Upgrade

Once a conversation runs on Pi 1.5, Pi 1.4 cannot read it. After upgrading, roll forward to fix deployment issues rather than rolling back to Pi 1.4.

Update callers of session.events() to use session.watch(), and remove uses of retry() and the parked status. Refer to the Pi Durable 1.5.0 changelog ↗︎ for the full list of breaking changes.

The Agents SDK v0.33.0 changelog ↗︎ has step-by-step upgrade instructions. Point your coding agent at them and upgrade today:

New AI Gateways require authentication

New AI Gateways now require authentication to prevent unauthorized requests. Once authentication is on, you cannot turn it off through the dashboard or API.

When you create a new AI Gateway through the API, authentication is on by default. You can leave out the authentication field or set it to true. If you set it to false, the API returns HTTP 400.

When you update an existing gateway, leaving out authentication keeps its current setting. If you try to turn off authentication after it is on, the API returns HTTP 400.

Existing gateways with authentication turned off can continue without it. You can turn it on in your gateway settings or include authentication: true in a gateway update request:

{
	"authentication": true
}

Before turning authentication on, configure HTTP clients to send a valid Cloudflare API token. Requests through Workers bindings remain pre-authenticated.

For setup instructions and supported authorization headers, refer to AI Gateway authentication.

Crawl results include URL outcomes and robots.txt diagnostics

Browser Run /crawl results now include more detailed diagnostics. Each URL record can include an outcome that identifies the specific processing result, such as success, robots_disallowed, timeout, or page_error.

The job-level robots array reports the robots.txt state for up to 50 origins encountered by the crawl. Each entry includes the origin, whether usable rules were available, and the HTTP status when the crawler received a response.

{
	"robots": [
		{
			"origin": "https://example.com",
			"state": "available",
			"status": 200
		}
	],
	"records": [
		{
			"url": "https://example.com/docs/",
			"status": "completed",
			"outcome": "success"
		}
	]
}

For field definitions and all possible outcome values, refer to URL outcomes and robots.txt diagnostics.

AI Search billing postponed to December 1, 2026, and default sync interval is now 24 hours

Billing postponed to December 1, 2026

AI Search billing has been postponed by one month and now begins on December 1, 2026, instead of November 1, 2026. You will not be charged for AI Search usage before December 1, 2026. Pricing and included usage are unchanged.

For rates and included usage, refer to Limits & pricing.

Default sync interval is now 24 hours

The default sync interval for AI Search instances is changing from 6 hours to 24 hours. You can still choose any supported interval, from 15 minutes to 24 hours, with the Sync interval setting in your instance settings or the sync_interval field in the API.

For details, refer to Sync interval.

Browser Run now runs Chrome 152

Browser Run now runs Chrome 152 by default. Your sessions get current web platform features, rendering fixes, and security patches. You do not need to change your code.

This release also includes the following improvements:

  • Updated default User-Agent. The default User-Agent for Quick Actions now reports Chrome 152 instead of Chrome 119. If you allowlist or match the Browser Run User-Agent, update your rules. You can still set your own value with the userAgent parameter. Refer to Automatic request headers.
  • Better site compatibility. Quick Actions requests now look more like requests from a regular Chrome browser, so fewer sites block them.
  • Large response headers. Pages that return large response headers now load correctly.
  • Updated root certificates. Browser Run removed distrusted root certificates from its trust store.
  • Absolute links. /links now returns absolute URLs, and links-only crawls now follow relative links.
  • Better Markdown output. /markdown and crawl Markdown output now keep code block languages.
  • Clearer errors. Quick Actions that time out now return a consistent error. Outbound Workers that throw an exception now return an HTTP error to the browser.

For more information, refer to the Browser Run documentation.