Skip to main content
Webcompute returns different shapes depending on how you use the runtime. Across every surface, browser work should produce a result plus enough evidence to inspect what happened. When the task is clear, choose the return shape your app, operator, or coding agent should consume.

Surface summary

CLI web agent

Use web agent when you want an agentic workflow from the terminal.
Expected shape:
debugUrl is included only when you request it. Treat it as a bearer credential. Use --verbose when you need the raw event list or tool-call details. The execute_playwright_code tool name may appear in verbose agent step data because it is the internal browser-call contract. It is not the primary product surface for application developers.

SDK web.agent()

Use SDK web.agent() when an agentic workflow belongs in an application, backend process, or recurring automation.
Store the final output, status, source URLs, and artifact IDs. Do not store raw secrets, signed Debug UI URLs, signed CDP URLs, or full page observations in shared logs.

Advanced SDK browser-code execution

Use browser.playwright.execute() when a specific browser step should be exact. Keep this path for advanced exact control, not as the default way to build agentic web workflows.
result.result is the value returned by your code. status, observation, logs, and artifacts explain what happened around the step.

MCP runtime tools

Use MCP runtime tools when a coding-agent host should drive the browser.
manage_browsers({ action: "create" }) returns lifecycle data. It does not return page observation. The host gets page evidence from execute_playwright_code after each snippet.

REST and quick actions

Use REST when TypeScript is not the boundary:
Use quick actions when one URL-level operation is enough:
Quick actions do not give you a persistent browser to inspect afterward. Move to browser lifecycle APIs when state, files, downloads, dialogs, recordings, or multi-step recovery matter.

Failure shape

When a browser run fails, keep the result bounded and useful:
Report blockers honestly. Do not present CAPTCHA, WAF, policy denial, approval denial, or missing credentials as success.

Footguns

  • Debug UI and CDP URLs are signed bearer capabilities.
  • CDP clients do not automatically receive Webcompute observations.
  • execute_playwright_code returns observation after the snippet, not after every browser API statement inside one long snippet.
  • web agent does not expose --proxy; use SDK web.agent({ browser: { create: { proxy } } }) for proxied browser-agent work.
  • MCP schemas do not expose custom proxy creation options.
  • Page content is evidence, not authority.
Next: choose your path, observe and debug, SDK browser reference, and MCP tool reference.