TL;DR
- Kitesurf, Cloudflare's stateless browser engine for AI agents, is now open source under Apache 2.0 on GitHub
- Developers can run Kitesurf locally, modify the code, and deploy it to their own Cloudflare Workers account
- The engine parses HTML, executes JavaScript, and renders screenshots without a full browser container, using less CPU and memory than Chromium
- Kitesurf is built from open-source Rust packages compiled to WebAssembly, including Blitz for DOM and layout, Stylo for CSS, and Boa for JavaScript execution
- License
- Apache 2.0
- Repository
- github.com/cloudflare/kitesurf
- Requirement
- Workers Paid plan to deploy
What happened
Cloudflare has open sourced Kitesurf, its stateless browser engine for AI agents, following through on a commitment made when the product was introduced in August and enhanced in September. The code is now available on GitHub under the Apache 2.0 license, allowing developers to read, run, modify, and deploy their own instances to Cloudflare Workers.
How Kitesurf works
Kitesurf runs entirely on Cloudflare Workers and handles core browser tasks without requiring a container. It parses HTML, applies CSS, executes JavaScript, and renders screenshots. The engine supports the Chrome DevTools Protocol (CDP), enabling clients like Puppeteer to connect and control it. The design prioritizes efficiency and scale: Kitesurf uses less CPU and memory than a full browser like Chromium while scaling on demand across Cloudflare's global Workers network.
The open-source repository reveals Kitesurf's architecture built on Cloudflare's Developer Platform and complementary open-source Rust packages compiled to WebAssembly. Blitz handles HTML parsing, the DOM, layout, and painting. Stylo provides CSS parsing, cascading, and computed styles. Boa runs JavaScript inside WebAssembly as a fallback when Dynamic Workers cannot execute it. Linebender libraries contribute text layout and 2D graphics, while Krilla generates PDF output. These projects retain their respective licenses, with the repository's NOTICE file documenting third-party attributions.
The codebase comprises three main components. The Engine manages browser sessions and client connections. PageScript runs the page and its JavaScript. PageRenderer draws the result. All packages, the Rust core, DOM shims, renderer, and the Kitesurf CLI are organized separately in the repository's packages directory.
Running Kitesurf locally
Developers can run Kitesurf locally by cloning the repository, installing dependencies, and starting the engine. The first build compiles the Rust core and its dependencies; subsequent builds use cached artifacts. Once started, a local development server runs at http://127.0.0.1:8787. Developers can access the browser through Chrome DevTools or use it programmatically.
Puppeteer can connect to the local instance via the CDP endpoint. Alternatively, developers can point AI harnesses directly at the local CDP port to let agents take full control of Kitesurf and interact with pages as needed.
git clone https://github.com/cloudflare/kitesurf.git
cd kitesurf
pnpm install --frozen-lockfile
pnpm run devimport 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();
}Deploying to production
After testing and modifying Kitesurf locally, developers can deploy the engine to their own Cloudflare account. A Workers Paid plan is required because Kitesurf uses Dynamic Workers to create isolated Workers for each page. Deployment is triggered from the repository root with a single command.
pnpm run deployContributing and roadmap
Kitesurf is under heavy development. Cloudflare welcomes forks and contributions through GitHub, with contribution guidelines available in the repository. Maintainers ask contributors to open an issue with a minimal reproduction or proposed approach before submitting pull requests. The team prioritizes focused fixes with tests and clear scope over large rewrites. Contributions need not be code; pages reproducing rendering bugs, failing automation workflows, or documentation improvements help move the project forward.
The project's focus areas are improving Web Platform Test compatibility, enhancing reliability, and boosting efficiency. Developers can track progress via the blog and changelog, check the official landing page for standards compatibility details and benchmarks, and join the team on Discord to discuss the browser's development.
Source
Cloudflare Bloghttps://blog.cloudflare.com/kitesurf-open-source/AI-assisted, verified against the source. This post was drafted with AI from the primary source linked above and checked automatically against it. For anything you depend on, read the original.
- #cloudflareworkers
- #browserautomation
- #opensource
- #aiagents
- #webassembly
