Open Source
Open Source

Obscura: Rust Headless Browser for AI Agents (19.9K Stars)

h4ckf0r0day/obscura (19,954 stars, Rust, Apache-2.0, created 2026-04-13) is an open-source headless browser engine for AI agents and web scrapers, written in Rust with embedded V8, 30MB memory, 85ms page load, built-in anti-fingerprint stealth mode with 3,520-domain tracker blocking, CDP protocol for Puppeteer/Playwright compatibility, and a built-in MCP server for direct AI agent integration.

Published August 4, 20268 min read
<!-- obscura-resource | resource | Obscura: Rust Headless Browser for AI Agents (19.9K Stars) -->

There's a Rust repo on GitHub that amassed nearly 20,000 stars in just under four months. It doesn't build models, sell APIs, or run a cloud service (at least the open-source engine doesn't charge). It does one thing: give AI agents and web scrapers a lightweight, stealthy, high-performance headless browser. This is h4ckf0r0day/obscura. As of August 3, 2026, the repo has 19,954 stars, 1,442 forks, Apache-2.0 license, primary language Rust, created April 13, 2026, last pushed August 1 -- actively maintained. The README opens with one sentence: "The open-source headless browser for AI agents and web scraping. Lightweight, stealthy, and built in Rust." The homepage is obscura.sh, with docs at docs.obscura.sh.

A clarification up front: Obscura is a headless browser engine, not an automation framework. It implements the Chrome DevTools Protocol (CDP), which means you can point Puppeteer or Playwright at it and use it as a drop-in replacement for headless Chrome. This puts it at a different layer from Playwright and Puppeteer themselves (which are frameworks that drive browsers) and from Browser Use (which is an AI agent that runs on top of a browser). The comparison section unpacks this.

What Problem It Solves: AI Agent Browser Automation Blocked by Anti-Bot and Fingerprint Detection

Anyone who has written scrapers or built AI agent browser automation has hit the same wall: scripts that run fine on headless Chrome suddenly fail on anti-bot-heavy sites. The reason is straightforward -- headless Chrome leaves a trail of detectable fingerprint signals: navigator.webdriver is true, canvas/WebGL fingerprints look wrong, the user-agent contains "HeadlessChrome," and variables injected by automation frameworks leak onto the window object. Anti-bot services (Cloudflare, Imperva, DataDome, and the like) use exactly these signals to decide "this isn't a human" and then block or throw a CAPTCHA.

For AI agents this problem is sharper. Today's AI agents increasingly need to actually open web pages, click, fill forms, and read dynamically rendered content -- not call an API, but operate a browser like a human. But if the underlying browser gets flagged as a bot the moment it loads, every step the agent takes is dead on arrival. You can layer anti-detection patches on top of Chrome (puppeteer-extra-plugin-stealth and similar), but that's patching, not solving the problem at the engine level.

That's where Obscura comes in. Rather than patching Chrome, it's a headless browser engine written from scratch in Rust, with anti-detection built into the engine itself. The README provides a comparison table against headless Chrome: memory footprint 30 MB vs 200+ MB; binary size 70 MB vs 300+ MB; anti-detection built-in vs none; page load 85 ms vs ~500 ms; startup instant vs ~2s; Puppeteer and Playwright support on both. These numbers come from the project's own benchmarks and will vary by scenario, but the direction is clear: lighter, faster, anti-detect out of the box.

Core Capabilities: Anti-Fingerprinting, CDP, Rust Performance, Playwright/Puppeteer Compatibility

Obscura's core capabilities break down into four areas.

1. Anti-Fingerprint Detection (Stealth Mode)

Enabled via the --stealth flag or compile-time --features stealth. The README lists specific measures: per-session fingerprint randomization (GPU, screen, canvas, audio, battery); realistic navigator.userAgentData (Chrome 145, high-entropy values); dispatched events with event.isTrusted = true; hidden internal properties (Object.keys(window) is safe); native function masking (Function.prototype.toString() returns [native code]); navigator.webdriver = undefined (matches real Chrome). There's also tracker blocking: 3,520 domains blocked, covering analytics, ads, telemetry, and fingerprinting scripts, stopped at the load stage.

These aren't surface-level tricks like swapping a user-agent string. They eliminate automation traces at the browser engine level. For AI agents, this means the behavioral signature when the agent drives the browser looks closer to a real human, lowering the chance of being blocked.

2. CDP (Chrome DevTools Protocol)

Obscura implements CDP, which is the key to Puppeteer and Playwright compatibility. The README lists implemented CDP domains: Target (create/close targets, browser context management), Page (navigation, frame tree, script injection, lifecycle events), Runtime (evaluate, callFunctionOn, property access, bindings), DOM (querySelector, getOuterHTML, etc.), Network (cookies, headers, UA override), Fetch (live request interception, response body streaming), IO (stream large response bodies), Storage (cookie CRUD), Input (mouse/keyboard event dispatch), and LP (DOM-to-Markdown conversion).

One detail worth noting: the LP domain's getMarkdown method converts DOM directly to Markdown. This is especially useful for AI agents -- what an agent needs is often not raw HTML but structured text, and this capability saves wiring up a separate HTML-to-Markdown conversion library.

3. Rust Performance

The benefit of Rust isn't just "memory safety." Obscura embeds the V8 engine directly to run JavaScript (without Chrome's full browser stack), dramatically reducing memory and startup overhead. The README's benchmarks show: static HTML page load 51 ms (Chrome ~500 ms), JS + XHR + fetch page 84 ms (Chrome ~800 ms), dynamic script page 78 ms (Chrome ~700 ms). These are the project's own numbers; real-world performance depends on page complexity and network conditions, but the Rust + V8 combination has a structural advantage in resource consumption.

For high-concurrency scenarios (say, scraping hundreds of pages simultaneously), 30 MB of memory means the same machine can run more instances. Obscura also provides the obscura scrape command for multi-worker parallel scraping, with --concurrency controlling parallelism (default 10, adjustable higher).

4. Playwright/Puppeteer Compatibility

Because it implements CDP, Obscura serves as a direct replacement for headless Chrome. With Puppeteer, point browserWSEndpoint at Obscura's WebSocket address (ws://127.0.0.1:9222/devtools/browser); with Playwright, use connectOverCDP. Existing scripts need almost no changes. This means migrating from Chrome to Obscura is low-cost -- you don't rewrite your automation logic, you just swap the underlying browser.

How to Get Started: Installation and Example Code

Obscura offers three installation methods.

Method 1: Download precompiled binaries. The GitHub Releases page provides tar.gz packages for Linux x86_64, Linux ARM64, macOS Apple Silicon, and macOS Intel, plus a zip for Windows. For Linux x86_64:

bash
curl -LO https://github.com/h4ckf0r0day/obscura/releases/latest/download/obscura-x86_64-linux.tar.gz
tar xzf obscura-x86_64-linux.tar.gz
./obscura fetch https://example.com --eval "document.title"

No Chrome, no Node.js, no dependencies. Linux builds target Ubuntu 22.04 and need glibc 2.35+. Arch Linux users can use AUR (yay -S obscura-browser); NixOS users use nix-env -iA nixpkgs.obscura. Stealth release archives (filenames ending in -stealth) additionally include the wreq/BoringSSL transport used for TLS fingerprint impersonation.

Method 2: Docker.

bash
docker run -d --name obscura -p 127.0.0.1:9222:9222 h4ckf0r0day/obscura

The image is a multi-stage build on distroless/cc -- no shell, no package manager, ~57 MB compressed.

Method 3: Build from source. Requires Rust 1.75+; first build takes ~5 minutes (V8 compiles from source, cached after).

bash
git clone https://github.com/h4ckf0r0day/obscura.git
cd obscura
cargo build --release

# With stealth mode (anti-detection + tracker blocking)
cargo build --release --features stealth

The stealth build also requires CMake, Clang, and libclang/LLVM dev libraries (to compile BoringSSL for TLS fingerprint impersonation). The default build does not need these extra dependencies.

Quick start centers on three commands. obscura fetch fetches a single page, supporting --dump html/text/links/markdown/assets/original, --eval to run JS, --wait-until networkidle0 for dynamic content, --timeout to bound navigation, and --proxy for routing through a proxy. obscura serve starts a CDP WebSocket server for Puppeteer/Playwright to connect, with --workers for multiple workers, --stealth, and --obey-robots. obscura scrape fetches multiple URLs in parallel.

Puppeteer connection example:

javascript
import puppeteer from 'puppeteer-core';

const browser = await puppeteer.connect({
  browserWSEndpoint: 'ws://127.0.0.1:9222/devtools/browser',
});
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com');
const stories = await page.evaluate(() =>
  Array.from(document.querySelectorAll('.titleline > a'))
    .map(a => ({ title: a.textContent, url: a.href }))
);
console.log(stories);
await browser.disconnect();

Obscura also ships a built-in MCP (Model Context Protocol) server. Running obscura mcp exposes browser automation tools (browser_navigate, browser_snapshot, browser_click, browser_evaluate, and 8 others) to AI agent clients like Claude Desktop and Cursor. This means an AI agent can operate Obscura directly via MCP, without going through Puppeteer as an intermediary -- a practical integration point for agent architectures that want to feed browser capabilities straight to a large model.

Comparison: vs Playwright / Puppeteer / Browser Use

To place Obscura in the browser automation landscape, you first need to clarify the layering: Obscura is a browser engine (the thing being driven), Playwright and Puppeteer are automation frameworks (the thing doing the driving), and Browser Use is an AI agent that runs on top of a browser. They aren't at the same layer, but in practice they get compared.

The relationship with Playwright/Puppeteer is complementary, not competitive. Playwright and Puppeteer aren't browsers themselves -- they need to drive one (usually Chromium). Obscura can be that browser, replacing headless Chrome. So the right question isn't "Obscura or Playwright" but "Obscura or headless Chrome as Playwright's backend." The case for Obscura: lighter, faster, anti-detect built in. The case for headless Chrome: more mature, fuller ecosystem, more battle-tested compatibility.

The comparison with Browser Use (covered in a dedicated article on this site, slug browser-use-resource) is more interesting. Browser Use is an AI browser agent framework -- it lets a large model decide "where to click, what to fill in, which page to go to," and typically runs on headless Chrome underneath. Obscura solves the underlying browser engine problem (lightweight, anti-detect); Browser Use solves the upper-layer agent decision problem (letting the model understand the page and plan actions). The two can compose: use Browser Use for agent decision-making and Obscura as the underlying browser engine, theoretically getting both "AI-driven" and "anti-detect" advantages. The site's "AI Browser Automation Tools Comparison" (slug ai-browser-automation-tools-comparison-review) provides a more systematic side-by-side of this category.

Who It's For + What to Watch Out For

Suitable for: teams doing large-scale web scraping who are troubled by anti-bot blocking; developers building AI agent browser automation who need the underlying browser to evade fingerprint detection; scenarios sensitive to resource consumption (running many browser instances on one machine); teams who want to use Puppeteer/Playwright but are tired of headless Chrome's memory appetite; scenarios that need MCP to expose browser tools directly to AI agents.

Five things to watch.

First, anti-detection isn't foolproof. Obscura's stealth mode does extensive fingerprint masking, but anti-bot is a continuous arms race -- Cloudflare, DataDome, and similar services keep upgrading their detection. Built-in anti-detection blocks most routine checks, but it can't guarantee 100% evasion. Treating it as a silver bullet will get you burned at the wrong moment.

Second, the compliance line is non-negotiable. Anti-detection browsers are dual-use tools, to be used only for authorized testing, operating your own accounts, and compliant data collection; they must not be used for fraud, bypassing CAPTCHAs, or violating target sites' ToS and robots.txt; personal data processing must comply with GDPR and China's Personal Information Protection Law. Obscura's serve command provides an --obey-robots flag to respect robots.txt -- that's tool-level compliance support, but legal compliance responsibility rests with the user. Local laws prevail.

Third, the benchmark data is self-reported. The memory, load-speed, and startup comparisons in the README come from the obscura-benchmark repo, the project's own tests, not independent third-party evaluation. Real performance depends on your pages, network, and hardware -- benchmark in your own scenario before making a selection.

Fourth, ecosystem maturity trails Chrome. Obscura was created in April 2026, only about three months old by August. The CDP implementation covers major domains but may not be 100% compatible with every CDP behavior Chrome exposes; some edge-case APIs may be missing. When you hit incompatibility, check the docs or file an issue. 408 commits and 28 open issues show the project is active, but a young project's stability takes time to verify.

Fifth, the stealth build has a higher barrier. The default build only needs Rust, but stealth mode requires additionally compiling BoringSSL and generating bindings, depending on CMake, Clang, and libclang dev libraries. If you only use precompiled binaries (stealth builds are in Releases), this isn't an issue; but building stealth from source is more complex than the default build.

Take

Obscura captures a real pain point: headless Chrome is too heavy and too easily detected for AI agent and large-scale scraping scenarios. Writing a lightweight, anti-detect, CDP-compatible headless browser engine from scratch in Rust is the right direction -- this isn't something patching Chrome can solve. Nearly 20,000 stars signal the community agrees. But its long-term value hinges on two questions: whether the anti-detection arms race can be kept up, and whether CDP compatibility covers enough real-world scenarios. A three-month-old project is still young; try it on non-critical paths first, benchmark stability before pushing to production. If your AI agent keeps getting blocked by anti-bot, or headless Chrome eats too much memory on your machines, Obscura is worth a serious look.


References

This article is AI-assisted and human-edited. Last updated: 2026-08-04

Related