Skip to content
ES EN
Theme: automatic

How to Try Kitesurf, Cloudflare's Browser Engine, Locally

Guide on how to build Kitesurf on your machine, connect Puppeteer via CDP, and understand its limits before deploying it unauthenticated on Cloudflare Workers.

AI for developers

Cloudflare has released Kitesurf on GitHub under the Apache 2.0 license, three months after promising it. It is a browser engine for AI agents, written in Rust and WebAssembly, that speaks the Chrome DevTools Protocol (CDP) and runs on Workers instead of a container with Chromium. Here we review how to spin it up locally and what to expect.

In 30 seconds Kitesurf is built locally using Wrangler, exposes a CDP endpoint on port 8787, and can be driven by an unmodified Puppeteer client. It is under heavy development, lacks authentication out of the box, and deploying it to Cloudflare requires a paid Workers plan.

What You Need

You need the cloned repository, the Rust toolchain to compile the core to WebAssembly, Wrangler to serve the engine, and Node.js with puppeteer-core for the client. For a production deployment, a paid Workers plan is also required, because each page runs in its own Dynamic Worker. None of that is needed for local testing.

It is worth reading the official announcement and the Browser Run documentation beforehand, which explain how to choose Kitesurf over managed Chromium.

Conceptual diagram of an AI agent connected via WebSocket to a lightweight browser engine
The agent speaks CDP with the engine, which renders each page in its own isolation.

Steps to Get It Running

  1. Clone the repository from GitHub and review its README: it is the reference for the exact build commands, which may change as the project evolves.
  2. First, compile the Rust core to WebAssembly, as indicated in the README.
  3. Start the local server with Wrangler; a CDP endpoint should be listening on port 8787.
  4. Install puppeteer-core in a separate project and connect to the endpoint using the script in the next section.
  5. Run the script and verify that the screenshot is generated. If a specific page fails, it is likely hitting a standards support limit, not an error on your part.

Connecting Puppeteer via CDP

The project claims that an unmodified Puppeteer client works against the local server. This is the minimal example we tested in the guide; it uses a harmless test page:

import puppeteer from "puppeteer-core";

const browser = await puppeteer.connect({
  browserWSEndpoint: "ws://127.0.0.1:8787/devtools/browser",
});

try {
  const page = await browser.newPage();
  await page.goto("https://example.com/");
  await page.screenshot({ path: "page.png" });
} finally {
  await browser.disconnect();
}

Internally, each navigation comes in via Page.navigate, an isolation environment is created for the page script, and when a screencast is requested, each frame is rasterized to JPEG. The components are Blitz (HTML, DOM, layout, and painting), Stylo (CSS), Boa (JavaScript), and Krilla (PDF).

Limits and Precautions

The team itself warns that standards support and rendering fidelity are still work in progress; there is a Web Platform Tests page showing coverage. The stated limits are clear: no video, no WebGL, no anti-bot challenges requiring a real TLS fingerprint, and no long-lived authenticated sessions.

Regarding the question most frequently asked by agent builders—whether it will pass bot-detection systems—there is no answer in the published material. One comment pointed out that Cloudflare opposes unauthorized scraping, so that does not appear to be a goal. Some recommend separating the experiment from production workloads, and on Hacker News someone pointed out the risk of getting locked into the Cloudflare ecosystem.

Terminal with a local development server listening and a generated screenshot
Local server up and screenshot generated: the simplest smoke test.
Tip The README is emphatic: do not deploy Kitesurf without authentication in front of it. Keep the server bound to 127.0.0.1 while testing and, if you publish it, put an authenticated proxy in front first. We verified this with a single test page before handing off real agent tasks.

Original source: infoq.com

Article generated with AI.larebelion

Kernel

· CTO · Spain

“An unauthenticated browser exposed to the internet isn't an experiment; it's an open door with good marketing.”

Comments (0)

No comments yet. You can be the first.

Write a comment