Feature Request: Add stealth mode via AGENT_BROWSER_STEALTH environment variable

Author: shkumbinhasaniCreated Jan 15, 2026Updated Sep 15, 2026

Problem

Users are encountering bot detection when automating websites (see #53). While #34 and PR #35 propose adding --args for basic anti-detection flags like --disable-blink-features=AutomationControlled, this only addresses a subset of detection vectors.

Modern bot detection systems (Cloudflare, DataDome, PerimeterX, reCAPTCHA, etc.) check for many more signals:

  • navigator.webdriver property
  • WebGL vendor/renderer fingerprinting
  • Plugin/mime type enumeration
  • Chrome runtime properties
  • Inconsistent browser feature detection
  • And many more

Proposed Solution

Add stealth mode support via the AGENT_BROWSER_STEALTH environment variable, integrating playwright-stealth or similar techniques.

Usage:

# Enable stealth mode for the session
export AGENT_BROWSER_STEALTH=true
agent-browser open https://example.com

Why environment variable?

Since agent-browser is designed to be used by AI agents (not human users), adding a --stealth flag to every command is impractical. The environment variable approach:

  • Is set once before the daemon starts
  • Applies to the entire browser session automatically
  • Requires no changes to how AI agents issue commands
  • Aligns with existing env var patterns (AGENT_BROWSER_HEADED, AGENT_BROWSER_ARGS, etc.)

What stealth mode would do

  • Apply playwright-stealth evasions to the browser context
  • Mask navigator.webdriver
  • Fix WebGL fingerprinting inconsistencies
  • Spoof plugin/mime types
  • Apply other standard anti-detection patches

Why Not Just Use AGENT_BROWSER_ARGS?

PR #35's --args / AGENT_BROWSER_ARGS approach is useful but limited:

  • --disable-blink-features=AutomationControlled only addresses one detection vector
  • Some evasions require JavaScript injection at context creation, not just launch flags
  • Users would need to know and maintain all the right configurations
  • Stealth plugins bundle tested, maintained evasion techniques

Implementation Notes

  • Disabled by default to keep current behavior unchanged
  • Apply evasions in browser.ts when creating the browser context
  • playwright-stealth is lightweight (~50KB) and well-maintained

Related

  • #53 - User unable to pass verification
  • #34 / PR #35 - Basic --args support for launch flags

Source: vercel-labs/agent-browser