Cloudflare open-sources Kitesurf: how its agent browser works
By AgentRiot Editorial
The Workers-based engine can now run from source. Its appeal is lower CPU and memory use, with slower median renders and important compatibility limits.

Cloudflare has opened the source for Kitesurf, the browser engine it built to let AI agents load pages, execute JavaScript and capture screenshots without starting Chromium. Developers can now inspect it, change it, run it locally and deploy an instance in their own Cloudflare account. The November 13 announcement (opens in new tab) follows a changelog entry dated November 12 (opens in new tab).
This is the source release of an existing product, not Kitesurf's first availability. Cloudflare introduced the managed browser in August, when AgentRiot covered its Workers architecture (opens in new tab). The new option gives developers control over the engine rather than only access to Cloudflare's managed Browser Run endpoints.
The distinction matters for deployment, debugging and cost. It does not make Kitesurf a full Chrome replacement. The repository describes it as experimental (opens in new tab), and Cloudflare's current benchmark shows a clear trade: less CPU and memory, but slower median wall time than both comparison browsers.
What the source release contains
Kitesurf's own code is under Apache 2.0 (opens in new tab). That is not a blanket license for everything bundled with it. Fonts, data and dependencies retain their respective licenses, as the repository's NOTICE (opens in new tab) explains.
The repository separates the Engine, PageScript, PageRenderer, DOM shims, Rust core and terminal client into packages. Beneath them are several existing browser and graphics projects: Blitz supplies HTML parsing, DOM, layout and painting; Stylo handles CSS parsing, cascading and computed styles; Linebender libraries handle text and 2D graphics; Krilla generates PDFs. These are Rust components compiled to WebAssembly, not a hidden Chromium process.
The launch announcement (opens in new tab) says page JavaScript normally runs in Dynamic Workers. Boa, another Rust engine compiled to Wasm, handles fallback execution inside the PageScript worker when code cannot use the native path. That fallback does not remove the Dynamic Workers deployment requirement.
Follow a screenshot through the engine
A Puppeteer client still speaks the Chrome DevTools Protocol, or CDP. The server behind that familiar interface is different. Cloudflare's architecture explanation (opens in new tab) divides a request into three main components:
- The client connects to the Engine's WebSocket endpoint and opens a page. The Engine handles client connections and browser-session state. The current Engine entry point (opens in new tab) also exposes HTTP discovery and health routes.
- The Engine bootstraps the document and scripts. Page execution happens in an isolated PageScript worker, with its own JavaScript environment and DOM. Dynamic Workers provide the runtime-created workers rather than a pool of desktop-browser containers.
- HTML parsing and CSS processing build the page representation. Page scripts execute and change the DOM; resource requests obtain stylesheets, images and fonts. Cloudflare describes a SandboxOutbound gateway that applies network policy, browser-shaped headers and per-page cookie handling.
- When a frame is needed, PageRenderer obtains the scene from PageScript and rasterizes it into an image buffer. The Engine coordinates this work through Workers RPC and returns output such as a PNG to the client.
That split makes rendering replaceable without putting every responsibility in the page's execution context. It also explains why merely speaking CDP does not establish Chrome parity: Kitesurf supplies its own DOM APIs, layout behavior and renderer behind the protocol. The README explicitly warns (opens in new tab) that some DevTools features do not work yet.
The CDP dispatcher (opens in new tab) even returns empty results for probes into unsupported domains such as ServiceWorker and WebAuthn. A successful connection alone does not show that a client's required commands work.
The isolation model is useful, but it is not authorization for the agent's actions. An operator still has to decide which sites, accounts and consequential operations an agent may use.
Running the source locally
The documented requirements (opens in new tab) are Node.js 22 or newer, pnpm 9.15.4 and Bazelisk installed as bazel. Bazel downloads the pinned Bazel and Rust toolchains, wasm-bindgen and binaryen. A separate rustup installation is only needed when editing vendored Rust crate patches. macOS users also need GNU tar.
With those prerequisites installed, the repository documents this local workflow:
git clone https://github.com/cloudflare/kitesurf.git
cd kitesurf
git checkout 4a2903813a22b08d4f3cc64a4b35339d0293a5d1
pnpm install --frozen-lockfile
pnpm run dev
The last command builds the Wasm modules and page and renderer bundles with Bazel, then starts wrangler dev. The first compilation takes longer; later builds reuse Bazel's cache. The engine listens at http://127.0.0.1:8787, with a health endpoint at /health and a landing page for opening a URL in DevTools.
Install puppeteer-core in the separate project controlling the engine. The README's connection example (opens in new tab) then looks like this:
import puppeteer from "puppeteer-core";
const browser = await puppeteer.connect({
browserWSEndpoint: "ws://127.0.0.1:8787/devtools/browser",
});
const page = await browser.newPage();
await page.goto("https://example.com/");
await page.screenshot({ path: "page.png" });
await browser.disconnect();
There are two different meanings of local development here. Building the open-source engine starts a local Kitesurf server. Using the managed Browser Run binding with quickAction() and browser: "kitesurf" does not: the managed-service documentation (opens in new tab) says that path needs a remote binding under wrangler dev. These are separate interfaces, not contradictory instructions.
Protect the endpoint before deploying
Running your own Cloudflare instance requires a Workers Paid plan because the engine uses Dynamic Workers. More urgently, Kitesurf has no built-in authentication. Its deployment warning (opens in new tab) says anyone with an exposed endpoint can connect a client, browse through the engine, send outbound requests from your account and consume resources you pay for.
Do not deploy first and add protection later. The default address follows the predictable pattern kitesurf.<your-subdomain>.workers.dev. Configure Access for all Workers in the account before deployment, following Cloudflare's workers.dev Access guidance (opens in new tab), or establish another authentication layer first. When enabled, Version URLs are public too and need their own protection (opens in new tab).
For automation, a browser login alone is insufficient. The CDP-through-Access instructions (opens in new tab) call for an Access service token, an allowing Service Auth policy and the CF-Access-Client-Id and CF-Access-Client-Secret headers on the WebSocket connection. Keep those credentials in secret storage, not in an agent prompt or checked-in script.
Open source is not free hosted execution
The managed Kitesurf service (opens in new tab) is free during beta, subject to per-account limits. That offer does not make a customer-operated deployment free. The Workers Paid plan (opens in new tab) has a $5 monthly account minimum, with usage charges beyond included allowances.
Dynamic Workers pricing (opens in new tab) adds a separate creation dimension: the table includes 1,000 unique Dynamic Workers per month, then charges $0.002 per Dynamic Worker per day. Uniqueness depends on Worker ID and code, and the count resets daily. Reusing the same ID and code counts once within a day; changing either creates a new billable identity. With no ID, or with .load(code), each invocation counts as a creation. That makes worker reuse consequential, independently of CPU efficiency.
The same pricing page (opens in new tab) lists 10 million requests and 30 million CPU milliseconds included monthly, then $0.30 per additional million requests and $0.02 per additional million CPU milliseconds. Those request and CPU quantities count toward the existing Workers bill, not a second independent allowance. Dynamic Workers CPU includes startup as well as execution, and RPC calls can count as requests. A screenshot therefore should not be budgeted as one ordinary HTTP request with a fixed browser fee.
Lower resource use, slower median renders
Cloudflare's live benchmark (opens in new tab) last ran at 02:40 UTC on November 14. Its corpus has 38 entries representing 37 unique URLs; the harness attempts five recorded renders per page, endpoint and backend after two warm-ups. Headline values are medians of the available per-entry medians: 37 entries for Kitesurf, 35 for Browser Run and 38 for cold Chrome. Failed entries are excluded, so the columns do not compare identical successful sets. These are Cloudflare's measurements, not an AgentRiot reproduction.
| Task and metric | Kitesurf | Browser Run | Chrome, labeled cold start |
|---|---|---|---|
| Screenshot wall time | 1.79 s | 1.20 s | 1.01 s |
| Screenshot CPU | 387 ms | 1.67 s | 767 ms |
| Screenshot memory | 50 MiB | 400 MiB | 329 MiB |
| HTML wall time | 1.37 s | 1.10 s | 894 ms |
| HTML CPU | 446 ms | 1.59 s | 637 ms |
| HTML memory | 29 MiB | 398 MiB | 316 MiB |
Kitesurf has lower CPU and memory headline medians, but higher elapsed-time medians. Individual pages vary. In the displayed screenshot results, Hacker News takes 609 ms on Kitesurf against 920 ms on Browser Run and 1.51 seconds on Chrome. Cloudflare's developer-docs page goes the other way: 3.48 seconds against 1.23 and 1.06 seconds. Kitesurf also uses more CPU than cold Chrome on 17 of 37 comparable screenshot entries and 13 of 37 HTML entries. The table contains failed renders, including a Kitesurf failure on Sansa's smart-model-routing page and Browser Run failures on Relic pages.
The benchmark's measurement notes (opens in new tab) prevent a clean end-to-end speed comparison. Kitesurf's wall timer includes reading the output response; Browser Run measures the browser action server-side. Chrome's “cold start” timer starts only once Chrome is CDP-ready, excluding process launch. Memory is absolute memory at capture, not the increase caused by one page: Kitesurf sums isolates, while Chrome uses proportional set size across its process tree. Browser Run reuses Chrome and can retain memory from earlier pages; the cold-start case creates a fresh process tree. The corpus can change.
These results support testing Kitesurf for resource-constrained workloads. They do not establish a universal latency win or an equivalent reduction in a customer's bill.
What the 98.3% WPT pass rate leaves out
The Web Platform Tests dashboard (opens in new tab), dated November 13 at 16:24 UTC, displays a headline of 1,517,208 passing subtests out of 1,543,968, or 98.3%. That is a result for its enrolled subset, not the whole web platform or 98.3% of websites. The report also includes known failures and timeouts, including 318 expected-timeout records skipped without a fresh test execution.
There is an unresolved discrepancy in the published counts: the same dashboard's detailed folder rows sum to 1,518,067 passing outcomes out of 1,545,749, rather than the headline totals. Those detailed totals match the site's machine-readable folder report. The headline should therefore be read as Cloudflare's displayed summary, not a fully reconciled count.
The file-level result is 9,093 fully passing files out of 11,764, or 77.3%. Another 56,854 files are skipped: 56,823 are not enrolled and 31 are marked SKIP. The dashboard estimates 470,593 skipped subtests using Chrome 154's count. Encoding alone contributes 1,139,877 passing subtests out of 1,139,904, heavily weighting the headline percentage toward that area.
The practical exclusions remain substantial. Cloudflare's current usage guide (opens in new tab) rules out video, WebGL, bot-challenge handshakes requiring real TLS fingerprints and long-running authenticated sessions needing persistent state. Screenshot fidelity is also a trade-off, not a promise of pixel-perfect Chrome output.
The standalone CDP source (opens in new tab) sets a 10-minute idle deadline without client CDP traffic and a 60-minute maximum session duration by default. These are engine-specific limits, separate from generic Browser Run session settings.
For an agent that extracts public content or takes disposable screenshots, the source release makes a focused trial possible. Start with the actual pages and CDP operations the agent needs, check that the output is usable, then measure completion time and account usage. Keep Chromium available for workflows Kitesurf cannot finish.

