Kitesurf Agent-First Browser Launches on Cloudflare Workers

Kitesurf delivers an agent‑first browser that runs entirely on Cloudflare Workers

Takeaway: Cloudflare’s new Kitesurf browser runs in V8 isolates on Workers, cutting CPU usage by 3–8× and memory by 5–7× compared to Chromium for common AI agent tasks, while remaining compatible with CDP tools like Puppeteer.


Why a new browser was needed

  • Agents, not humans: AI agents require low token counts, fast context windows, and cheap compute. Traditional browsers such as Chromium carry heavy UI‑related overhead—tabs, extensions, high‑fidelity rendering—that agents never use.
  • Cost barrier: Running a full Chromium instance per agent is prohibitively expensive, limiting sophisticated AI models to a narrow set of web tasks.
  • Different threat model: Agent‑driven browsing introduces concerns like prompt injection and tool safety, which are not primary considerations for human‑focused browsers.

These observations led Cloudflare to answer “yes” to the long‑standing internal question, Should we build our own browser? and to launch Kitesurf in beta on the Browser Run platform.


Core design principles

1. Test‑driven development

  • Integrated the Web Platform Tests (WPT) suite to give AI‑assisted code generation concrete success criteria.
  • Added integration and visual‑regression tests that compare Kitesurf’s output against Chromium on real sites, catching rendering divergences early.

"The advantage of using CDP is client compatibility: Puppeteer, Playwright, chrome‑remote‑interface, and the actual Chrome DevTools frontend. Point them at Kitesurf and they will all just work." – Cloudflare blog

2. Rust‑first, compiled to WebAssembly

  • Native Rust components avoid the bloat of Emscripten‑generated binaries.
  • wasm-bindgen is used to compile directly to Wasm, keeping execution close to the metal and leveraging Cloudflare’s mature Wasm runtime.

3. Robust exception handling

  • Any failure degrades to a blank frame or missing element rather than terminating the session.
  • Faults are caught at every boundary, logged, and the session continues safely.

4. Strict isolation per page load

  • Each page load runs in its own sandboxed isolate with a dedicated SandboxOutbound worker handling all network traffic.
  • No component can directly access the network, enforcing CORS, header injection, and per‑page cookie jars.

5. Statelessness wherever possible

  • Stateless components can be killed and recreated instantly, enabling massive parallelism and burst‑scale handling of agent workloads.
  • Only the Engine retains session state; all other workers are disposable.

Architecture at a glance

The Engine

  • Exposes Chrome DevTools Protocol (CDP) over WebSocket and HTTP.
  • Stores session state; all other components are stateless.
  • Compatibility with existing CDP clients (Puppeteer, Playwright, etc.).

PageScript

  • Runs in a Dynamic Worker isolate per page or OOPIF.
  • Parses HTML and CSS using Rust libraries Blitz (HTML) and Stylo (CSS).
  • Executes JavaScript and WebAssembly in‑process; eval is handled by the Boa JS engine until native eval lands in Workers.

PageRenderer

  • Rasterizes the DOM tree into PNG/JPEG/PDF using blitz-paint and the Parley text‑shaping library.
  • Operates as a separate isolate called via Cloudflare Workers’ built‑in RPC system, making each render request retryable and cheap.

Network sandbox – SandboxOutbound

  • The sole component allowed to perform outbound network requests.
  • Enforces CORS, injects browser‑like headers, filters responses, and isolates cookies per page.

Performance and compatibility

Metric Kitesurf Chromium (warm pool) Relative improvement
CPU: screenshot 380 ms 1,173 ms 3.1× less
CPU: HTML extraction 229 ms 877 ms 3.8× less
Memory: screenshot 57.8 MiB 271 MiB 4.7× less
Memory: HTML extraction 39.4 MiB 273.7 MiB 7.0× less
Wall‑time: screenshot 1,148 ms 637 ms 1.8× slower
Wall‑time: HTML extraction 820 ms 472 ms 1.7× slower

CPU and memory savings directly translate to lower billing for both Cloudflare and its customers.

Kitesurf already passes 215,000+ WPT tests, with continuous weekly additions. Coverage includes HTML, CSS, DOM, SVG, XHR, and streams—features most relevant to AI agents.


Community insights from Hacker News

  • Implementation base: The engine builds on the open‑source Blitz rendering engine (Dioxus Labs) – a modular browser core under active development.

    "This is built on top of Blitz… a new modular (open source) browser engine that I've been building for the last 2.5 years." – @nicoburns

  • Potential concerns: Some commenters wonder about Cloudflare’s dual role as CDN and AI‑agent platform, fearing possible bypass of anti‑bot protections.

    "Will Kitesurf in Cloudflare workers get special bypass privileges to content protected by Cloudflare the CDN?" – @QuantumNomad_

  • Use‑case curiosity: Users ask for concrete examples of agents leveraging the browser.

    "Can someone give me examples of where you use agents in your browser?" – @cautiouscat

  • Open‑source hopes: Several participants expressed a desire for the code to be open‑sourced, noting potential fingerprinting risks if the implementation remains closed.

    "wish it was open source so it can be run locally…" – @zuzululu


Getting started with Kitesurf

  1. Browser Run CDP endpoint – Add browser=kitesurf to any Browser Run API call.
    {
      "mcp": {
        "kitesurf": {
          "type": "local",
          "command": [
            "npx",
            "-y",
            "chrome-devtools-mcp@latest",
            "--wsEndpoint=wss://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/browser-run/devtools/browser?browser=kitesurf",
            "--wsHeaders={\"Authorization\":\"Bearer <API_TOKEN>\"}"
          ],
          "enabled": true
        }
      }
    }
    
  2. Quick Action example – screenshot
    curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-run/screenshot?browser=kitesurf' \
      -H 'Authorization: Bearer <apiToken>' \
      -H 'Content-Type: application/json' \
      -d '{"url": "https://example.com"}' \
      --output screenshot.png
    
  3. Playground – Visit https://kitesurf.cloudflare.app/ to type any URL, inspect the DOM, view network activity, and see memory footprints per isolate.

When to choose Kitesurf vs. Chromium

  • Ideal for AI agents that need HTML extraction, screenshots, or PDF generation without pixel‑perfect rendering.
  • Best for bursty, stateless workloads where cost efficiency and isolation are paramount.
  • Not suitable for video playback, WebGL, long‑lived authenticated sessions, or sites that rely on sophisticated TLS fingerprinting.

Roadmap and future work

  • Expand CDP coverage beyond the current subset.
  • Improve rendering fidelity for high‑quality screenshots and PDFs.
  • Increase WPT coverage to approach full web‑platform compatibility.
  • Continue optimizing CPU, memory, and wall‑time benchmarks in collaboration with other Cloudflare platform teams.

Kitesurf represents a bold step toward an agent‑first web platform, delivering a lightweight, isolated, and cost‑effective browser that runs at the edge. Try it today via Browser Run or the public playground, and watch the ecosystem evolve as AI agents become first‑class web citizens.

Sources

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Project