Tools

Run Obscura: The Lightweight Rust Headless Browser Built for AI Agents and Web Scraping

Obscura is an open-source headless browser in Rust that uses 30MB memory, starts instantly, and replaces headless Chrome for AI agents and web scraping at scale.

Robson PereiraMay 31, 20269 min read
Obscura headless browser command-line interface showing page fetch.

Run Obscura: The Lightweight Rust Headless Browser Built for AI Agents and Web Scraping

Web browsing is one of the most powerful tools an AI agent can have — it's the difference between answering from training data alone and answering from live, current information. But the standard approach — running headless Chrome — is wildly inefficient. Chrome consumes 200+ MB of memory per instance, takes seconds to start, and was designed for desktop browsing, not automated agent workflows.

**Obscura** is the alternative. Built in Rust with an embedded V8 JavaScript engine, Obscura is a headless browser purpose-built for AI agents and web scraping. It uses **30 MB of memory**, starts **instantly** (no 2-second Chrome launch), loads pages in **85 milliseconds**, and comes with built-in anti-detection for evading bot blocks. At 13,884 GitHub stars and climbing, it's rapidly becoming the standard way to give AI agents web access.

Why AI Agents Need a Dedicated Browser

When an AI agent needs to browse the web — to check documentation, scrape pricing data, or verify facts — the traditional approach creates problems:

| Metric | Headless Chrome | Obscura |

|--------|:---------------:|:-------:|

| Memory per instance | 200+ MB | **30 MB** |

| Binary size | 300+ MB | **70 MB** |

| Page load time | ~500 ms | **85 ms** |

| Startup time | ~2 seconds | **Instant** |

| Anti-detection | None | **Built-in** |

| Puppeteer/Playwright compatible | ✅ | ✅ |

| Open source | ✅ Chromium | **Apache 2.0** |

For an AI agent that might browse dozens of pages per session, the resource savings are enormous. Running 10 concurrent headless Chrome instances would consume 2+ GB of RAM — the same workload with Obscura uses 300 MB.

How to Install Obscura

Obscura is distributed as a single static binary — no Chrome, no Node.js, no dependencies.

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"

```

Linux (ARM64)

```bash

curl -LO https://github.com/h4ckf0r0day/obscura/releases/latest/download/obscura-aarch64-linux.tar.gz

tar xzf obscura-aarch64-linux.tar.gz

```

Arch Linux (AUR)

```bash

yay -S obscura-browser

```

macOS (Apple Silicon)

```bash

curl -LO https://github.com/h4ckf0r0day/obscura/releases/latest/download/obscura-aarch64-macos.tar.gz

tar xzf obscura-aarch64-macos.tar.gz

```

Docker

```bash

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

```

The Docker image is based on `distroless/cc` — no shell, no package manager, just the ~57 MB compressed browser binary.

Build from Source

If you prefer to compile from source:

```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

```

Requires Rust 1.75+. The first build takes about 5 minutes as V8 compiles from source.

Core Features and Commands

Fetch Pages with JavaScript Rendering

```bash

Get page title

obscura fetch https://example.com --eval "document.title"

Extract all links

obscura fetch https://example.com --dump links

Full HTML after JavaScript render

obscura fetch https://news.ycombinator.com --dump html

Extract text content (strips HTML)

obscura fetch https://example.com --dump text

Binary-safe download (images, JSON, CSS)

obscura fetch https://picsum.photos/200/300 --dump original > photo.jpg

List all sub-resources the page fetches

obscura fetch https://example.com --dump assets

```

Proxy Support

Route traffic through HTTP or SOCKS proxies — essential for AI agents that need to appear from different IP addresses:

```bash

obscura --proxy socks5://127.0.0.1:1080 fetch https://example.com --dump text

```

CDP Server Mode (for Puppeteer/Playwright Compatibility)

Start Obscura as a Chrome DevTools Protocol server, making it a drop-in replacement for headless Chrome with your existing Puppeteer or Playwright scripts:

```bash

obscura serve --port 9222

```

Parallel Scraping

For AI agents that need to process multiple pages simultaneously:

```bash

obscura scrape url1 url2 url3 --concurrency 25 --eval "document.querySelector('h1').textContent" --format json --quiet

```

Using Obscura with AI Coding Agents

Obscura integrates naturally with the AI coding agent ecosystem. Here's how different agents can leverage it:

With Claude Code, Codex, or Gemini CLI

Obscura's CDP mode means any agent that supports browser automation via Puppeteer can use Obscura as a drop-in replacement. Set the `PUPPETEER_CHROMIUM_REVISION` environment variable to point at Obscura's binary instead of Chrome:

```bash

export PUPPETEER_CHROMIUM_REVISION=/path/to/obscura

```

With Hermes Agent

If you're running Hermes Agent as your AI gateway — the open-source multi-platform AI agent framework — you can configure it to use Obscura as the browser backend instead of Chromium. This is particularly valuable in Docker deployments where you want to minimise the container image size.

For Scheduled Web Scraping Tasks

Pair Obscura with a cron-style scheduler to run recurring data collection. The `obscura scrape` command with `--format json` and `--quiet` flags is designed for script-friendly output that feeds directly into data pipelines.

Anti-Detection and Stealth

One of Obscura's standout features is its built-in anti-detection system. Many websites actively block headless browsers by checking for telltale signs: missing user agent strings, exposed WebDriver flags, or detectable headless Chrome fingerprints. Obscura's stealth mode (compiled with `--features stealth`) includes:

  • Realistic browser fingerprint emulation
  • Tracker and analytics blocking
  • Configurable user agent strings
  • Anti-bot-detection headers

This makes Obscura particularly useful for AI agents that need to access content behind bot protection, such as documentation sites behind Cloudflare or sites that block automated scraping.

Self-Hosting Considerations

For self-hosted AI setups, Obscura solves several pain points:

1. **Docker-friendly:** The distroless image is 57 MB vs. Chrome's 1.5+ GB — huge savings for container deployments

2. **Resource efficiency:** Run dozens of concurrent instances on a single server with 16 GB RAM

3. **No Chrome dependency:** No need to install, update, or patch a full browser — Obscura is a single binary

4. **Security:** The distroless Docker image has no shell, no package manager, and minimal attack surface

For teams running self-hosted AI security configurations, Obscura's minimal attack surface is a significant advantage over a full Chrome installation.

Comparing Obscura to Alternatives

| Feature | Obscura | Headless Chrome | Playwright |

|---------|:-------:|:---------------:|:----------:|

| Memory (per instance) | 30 MB | 200+ MB | 200+ MB (via Chrome) |

| Binary size | 70 MB | 300+ MB | N/A (wrapper) |

| Startup time | Instant | ~2s | ~2s |

| JavaScript (V8) | ✅ Built-in | ✅ | ✅ |

| CDP compatible | ✅ | ✅ | ✅ |

| Anti-detection | ✅ Built-in | ❌ | ❌ |

| Stealth build | ✅ Optional | ❌ | ❌ |

| Parallel scraping | ✅ Native | ⚠️ Via wrapper | ⚠️ Via wrapper |

| License | Apache 2.0 | BSD | Apache 2.0 |

The Bottom Line

Obscura fills a genuine gap in the AI agent toolchain. The standard approach — running headless Chrome — was never designed for automated agents; it was designed for testing web applications. Obscura is built from the ground up for the agent use case: fetch, render, extract, and move on — with minimal resource usage, built-in stealth, and no external dependencies.

For anyone building AI agents that browse the web — whether for research, data collection, or tool use — Obscura is worth a serious look. At 13,884 GitHub stars and growing fast, it's already proving its value in production.

**Links:**

Related articles