Quick Example
The simplest happy path: start a BrowserBox, get a WebSocket endpoint, connect with local Playwright, and open a page.async with block exits, the box stops and is cleaned up automatically (auto_remove is enabled by default).
Reference and troubleshooting
BrowserBox construction options, the two connection modes, the port model, and the full troubleshooting list
(Playwright version pinning, WebKit limits, port conflicts, connection timeouts) are documented once on
Browser automation — that page is the reference for both the agent-driven
and the human-driven paths.
Take over the browser from your own DevTools
The Quick Example above connects a script to the box. To drive the browser by hand instead, ask for the Chrome DevTools Protocol (CDP) address and paste it intochrome://inspect — you then inspect pages and tune selectors in
your own DevTools while the browser itself stays inside the sandbox.
endpoint()andplaywright_endpoint()are mutually exclusive on one instance — calling the second one after the first raisesRuntimeError. Pick the CDP endpoint for hands-on debugging, the Playwright endpoint for scripts.
Related pages
- Browser automation — full
BrowserBoxreference, both connection modes, and troubleshooting - Share a desktop — when you need a full graphical desktop rather than a browser
- Network access — port publishing model

