--stealth to reduce the automation fingerprint, and --connect to attach to a running Chrome instance via CDP.
The Three Tiers
Default
BAP launches Chrome with Playwright defaults. Good for most sites and development workflows.
Stealth
Reduces common bot detection signals. Use when sites block or CAPTCHA standard automation
browsers.
bash bap --stealth goto https://example.com Connect
Attaches to a Chrome instance you launched manually. The gold standard for avoiding detection — it is a real user browser.
--stealth Flag
The stealth flag tells the BAP server to launch the browser with additional anti-detection measures:
browser/launch call and applies to the entire session.
Stealth mode reduces but does not eliminate detection. Sophisticated bot detection systems may
still flag automated browsers. For maximum compatibility, use
--connect.--connect Flag (CDP Attach)
Connect to an existing Chrome instance via the Chrome DevTools Protocol. This is the most reliable way to avoid bot detection because BAP controls a browser you launched manually — with your real profile, extensions, and cookies.
Connect BAP to the running Chrome
chromium.connectOverCDP().Borrowed Browser Lifecycle
When using CDP attach, BAP never closes the external browser:- On disconnect: BAP drops the reference. The browser continues running.
- On
bap close-all: BAP closes its own pages but leaves the browser process intact. - Playwright has no
Browser.disconnect()method, so BAP simply nullifies the reference.
Combining with Sessions
Both flags work with named sessions:When to Use Each Tier
| Scenario | Recommended tier |
|---|---|
| Development and testing | Default |
| Sites with basic bot detection | --stealth |
| Sites with aggressive bot detection (Cloudflare, DataDome) | --connect |
| Using your real logged-in session | --connect |
| CI/CD pipelines | Default + --headless |
| Scraping at scale | --stealth or --connect per site |
Server-Level CDP
The MCP and TypeScript SDK can also use CDP attach via thecdpUrl parameter in browser/launch:
cdpUrl, the browser lifecycle is “borrowed” — BAP never closes the external browser on disconnect or shutdown.