Frameworks

Cloudflare Open-Sources Kitesurf, Its Lightweight Browser Engine Built for AI Agents

AI agents need to open websites, run their scripts, and click around. Cloudflare has now opened up the code for Kitesurf, a light browser engine made for exactly that job.

Cloudflare Kitesurf lightweight browser engine built for AI agents is now open source
Kitesurf is a lightweight browser engine that AI agents can use to search, click, and read pages.

Cloudflare has made Kitesurf open source. Kitesurf is a stateless browser built for AI agents that runs entirely on top of Cloudflare Workers. You can now read the code, run it on your own computer, change it, and deploy your own copy.

Cloudflare first introduced Kitesurf in August and added WebMCP support, new APIs, and better compatibility in September. It had promised each time to release the code. That promise is now kept, under the Apache 2.0 license.

A browser built for agents

Most browsers are made for people. They are big, because they must handle every kind of page and a lot of features. Kitesurf takes a different path. It aims to be a lightweight, efficient browser that an AI agent can use to load websites, run their JavaScript, and interact with pages.

It does this without a browser container. Cloudflare says it uses less CPU and memory than a full browser such as Chromium, and it scales on demand across Cloudflare's global Workers network.

Plain idea: a normal browser is like a full-size truck. Kitesurf is more like a small delivery bike. It carries what an agent needs and costs much less to run.

Kitesurf also supports the Chrome DevTools Protocol (CDP). This is the standard way tools control and inspect a browser, so clients like Puppeteer can connect to it.

What is inside the repository?

Kitesurf builds on Cloudflare's developer platform and on open-source Rust packages compiled to WebAssembly. WebAssembly is a way to run fast, compiled code in safe, sandboxed places such as Workers.

  • Blitz handles HTML parsing, the DOM, layout, and painting.
  • Stylo handles CSS parsing, the cascade, and computed styles.
  • Boa runs JavaScript inside WebAssembly, as a last resort when JavaScript cannot run in Dynamic Workers.
  • Linebender libraries handle text layout and 2D graphics, and Krilla creates PDF output.

These projects keep their own licenses, and the repository's NOTICE file lists the third-party notices.

The three main parts

  • Engine: manages browser sessions and client connections.
  • PageScript: runs the page and its JavaScript.
  • PageRenderer: draws the result.

The engine, its Rust core, DOM shims, renderer, and the Kitesurf command-line tool each live in their own folder under the repository's packages directory, so you can see how the pieces fit.

Run your own Kitesurf

First check the repository's build requirements. Then clone it, install dependencies, and start the engine:

git clone https://github.com/cloudflare/kitesurf.git
cd kitesurf
pnpm install --frozen-lockfile
pnpm run dev

The first build compiles the Rust core and its dependencies, so it takes a while. Later builds reuse the cache. Then wrangler starts a local server at http://127.0.0.1:8787. You can open that address to try a page in Chrome DevTools, or use it from code.

Here is an example that connects Puppeteer in a Node.js script:

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();
}

You can also point your AI harness at the local CDP port. Cloudflare says agents work well with CDP, and you can watch one take control of Kitesurf.

Deploy to your Cloudflare account

When you finish testing, you can deploy the engine to your own account and use it instead of the managed APIs Cloudflare offers in Browser Run. From the repository root, run:

pnpm run deploy

Requirement: you need a Workers Paid plan, because Kitesurf uses Dynamic Workers to create isolated Workers for pages.

How you can help

Kitesurf lives on GitHub, and Cloudflare welcomes forks and contributions. It also says the project is under heavy development. The team is working to make it more compatible with web standards, more reliable, and more efficient. You can track standards progress on the Web Platform Tests site.

  1. Read the contribution guidelinesStart there before you write code.
  2. Open an issueInclude a minimal reproduction or a proposed approach.
  3. Get vouched by a maintainerThis comes before you open a pull request.
  4. Keep changes focusedSmall fixes with tests and clear evidence are easier to review than big rewrites.

You do not have to write code to help. A small page that reproduces a rendering bug, a failing automation workflow, or a clear documentation fix are all useful.

What It Means for Developers

Kitesurf matters most for people who build tools that let agents use the web.

What It Means for Software Developers

  • You can give an AI agent a browser it can use through CDP, with a familiar tool like Puppeteer.
  • Because the code is open, you can read it, run it locally, and change it to fit your needs.
  • Expect gaps. Cloudflare says compatibility is still being improved, so test your target pages first.
  • New to Node.js scripts? Brush up with our Node.js tutorial.
  • See how another team approaches browser automation in our story on E2E Core.

What It Means for Web Developers

  • An agent using Kitesurf will read your pages through its own engine, so check that important pages render correctly.
  • Use screenshots from Kitesurf to spot rendering bugs, and report them with a small reproduction page.
  • Follow the Web Platform Tests progress to see which standards are covered.

What It Means for DevOps Engineers

  • You can host your own engine on your own Cloudflare account and skip the managed Browser Run APIs.
  • Plan for a Workers Paid plan, because Dynamic Workers are required.
  • The first local build compiles the Rust core, so allow extra time, then rely on the build cache.
  • Since there is no browser container, the aim is lower CPU and memory use than Chromium. Measure it on your own workloads.

Bottom line

Cloudflare has opened up Kitesurf, a lightweight browser engine made for AI agents. It runs on Workers, speaks CDP, and builds on proven open-source Rust projects.

It is still early, so try it on a small task, report problems you find, and keep an eye on its progress.

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author