---
title: Agents Changelog
image: https://edgetunnel-b2h.pages.dev/cf-twitter-card.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://edgetunnel-b2h.pages.dev/changelog/llms.txt  
> Use this file to discover all available pages before exploring further. 

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://edgetunnel-b2h.pages.dev/changelog/rss/index.xml) [ View RSS feeds ](https://edgetunnel-b2h.pages.dev/fundamentals/new-features/available-rss-feeds/) 

Agents

![hero image](https://edgetunnel-b2h.pages.dev/_astro/hero.CVYJHPAd_26AMqX.svg) 

Aug 05, 2025
1. ### [Cloudflare Sandbox SDK adds streaming, code interpreter, Git support, process control and more](https://edgetunnel-b2h.pages.dev/changelog/post/2025-08-05-sandbox-sdk-major-update/)  
[ Agents ](https://edgetunnel-b2h.pages.dev/agents/)[ Workers ](https://edgetunnel-b2h.pages.dev/workers/)  
We’ve shipped a major release for the [@cloudflare/sandbox ↗](https://github.com/cloudflare/sandbox-sdk) SDK, turning it into a full-featured, container-based execution platform that runs securely on Cloudflare Workers.  
This update adds live streaming of output, persistent Python and JavaScript code interpreters with rich output support (charts, tables, HTML, JSON), file system access, Git operations, full background process control, and the ability to expose running services via public URLs.  
This makes it ideal for building AI agents, CI runners, cloud REPLs, data analysis pipelines, or full developer tools — all without managing infrastructure.  
#### Code interpreter (Python, JS, TS)  
Create persistent code contexts with support for rich visual + structured outputs.  
#### createCodeContext(options)  
Creates a new code execution context with persistent state.

**TypeScript**  
```ts  
// Create a Python context  
const pythonCtx = await sandbox.createCodeContext({ language: "python" });  
// Create a JavaScript context  
const jsCtx = await sandbox.createCodeContext({ language: "javascript" });  
```  
Options:

  * language: Programming language ('python' | 'javascript' | 'typescript')
  * cwd: Working directory (default: /workspace)
  * envVars: Environment variables for the context  
#### runCode(code, options)  
Executes code with optional streaming callbacks.

**TypeScript**  
```ts  
// Simple execution  
const execution = await sandbox.runCode('print("Hello World")', {  
  context: pythonCtx,  
});  
// With streaming callbacks  
await sandbox.runCode(  
  `  
for i in range(5):  
    print(f"Step {i}")  
    time.sleep(1)  
`,  
  {  
    context: pythonCtx,  
    onStdout: (output) => console.log("Real-time:", output.text),  
    onResult: (result) => console.log("Result:", result),  
  },  
);  
```  
Options:

  * language: Programming language ('python' | 'javascript' | 'typescript')
  * cwd: Working directory (default: /workspace)
  * envVars: Environment variables for the context  
#### Real-time streaming output  
Returns a streaming response for real-time processing.

**TypeScript**  
```ts  
const stream = await sandbox.runCodeStream(  
  "import time; [print(i) for i in range(10)]",  
);  
// Process the stream as needed  
```  
#### Rich output handling  
Interpreter outputs are auto-formatted and returned in multiple formats:

  * text
  * html (e.g., Pandas tables)
  * png, svg (e.g., Matplotlib charts)
  * json (structured data)
  * chart (parsed visualizations)

**TypeScript**  
```ts  
const result = await sandbox.runCode(  
  `  
import seaborn as sns  
import matplotlib.pyplot as plt  
data = sns.load_dataset("flights")  
pivot = data.pivot("month", "year", "passengers")  
sns.heatmap(pivot, annot=True, fmt="d")  
plt.title("Flight Passengers")  
plt.show()  
pivot.to_dict()  
`,  
  { context: pythonCtx },  
);  
if (result.png) {  
  console.log("Chart output:", result.png);  
}  
```  
#### Preview URLs from Exposed Ports  
Start background processes and expose them with live URLs.

**TypeScript**  
```ts  
await sandbox.startProcess("python -m http.server 8000");  
const preview = await sandbox.exposePort(8000);  
console.log("Live preview at:", preview.url);  
```  
#### Full process lifecycle control  
Start, inspect, and terminate long-running background processes.

**TypeScript**  
```ts  
const process = await sandbox.startProcess("node server.js");  
console.log(`Started process ${process.id} with PID ${process.pid}`);  
// Monitor the process  
const logStream = await sandbox.streamProcessLogs(process.id);  
for await (const log of parseSSEStream<LogEvent>(logStream)) {  
  console.log(`Server: ${log.data}`);  
}  
```

  * listProcesses() - List all running processes
  * getProcess(id) - Get detailed process status
  * killProcess(id, signal) - Terminate specific processes
  * killAllProcesses() - Kill all processes
  * streamProcessLogs(id, options) - Stream logs from running processes
  * getProcessLogs(id) - Get accumulated process output  
#### Git integration  
Clone Git repositories directly into the sandbox.

**TypeScript**  
```ts  
await sandbox.gitCheckout("https://github.com/user/repo", {  
  branch: "main",  
  targetDir: "my-project",  
});  
```  
Sandboxes are still experimental. We're using them to explore how isolated, container-like workloads might scale on Cloudflare — and to help define the developer experience around them.

Aug 05, 2025
1. ### [OpenAI open models now available on Workers AI](https://edgetunnel-b2h.pages.dev/changelog/post/2025-08-05-openai-open-models/)  
[ Agents ](https://edgetunnel-b2h.pages.dev/agents/)[ Workers AI ](https://edgetunnel-b2h.pages.dev/workers-ai/)  
We're thrilled to be a Day 0 partner with [OpenAI ↗](http://openai.com/index/introducing-gpt-oss) to bring their [latest open models ↗](https://openai.com/index/gpt-oss-model-card/) to Workers AI, including support for Responses API, Code Interpreter, and Web Search (coming soon).  
Get started with the new models at `@cf/openai/gpt-oss-120b` and `@cf/openai/gpt-oss-20b`. Check out the [blog ↗](https://blog.cloudflare.com/openai-gpt-oss-on-workers-ai) for more details about the new models, and the [gpt-oss-120b](https://edgetunnel-b2h.pages.dev/workers-ai/models/gpt-oss-120b) and [gpt-oss-20b](https://edgetunnel-b2h.pages.dev/workers-ai/models/gpt-oss-20b) model pages for more information about pricing and context windows.  
#### Responses API  
If you call the model through:

  * Workers Binding, it will accept/return Responses API – `env.AI.run(“@cf/openai/gpt-oss-120b”)`
  * REST API on `/run` endpoint, it will accept/return Responses API – `https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/run/@cf/openai/gpt-oss-120b`
  * REST API on new `/responses` endpoint, it will accept/return Responses API – `https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1/responses`
  * REST API for OpenAI Compatible endpoint, it will return Chat Completions (coming soon) – `https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1/chat/completions`  
```plaintext  
curl https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CLOUDFLARE_API_KEY" \
  -d '{  
    "model": "@cf/openai/gpt-oss-120b",  
    "reasoning": {"effort": "medium"},  
    "input": [  
      {  
        "role": "user",  
        "content": "What are the benefits of open-source models?"  
      }  
    ]  
  }'  
```  
#### Code Interpreter  
The model is natively trained to support stateful code execution, and we've implemented support for this feature using our [Sandbox SDK ↗](https://github.com/cloudflare/sandbox-sdk) and [Containers ↗](https://blog.cloudflare.com/containers-are-available-in-public-beta-for-simple-global-and-programmable/). Cloudflare's Developer Platform is uniquely positioned to support this feature, so we're very excited to bring our products together to support this new use case.  
#### Web Search (coming soon)  
We are working to implement Web Search for the model, where users can bring their own Exa API Key so the model can browse the Internet.

Jun 25, 2025
1. ### [Run AI-generated code on-demand with Code Sandboxes (new)](https://edgetunnel-b2h.pages.dev/changelog/post/2025-06-24-announcing-sandboxes/)  
[ Agents ](https://edgetunnel-b2h.pages.dev/agents/)[ Workers ](https://edgetunnel-b2h.pages.dev/workers/)[ Workflows ](https://edgetunnel-b2h.pages.dev/workflows/)  
AI is supercharging app development for everyone, but we need a safe way to run untrusted, LLM-written code. We’re introducing [Sandboxes ↗](https://www.npmjs.com/package/@cloudflare/sandbox), which let your Worker run actual processes in a secure, container-based environment.

**TypeScript**  
```ts  
import { getSandbox } from "@cloudflare/sandbox";  
export { Sandbox } from "@cloudflare/sandbox";  
export default {  
  async fetch(request: Request, env: Env) {  
    const sandbox = getSandbox(env.Sandbox, "my-sandbox");  
    return sandbox.exec("ls", ["-la"]);  
  },  
};  
```  
#### Methods

  * `exec(command: string, args: string[], options?: { stream?: boolean })`:Execute a command in the sandbox.
  * `gitCheckout(repoUrl: string, options: { branch?: string; targetDir?: string; stream?: boolean })`: Checkout a git repository in the sandbox.
  * `mkdir(path: string, options: { recursive?: boolean; stream?: boolean })`: Create a directory in the sandbox.
  * `writeFile(path: string, content: string, options: { encoding?: string; stream?: boolean })`: Write content to a file in the sandbox.
  * `readFile(path: string, options: { encoding?: string; stream?: boolean })`: Read content from a file in the sandbox.
  * `deleteFile(path: string, options?: { stream?: boolean })`: Delete a file from the sandbox.
  * `renameFile(oldPath: string, newPath: string, options?: { stream?: boolean })`: Rename a file in the sandbox.
  * `moveFile(sourcePath: string, destinationPath: string, options?: { stream?: boolean })`: Move a file from one location to another in the sandbox.
  * `ping()`: Ping the sandbox.  
Sandboxes are still experimental. We're using them to explore how isolated, container-like workloads might scale on Cloudflare — and to help define the developer experience around them.  
You can try it today from your Worker, with just a few lines of code. Let us know what you build.

Apr 07, 2025
1. ### [Build MCP servers with the Agents SDK](https://edgetunnel-b2h.pages.dev/changelog/post/2025-04-07-mcp-servers-agents-sdk-updates/)  
[ Agents ](https://edgetunnel-b2h.pages.dev/agents/)[ Workers ](https://edgetunnel-b2h.pages.dev/workers/)  
The Agents SDK now includes built-in support for building remote MCP (Model Context Protocol) servers directly as part of your Agent. This allows you to easily create and manage MCP servers, without the need for additional infrastructure or configuration.  
The SDK includes a new `MCPAgent` class that extends the `Agent` class and allows you to expose resources and tools over the MCP protocol, as well as authorization and authentication to enable remote MCP servers.

  * [  JavaScript ](#tab-panel-3249)
  * [  TypeScript ](#tab-panel-3250)

**JavaScript**  
```js  
export class MyMCP extends McpAgent {  
  server = new McpServer({  
    name: "Demo",  
    version: "1.0.0",  
  });  
  async init() {  
    this.server.resource(`counter`, `mcp://resource/counter`, (uri) => {  
      // ...  
    });  
    this.server.tool(  
      "add",  
      "Add two numbers together",  
      { a: z.number(), b: z.number() },  
      async ({ a, b }) => {  
        // ...  
      },  
    );  
  }  
}  
```

**TypeScript**  
```ts  
export class MyMCP extends McpAgent<Env> {  
  server = new McpServer({  
    name: "Demo",  
    version: "1.0.0",  
  });  
  async init() {  
    this.server.resource(`counter`, `mcp://resource/counter`, (uri) => {  
      // ...  
    });  
    this.server.tool(  
      "add",  
      "Add two numbers together",  
      { a: z.number(), b: z.number() },  
      async ({ a, b }) => {  
        // ...  
      },  
    );  
  }  
}  
```  
See [the example ↗](https://github.com/cloudflare/agents/tree/main/examples/mcp) for the full code and as the basis for building your own MCP servers, and the [client example ↗](https://github.com/cloudflare/agents/tree/main/examples/mcp-client) for how to build an Agent that acts as an MCP client.  
To learn more, review the [announcement blog ↗](https://blog.cloudflare.com/building-ai-agents-with-mcp-authn-authz-and-durable-objects) as part of Developer Week 2025.  
#### Agents SDK updates  
We've made a number of improvements to the [Agents SDK](https://edgetunnel-b2h.pages.dev/agents/), including:

  * Support for building MCP servers with the new `MCPAgent` class.
  * The ability to export the current agent, request and WebSocket connection context using `import { context } from "agents"`, allowing you to minimize or avoid direct dependency injection when calling tools.
  * Fixed a bug that prevented query parameters from being sent to the Agent server from the `useAgent` React hook.
  * Automatically converting the `agent` name in `useAgent` or `useAgentChat` to kebab-case to ensure it matches the naming convention expected by [routeAgentRequest](https://edgetunnel-b2h.pages.dev/agents/runtime/communication/routing/).  
To install or update the Agents SDK, run `npm i agents@latest` in an existing project, or explore the `agents-starter` project:  
```sh  
npm create cloudflare@latest -- --template cloudflare/agents-starter  
```  
See the full release notes and changelog [on the Agents SDK repository ↗](https://github.com/cloudflare/agents/blob/main/packages/agents/CHANGELOG.md) and

Mar 18, 2025
1. ### [npm i agents](https://edgetunnel-b2h.pages.dev/changelog/post/2025-03-18-npm-i-agents/)  
[ Agents ](https://edgetunnel-b2h.pages.dev/agents/)[ Workers ](https://edgetunnel-b2h.pages.dev/workers/)  
![npm i agents](https://edgetunnel-b2h.pages.dev/_astro/npm-i-agents.CXCpJ1-7.apng)  
#### `agents-sdk` \-> `agents` Updated  
📝 **We've renamed the Agents package to `agents`**!  
If you've already been building with the Agents SDK, you can update your dependencies to use the new package name, and replace references to `agents-sdk` with `agents`:  
```sh  
# Install the new package  
npm i agents  
```  
```sh  
# Remove the old (deprecated) package  
npm uninstall agents-sdk  
# Find instances of the old package name in your codebase  
grep -r 'agents-sdk' .  
# Replace instances of the old package name with the new one  
# (or use find-replace in your editor)  
sed -i 's/agents-sdk/agents/g' $(grep -rl 'agents-sdk' .)  
```  
All future updates will be pushed to the new `agents` package, and the older package has been marked as deprecated.  
#### Agents SDK updates New  
We've added a number of big new features to the Agents SDK over the past few weeks, including:

  * You can now set `cors: true` when using `routeAgentRequest` to return permissive default CORS headers to Agent responses.
  * The regular client now syncs state on the agent (just like the React version).
  * `useAgentChat` bug fixes for passing headers/credentials, including properly clearing cache on unmount.
  * Experimental `/schedule` module with a prompt/schema for adding scheduling to your app (with evals!).
  * Changed the internal `zod` schema to be compatible with the limitations of Google's Gemini models by removing the discriminated union, allowing you to use Gemini models with the scheduling API.  
We've also fixed a number of bugs with state synchronization and the React hooks.

  * [  JavaScript ](#tab-panel-3245)
  * [  TypeScript ](#tab-panel-3246)

**JavaScript**  
```js  
// via https://github.com/cloudflare/agents/tree/main/examples/cross-domain  
export default {  
  async fetch(request, env) {  
    return (  
      // Set { cors: true } to enable CORS headers.  
      (await routeAgentRequest(request, env, { cors: true })) ||  
      new Response("Not found", { status: 404 })  
    );  
  },  
};  
```

**TypeScript**  
```ts  
// via https://github.com/cloudflare/agents/tree/main/examples/cross-domain  
export default {  
  async fetch(request: Request, env: Env) {  
    return (  
      // Set { cors: true } to enable CORS headers.  
      (await routeAgentRequest(request, env, { cors: true })) ||  
      new Response("Not found", { status: 404 })  
    );  
  },  
} satisfies ExportedHandler<Env>;  
```  
#### Call Agent methods from your client code New  
We've added a new [@unstable\_callable()](https://edgetunnel-b2h.pages.dev/agents/runtime/agents-api/) decorator for defining methods that can be called directly from clients. This allows you call methods from within your client code: you can call methods (with arguments) and get native JavaScript objects back.

  * [  JavaScript ](#tab-panel-3247)
  * [  TypeScript ](#tab-panel-3248)

**JavaScript**  
```js  
// server.ts  
import { unstable_callable, Agent } from "agents";  
export class Rpc extends Agent {  
  // Use the decorator to define a callable method  
  @unstable_callable({  
    description: "rpc test",  
  })  
  async getHistory() {  
    return this.sql`SELECT * FROM history ORDER BY created_at DESC LIMIT 10`;  
  }  
}  
```

**TypeScript**  
```ts  
// server.ts  
import { unstable_callable, Agent, type StreamingResponse } from "agents";  
import type { Env } from "../server";  
export class Rpc extends Agent<Env> {  
  // Use the decorator to define a callable method  
  @unstable_callable({  
    description: "rpc test",  
  })  
  async getHistory() {  
    return this.sql`SELECT * FROM history ORDER BY created_at DESC LIMIT 10`;  
  }  
}  
```  
#### agents-starter Updated  
We've fixed a number of small bugs in the [agents-starter ↗](https://github.com/cloudflare/agents-starter) project — a real-time, chat-based example application with tool-calling & human-in-the-loop built using the Agents SDK. The starter has also been upgraded to use the latest [wrangler v4](https://edgetunnel-b2h.pages.dev/changelog/2025-03-13-wrangler-v4/) release.  
If you're new to Agents, you can install and run the `agents-starter` project in two commands:  
```sh  
# Install it  
$ npm create cloudflare@latest agents-starter -- --template="cloudflare/agents-starter"  
# Run it  
$ npm run start  
```  
You can use the starter as a template for your own Agents projects: open up `src/server.ts` and `src/client.tsx` to see how the Agents SDK is used.  
#### More documentation Updated  
We've heard your feedback on the Agents SDK documentation, and we're shipping more API reference material and usage examples, including:

  * Expanded [API reference documentation](https://edgetunnel-b2h.pages.dev/agents/runtime/), covering the methods and properties exposed by the Agents SDK, as well as more usage examples.
  * More [Client API](https://edgetunnel-b2h.pages.dev/agents/runtime/agents-api/#client-api) documentation that documents `useAgent`, `useAgentChat` and the new `@unstable_callable` RPC decorator exposed by the SDK.
  * New documentation on how to [route requests to agents](https://edgetunnel-b2h.pages.dev/agents/runtime/communication/routing/) and (optionally) authenticate clients before they connect to your Agents.  
Note that the Agents SDK is continually growing: the type definitions included in the SDK will always include the latest APIs exposed by the `agents` package.  
If you're still wondering what Agents are, [read our blog on building AI Agents on Cloudflare ↗](https://blog.cloudflare.com/build-ai-agents-on-cloudflare/) and/or visit the [Agents documentation](https://edgetunnel-b2h.pages.dev/agents/) to learn more.

Feb 25, 2025
1. ### [Introducing the Agents SDK](https://edgetunnel-b2h.pages.dev/changelog/post/2025-02-25-agents-sdk/)  
[ Agents ](https://edgetunnel-b2h.pages.dev/agents/)[ Workers ](https://edgetunnel-b2h.pages.dev/workers/)  
We've released the [Agents SDK ↗](http://blog.cloudflare.com/build-ai-agents-on-cloudflare/), a package and set of tools that help you build and ship AI Agents.  
You can get up and running with a [chat-based AI Agent ↗](https://github.com/cloudflare/agents-starter) (and deploy it to Workers) that uses the Agents SDK, tool calling, and state syncing with a React-based front-end by running the following command:  
```sh  
npm create cloudflare@latest agents-starter -- --template="cloudflare/agents-starter"  
# open up README.md and follow the instructions  
```  
You can also add an Agent to any existing Workers application by installing the `agents` package directly  
```sh  
npm i agents  
```  
... and then define your first Agent:

**TypeScript**  
```ts  
import { Agent } from "agents";  
export class YourAgent extends Agent<Env> {  
  // Build it out  
  // Access state on this.state or query the Agent's database via this.sql  
  // Handle WebSocket events with onConnect and onMessage  
  // Run tasks on a schedule with this.schedule  
  // Call AI models  
  // ... and/or call other Agents.  
}  
```  
Head over to the [Agents documentation](https://edgetunnel-b2h.pages.dev/agents/) to learn more about the Agents SDK, the SDK APIs, as well as how to test and deploying agents to production.

Feb 14, 2025
1. ### [Build AI Agents with Example Prompts](https://edgetunnel-b2h.pages.dev/changelog/post/2025-02-14-example-ai-prompts/)  
[ Agents ](https://edgetunnel-b2h.pages.dev/agents/)[ Workers ](https://edgetunnel-b2h.pages.dev/workers/)[ Workflows ](https://edgetunnel-b2h.pages.dev/workflows/)  
We've added an [example prompt](https://edgetunnel-b2h.pages.dev/workers/get-started/prompting/) to help you get started with building AI agents and applications on Cloudflare [Workers](https://edgetunnel-b2h.pages.dev/workers/), including [Workflows](https://edgetunnel-b2h.pages.dev/workflows/), [Durable Objects](https://edgetunnel-b2h.pages.dev/durable-objects/), and [Workers KV](https://edgetunnel-b2h.pages.dev/kv/).  
You can use this prompt with your favorite AI model, including Claude 3.5 Sonnet, OpenAI's o3-mini, Gemini 2.0 Flash, or Llama 3.3 on Workers AI. Models with large context windows will allow you to paste the prompt directly: provide your own prompt within the `<user_prompt></user_prompt>` tags.  
```sh  
{paste_prompt_here}  
<user_prompt>  
user: Build an AI agent using Cloudflare Workflows. The Workflow should run when a new GitHub issue is opened on a specific project with the label 'help' or 'bug', and attempt to help the user troubleshoot the issue by calling the OpenAI API with the issue title and description, and a clear, structured prompt that asks the model to suggest 1-3 possible solutions to the issue. Any code snippets should be formatted in Markdown code blocks. Documentation and sources should be referenced at the bottom of the response. The agent should then post the response to the GitHub issue. The agent should run as the provided GitHub bot account.  
</user_prompt>  
```  
This prompt is still experimental, but we encourage you to try it out and [provide feedback ↗](https://github.com/cloudflare/cloudflare-docs/issues/new?template=content.edit.yml).

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://edgetunnel-b2h.pages.dev/changelog/product/agents/2/#page","headline":"Agents Changelog | Cloudflare Docs","url":"https://edgetunnel-b2h.pages.dev/changelog/product/agents/2/","inLanguage":"en","image":"https://edgetunnel-b2h.pages.dev/cf-twitter-card.png","publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://edgetunnel-b2h.pages.dev/#website","name":"Cloudflare Docs","url":"https://edgetunnel-b2h.pages.dev/"}}
```
