---
description: A browserTool that returns to the same browser between turns, with adapters for Pi Durable, AI SDK, and TanStack AI.
title: New persistent browser tool in the Agents SDK, with tabs and logins that last between turns
image: https://developers.cloudflare.com/changelog/post/2026-10-13-persistent-browser/og.png?v=eac81663592e4bcb
---

[Skip to content](#main-content)

[View RSS feeds](https://developers.cloudflare.com/fundamentals/new-features/available-rss-feeds/) [ Subscribe to RSS](https://developers.cloudflare.com/changelog/rss/index.xml)

[Back to all posts](https://developers.cloudflare.com/changelog)

October 13, 2026

## New persistent browser tool in the Agents SDK, with tabs and logins that last between turns

[Agents](https://developers.cloudflare.com/agents/)

Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/changelog/post/2026-10-13-persistent-browser/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

The [Cloudflare Agents SDK](https://developers.cloudflare.com/agents/) now provides a `browserTool` that gives your agent a [Browser Run](https://developers.cloudflare.com/browser-run/) browser it can return to on later turns. Your agent can open a website, inspect a page, and come back to it with its tabs, cookies, and login session intact while the browser session remains alive.

When you give `browserTool` to your agent, the model writes code that drives the browser through the [Chrome DevTools Protocol (CDP)](https://developers.cloudflare.com/browser-run/cdp/). Screenshots return as images that an image-capable model can inspect and your UI can display.

To use `browserTool`, make sure you have [Agents SDK v0.28.0 ↗︎](https://github.com/cloudflare/agents/releases/tag/agents%400.28.0) or greater installed. Create a `Browser`, register it with your object's [Lifecycle](https://developers.cloudflare.com/agents/runtime/lifecycle/), and add the tool to a [Pi Durable](https://developers.cloudflare.com/agents/harnesses/pi/) [extension registry](https://developers.cloudflare.com/agents/harnesses/pi/extensions/) before opening the harness:

```js
import { Browser, browserRun } from "agents/browser";
import { browserTool } from "agents/browser/pi";

export class MyAgent extends DurableObject {
	// ...

	browser = new Browser({ provider: browserRun(this.env.BROWSER) });

	harness = new PiHarness({
		harness: async ({ storage, context }) => {
			this.registry.install({
				name: "browser",
				tools: [
					browserTool({
						ctx: this.ctx,
						browser: this.browser,
						loader: this.env.LOADER,
					}),
				],
			});

			// ...

			return Harness.open(
				storage,
				{ models, registry: this.registry },
				context,
			);
		},
	});

	lifecycle = Lifecycle.install(this).use(this.browser).use(this.harness);
}
```

```ts
import { Browser, browserRun } from "agents/browser";
import { browserTool } from "agents/browser/pi";

export class MyAgent extends DurableObject<Env> {
	// ...

	browser = new Browser({ provider: browserRun(this.env.BROWSER) });

	harness = new PiHarness({
		harness: async ({ storage, context }) => {
			this.registry.install({
				name: "browser",
				tools: [
					browserTool({
						ctx: this.ctx,
						browser: this.browser,
						loader: this.env.LOADER,
					}),
				],
			});

			// ...

			return Harness.open(
				storage,
				{ models, registry: this.registry },
				context,
			);
		},
	});

	lifecycle = Lifecycle.install(this).use(this.browser).use(this.harness);
}
```

Each Pi conversation gets its own active tab by default. Cookies and logins remain shared within the browser.

The browser stays alive between turns, including when the Durable Object hibernates. Its default idle timeout is 10 minutes. If the session expires or crashes, the tool creates a fresh browser and reports `restarted: true`. The old tabs and login state are gone.

You can also use the persistent browser with the AI SDK and TanStack AI adapters, or connect another harness through the public Browser and CDP APIs.

Refer to [persistent browser tools](https://developers.cloudflare.com/agents/tools/browser/#return-to-the-same-browser) for the complete Pi Durable example, required bindings, and behavior when a tool call is interrupted.

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://developers.cloudflare.com/changelog/post/2026-10-13-persistent-browser/#page","headline":"New persistent browser tool in the Agents SDK, with tabs and logins that last between turns","description":"A browserTool that returns to the same browser between turns, with adapters for Pi Durable, AI SDK, and TanStack AI.","url":"https://developers.cloudflare.com/changelog/post/2026-10-13-persistent-browser/","inLanguage":"en","image":"https://developers.cloudflare.com/changelog/post/2026-10-13-persistent-browser/og.png?v=eac81663592e4bcb","dateModified":"2026-10-13","datePublished":"2026-10-13","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```
