WebSocket Configuration
| Setting | Default | Description |
|---|---|---|
| Endpoint | ws://localhost:9222 | WebSocket URL for the BAP server |
| Health check | GET /health | Returns {"status":"ok","version":"0.8.0"} |
| Max message size | 10 MB | Configurable via BAP_MAX_MESSAGE_SIZE env var |
Message Format
All messages follow the JSON-RPC 2.0 specification.Request
Success Response
Error Response
Notification (Server to Client)
Notifications have noid field and expect no response:
Authentication
BAP supports optional token-based authentication via two mechanisms:- Query Parameter
- Header
ws://localhost:9222?token=your-secret-tokenSecurity Features
Domain Allowlist
The server supports a domain allowlist that restricts which URLs can be navigated to:DomainNotAllowed error (code -32041).
Scope-Based Authorization
BAP defines four authorization scopes that control what actions a client can perform:| Scope | Allowed Operations |
|---|---|
| readonly | Observations only (screenshot, accessibility, content, observe) |
| standard | Read + navigation + safe actions (click, fill, type) |
| full | All operations including storage, cookies, file upload |
| privileged | Full + eval, network interception, approval override |
Network Event Redaction
Server-pushed network events automatically redact sensitive headers:authorization,cookie,set-cookiex-api-key,x-auth-token,x-csrf-tokenproxy-authorization- All
postDatais blanket-redacted
URL Validation
All navigation methods (page/navigate, page/create, storage/setState) validate URLs before execution. javascript: protocol and cloud metadata endpoints are blocked.
Connection Management
Auto-Reconnect (Client SDK)
The TypeScript and Python SDKs implement exponential backoff reconnection:Request Timeout
All requests have a 30-second default timeout. Timed-out requests receive aTimeout error (code -32016) with retryable: true.