Overview
Chrome DevTools Protocol (CDP) is the raw browser debugging protocol built into Chrome and Chromium-based browsers. BAP sits above CDP, using Playwright as an intermediary, and adds agent-oriented abstractions.Comparison
| Dimension | BAP | Chrome DevTools / CDP |
|---|---|---|
| Level | Agent-ready workflow layer | Raw browser debugging protocol |
| Selectors | 10 semantic types (role, text, label, ref, testId, …) | Manual DOM queries, Runtime.evaluate |
| Multi-step actions | act batches steps with retry and conditions | Compose sequences yourself |
| Observation | Structured elements with refs, action hints, bounds | Roll your own from Accessibility + DOM domains |
| Extraction | extract with JSON Schema | Custom Runtime.evaluate scripts |
| Token efficiency | Response tiers, fusion, incremental observe | Depends on your orchestration |
| Browser support | Chromium, Firefox, WebKit | Chromium only |
| Session management | Built-in persistence, dormant sessions | Manual |
| Error recovery | Recovery hints, self-healing selectors | Raw protocol errors |
When to Use CDP
Use CDP when you need
- Direct access to CDP domains (Performance, Profiler, Memory, Network conditions) - Custom debugging and profiling instrumentation - Low-level network interception with full headers - Service Worker and Cache API inspection - Chrome-specific features not exposed by Playwright
Use BAP when you need
- AI agent browser automation - Semantic element targeting that survives redesigns - Multi-step workflows with error recovery - Structured data extraction without writing JS - Cross-browser support (Chromium + Firefox + WebKit) - Token-efficient agent communication
BAP + CDP Together
BAP supports connecting to a browser via CDP for hybrid workflows:- Launch Chrome with
--remote-debugging-port=9222 - Open
chrome://inspectfor live DevTools access - Connect BAP with
--connect=ws://localhost:9222 - Debug with DevTools while BAP automates
CDP Complexity BAP Handles For You
What you would need to implement yourself with raw CDP:| Capability | CDP Implementation | BAP Equivalent |
|---|---|---|
| Click a button by label | DOM.querySelector + Runtime.evaluate to find by text + Input.dispatchMouseEvent | client.click(label("Submit")) |
| Fill a form | Multiple DOM.focus + Input.insertText calls per field | client.act([step("action/fill", ...), ...]) |
| Get interactive elements | Accessibility.getFullAXTree + manual filtering + ref tracking | client.observe() |
| Extract structured data | Runtime.evaluate with custom extraction JS | client.extract({ schema }) |
| Handle navigation | Page.navigate + Page.loadEventFired + error handling | client.navigate(url) |
| Cross-browser | Not possible (CDP is Chrome-only) | Built-in via Playwright |