Use a live browser session when you need to see the page the agent is working with.
CLI
Ask web agent to include a signed Debug UI URL while the run is active:
web agent \
--debug-url \
--url https://www.sec.gov/edgar/search/ \
--allow-domain sec.gov \
"Find Apple's latest 10-Q filings and return filing metadata."
Use --debug-url only when the person or system receiving the output should control the live browser.
SDK
For post-run inspection, own the browser lifetime with an agent session or an explicitly created browser. A one-shot agent.run(...) closes an implicitly created browser when the run completes.
const session = await agent.session({
startUrl: "https://www.sec.gov/edgar/search/",
});
const browser = await web.browser.get(session.browserId);
const debugUrl = await browser.debugUrl();
try {
const result = await session.run("Find Apple's latest 10-Q filings.");
console.log(result.text);
} finally {
await session.close();
}
A Debug UI URL is a signed bearer capability. Do not paste it into shared logs or untrusted prompts.
What to look for
- Final URL and page title.
- Visible blocker or login state.
- Unexpected navigation.
- Dialogs or downloads.
- Whether the page matches the agent’s final answer.
Use recordings when the browser should be inspectable after it closes.