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
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