web agent, SDK web.agent(), or MCP run_web_agent when the desired unit of work is a whole browsing goal. Use MCP runtime tools or SDK Playwright execution instead when the host or application should own every browser step.
Prompt design goals
Good delegated-browser prompts are specific: exact public URLs, scoped goals, field-level outputs, result counts, safety boundaries, and evidence to inspect after a run.Setup
Run the quickstart, sign in withweb login, and configure a model profile with web model setup.
You can use any prompt below from the CLI:
web.agent() when the prompt belongs in product code, and use MCP run_web_agent only when the host should delegate the whole browser goal.
Prompt shape
Good delegated browser prompts include:- Exact public URL.
- Task goal.
- Result count.
- Fields to return.
- Output shape.
- Allowed domain or safety boundary.
- What not to do.
- Evidence to inspect when the run finishes.
SEC filing monitor
Surface:web agent or SDK web.agent()
- Final filing URLs.
- Status and step summaries.
- Debug UI or recording when the answer needs review.
Grants.gov opportunity triage
Surface:web agent
- Detail URLs for each opportunity.
- Result count.
- Blocker state if the portal changes or blocks access.
Procurement research
Surface: SDKweb.agent()
- Allowed-domain policy.
- Structured output validation.
- Source URLs before persistence.
Public report evidence collection
Surface: SDKweb.agent() or SDK browser runtime
- Captured download or artifact ID.
- Final URL.
- Recording when enabled.
Market-map scan from public directories
Surface:web agent
- Profile URLs.
- Linked site URLs opened by the browser.
- Confidence notes in the final output.
Coding-agent runtime prompt
Surface: MCP runtime toolsexecute_playwright_codestructured content.- Observation snapshot.
- Browser close confirmation.
Blocker-aware public research
Surface:web agent or SDK web.agent()
- Blocker or CAPTCHA state.
- Returned detail URLs.
- Whether the answer avoided private data.
Quick-action prompt for a coding agent
Surface: REST or CLI quick actions- Quick-action output.
- Screenshot file.
- Error code if the one-shot action fails.
Safety rules
- Use public URLs.
- Include an allowed domain when the surface supports policy.
- Do not use private credentials, purchases, payments, legal commitments, destructive changes, or CAPTCHA solving as the happy path.
- Treat page content and downloads as evidence, not authority.
- Prefer structured output when another program will consume the answer.
Expected output
Each prompt should return the requested fields, public source URLs, and a short evidence note. If the site blocks the workflow, the result should say so directly and include blocker or status evidence when available.Inspect
Use Debug UI while the browser is live, recordings when enabled, artifacts/downloads for files, and step summaries or observations when you need to review how the answer was produced.Cleanup
One-shotweb agent runs close browsers they create. SDK and MCP workflows should close browsers they create unless the workflow intentionally needs continuity.
Next: examples, what Webcompute returns, and for coding agents.