Stealth Browser: How AI Agents Bypass Bot Detection
Source: Dev.to
Problem Overview
Most AI browser automation fails immediately: Cloudflare blocks it, DataDome flags it, CAPTCHAs appear, and the agent gets stuck.
Stealth Browser Engine
Bridge ACE includes a stealth browser engine that passes bot detection. It is built on Patchright, a Playwright fork with anti‑fingerprint hardening.
When you run Playwright or Puppeteer, websites can detect automation through:
navigator.webdriver = true- Missing Chrome plugins and extensions
- Inconsistent
navigator.userAgentData - SwiftShader GPU (headless giveaway)
- Missing
speechSynthesisvoices - WebRTC IP leaks
- Predictable mouse movements and timing
The stealth browser applies comprehensive evasions:
bridge_stealth_start(
stealth_level='high', # low/medium/high/paranoid
headless=False, # Real GPU — SwiftShader is instant detection
disable_webrtc=True, # Prevent IP leaks
inject_client_hints=True, # navigator.userAgentData
inject_speech_api=True # speechSynthesis voices
)
What Gets Patched
- AutomationControlled flag disabled
- Client Hints injected (
sec-ch-uaheaders) - Speech API mocked with realistic voices
- WebRTC IP leak protection
- Screen overrides for consistent fingerprint
performance.memoryspoofed- Timing jitter — human‑like delays between actions
Browser Automation Levels
Bridge ACE provides three levels of browser automation:
Fast, Reliable (Internal Tools & APIs)
bridge_browser_navigate(url='...')
bridge_browser_click(selector='#submit')
Passes most bot detection for protected websites.
Stealth Navigation
bridge_stealth_goto(url='https://protected-site.com')
bridge_stealth_fill(selector='input', value='...')
Attach to User’s Real Chrome
Inherits all sessions, cookies, and extensions.
bridge_cdp_connect(port=9222)
bridge_cdp_navigate(url='https://linkedin.com')
# Full access to logged‑in sessions
CAPTCHA Solving
When stealth is not enough and a CAPTCHA appears:
bridge_captcha_solve(
captcha_type='recaptcha_v2',
website_url='https://example.com',
website_key='site-key-here'
)
Supports reCAPTCHA v2/v3, hCaptcha, Cloudflare Turnstile, and FunCaptcha via CAPSolver, 2Captcha, or Anti‑Captcha.
Repository
All three browser engines and the CAPTCHA integration are available in the repository:
git clone https://github.com/Luanace-lab/bridge-ide.git