Noureddine RAMDI / Camoufox: a stealthy Firefox fork for AI agents and web scraping

Created Sat, 02 May 2026 20:07:04 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

daijro/camoufox

Camoufox tackles a persistent problem in browser automation: how to operate AI agents and scrapers without triggering anti-bot defenses. Its standout feature is injecting and rotating browser fingerprints at the C++ implementation level, making spoofed properties invisible to JavaScript-based detection. This goes beyond common spoofing methods that only patch JavaScript APIs, offering a more robust stealth approach.

what camoufox is and how it works

Camoufox is an open-source, debloated fork of Firefox designed specifically for AI agent automation and web scraping tasks. At its core, it addresses the challenge of being detected by anti-bot systems, which often rely on fingerprinting techniques to spot automation. Instead of relying on runtime JavaScript spoofing, Camoufox operates under the hood at the browser’s C++ layer, intercepting and injecting spoofed fingerprint data early in the rendering pipeline.

The repo shows heavy use of C++ patches to Firefox’s source code to manipulate browser fingerprint vectors, making them indistinguishable from genuine human-driven browsing. This low-level approach prevents scripts on websites from detecting inconsistencies typically exposed by JavaScript fingerprinting APIs, which is a common blind spot in other automation tools.

Besides fingerprint stealth, the browser is optimized for lightweight operation with a reduced footprint. It removes unnecessary features like CSS animations and tracking scripts to produce clean DOM outputs. This is crucial when used with large language models (LLMs) as it reduces token consumption by avoiding noisy data.

On the integration side, Camoufox offers Python APIs with both synchronous and asynchronous interfaces compatible with Playwright. This design choice makes it possible to slot Camoufox into existing browser automation workflows easily, benefiting from Playwright’s ecosystem and tooling.

Docker support is baked in to facilitate building Camoufox across platforms and architectures, making it easier to deploy on different environments without manual setup.

fingerprint injection at the c++ level: a technical edge

What sets Camoufox apart is its approach to fingerprint spoofing. Most automation tools rely on JavaScript overrides or browser extensions to spoof properties like user agent, screen resolution, or WebGL parameters. These methods are prone to detection because they’re visible to JavaScript and can be bypassed by more sophisticated anti-bot techniques.

Camoufox instead modifies Firefox’s C++ codebase directly. This means spoofed properties are injected before JavaScript even runs, making them invisible to runtime inspection. This approach is technically challenging since it requires deep understanding of Firefox’s internals and careful patching to avoid breaking functionality.

The tradeoff here is complexity and maintenance overhead. Firefox updates frequently, and Camoufox must track upstream changes to keep its patches compatible. This also limits rapid adoption of the latest Firefox features or security patches until merged.

However, for scenarios where stealth is paramount—such as scraping sites with aggressive bot detection or running autonomous AI agents—this approach is more reliable and less detectable.

The code quality in the repo reflects a focus on maintainability within this complexity, with clear separation of patch logic and well-documented Python bindings.

quick start with docker

Camoufox provides a Docker-based build system that works across platforms and architectures. Here are the exact commands from the README to get started:

# Create the Docker image containing Firefox's source code:
docker build -t camoufox-builder .

# Build Camoufox patches to a target platform and architecture:
docker run -v "$(pwd)/dist:/app/dist" camoufox-builder --target <os> --arch <arch>

If you want to use your local ~/.mozbuild directory to cache build artifacts and speed up incremental builds, use:

docker run \
  -v "$HOME/.mozbuild":/root/.mozbuild:rw,z \
  -v "$(pwd)/dist:/app/dist" \
  camoufox-builder \
  --target <os> \
  --arch <arch>

Available Docker CLI parameters include:

Options:
  -h, --help            show this help message and exit
  --target {linux,windows,macos} [{linux,windows,macos} ...]
                        Target platforms to build
  --arch {x86_64,arm64,i686} [{x86_64,arm64,i686} ...]
                        Target architectures to build for each platform
  --bootstrap           Bootstrap the build system
  --clean               Clean the build directory before starting

Example:
$ docker run -v "$(pwd)/dist:/app/dist" camoufox-builder --target windows macos linux --arch x86_64 arm64 i686

Build artifacts will appear in the dist/ folder.

verdict: who should consider camoufox

Camoufox is a solid choice if you need a stealthy browser automation platform that can evade sophisticated anti-bot measures. Its C++ level fingerprint injection is worth understanding if you work in scraping, autonomous AI agents, or any scenario where JavaScript-based spoofing falls short.

The tradeoff is maintaining a custom Firefox fork, which requires tracking upstream changes and potentially dealing with build complexity. For teams comfortable with C++ and browser internals, this is manageable.

The Python API compatibility with Playwright is a plus, allowing integration without rewriting automation logic.

Overall, Camoufox is not for casual users or simple automation tasks but fills a niche for developers needing advanced stealth and token-efficient browsing for AI-driven workflows.


→ GitHub Repo: daijro/camoufox ⭐ 7,694 · C++