writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
production-integrationsDeploy and integrate Browser Use with sandbox execution, Browser Use Cloud, MCP, hosted skills, profile sync, observability, telemetry, and external app integrations. Use for production deployment prompts, cloud profiles/proxies, live session monitoring, MCP server/client setup, cloud skill execution, Slack/Discord/email app patterns, and monitoring/telemet…
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the user wants Browser Use running in production or wired into another product, service, or agent platform. Keep advice safe by default: use environment variables for secrets, constrain domains when secrets are present, prefer cloud profiles for authentication, and validate every external service dependency before launching long-running tasks.
| User need | Read |
|---|---|
@sandbox, cloud browser execution, profile sync, Cloud REST/API flows | references/cloud-and-sandbox.md |
| MCP server/client setup, hosted skills, cloud skill parameter/cookie validation | references/mcp-and-skills.md |
| Slack, Discord, email/2FA, app webhooks, monitoring, telemetry opt-out | references/integrations-and-monitoring.md |
| Production failure triage and recovery checklists | references/troubleshooting.md |
Agent(...), run loops, history, callbacks, initial actions, or task prompt design, route to ../agent-programming/SKILL.md.Browser(...), BrowserSession, BrowserProfile, local Chrome, CDP, proxy, download, HAR, recording, or domain/session parameters, route to ../browser-control/SKILL.md.Tools, ActionResult, parameter injection, file tools, sensitive data, and action security guardrails, route to ../tools-and-actions/SKILL.md.ChatBrowserUse, provider credentials, structured output schemas, cost calculation, or fallback model selection, route to ../llm-and-output/SKILL.md.browser-use/bu CLI commands, --mcp help, doctor/setup/init, and CLI cloud commands, route to ../cli-and-sessions/SKILL.md.ChatBrowserUse() for Browser Use automation unless the user has already selected another model; do not replace user-specified model names.BROWSER_USE_API_KEY for Browser Use Cloud, @sandbox, cloud skills, profile sync, and cloud MCP.Browser(use_cloud=True) for Python workflows that need a hosted browser but still run locally; use @sandbox when the whole browser automation function should execute in Browser Use managed infrastructure.allowed_domains or equivalent domain restrictions in the owning Browser/Cloud configuration.Use this when the app code stays local but the browser should run on Browser Use Cloud:
import asyncio
from browser_use import Agent, Browser, ChatBrowserUse
async def main():
browser = Browser(use_cloud=True)
agent = Agent(
task="Check the current page title and summarize it.",
browser=browser,
llm=ChatBrowserUse(),
)
history = await agent.run(max_steps=10)
print(history.final_result())
asyncio.run(main())
Validation before running:
python - <<'PY'
import os
from browser_use import Agent, Browser, ChatBrowserUse, sandbox
print('browser-use imports ok')
print('BROWSER_USE_API_KEY set:', bool(os.getenv('BROWSER_USE_API_KEY')))
PY
If the task also needs low-level Browser parameters such as cdp_url, allowed_domains, record_video_dir, or proxy objects, read ../browser-control/SKILL.md.
@sandbox PatternUse this when the user wants the function itself deployed to managed infrastructure with live browser view callbacks:
import asyncio
from browser_use import Agent, Browser, ChatBrowserUse, sandbox
@sandbox(log_level="INFO")
async def run_task(browser: Browser, task: str) -> str | None:
agent = Agent(task=task, browser=browser, llm=ChatBrowserUse())
history = await agent.run(max_steps=20)
return history.final_result()
asyncio.run(run_task("Find the top Hacker News story title."))
Operational notes:
browser as its first argument and the caller should not pass it.cloud_profile_id for authenticated sessions, cloud_proxy_country_code for geo/captcha needs, and cloud_timeout to cap session runtime.on_browser_created, on_log, on_result, and on_error when the host app needs live URL, progress logs, or failure alerts.@sandbox serializes the function and captured inputs for remote execution; keep captured objects small and serializable.Use direct REST when a service wants task-in/result-out cloud execution without embedding the Python library:
curl -X POST https://api.browser-use.com/api/v2/tasks \
-H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"task":"Search for the top Hacker News post and return title and URL."}'
Then fetch the returned session to watch live execution:
curl "https://api.browser-use.com/api/v2/sessions/$SESSION_ID" \
-H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY"
Stop a session when it is no longer needed:
curl -X PATCH "https://api.browser-use.com/api/v2/sessions/$SESSION_ID" \
-H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"stop"}'
export BROWSER_USE_API_KEY=... && curl -fsSL https://browser-use.com/profile.sh | sh.cloud_profile_id or Cloud API profile_id.references/cloud-and-sandbox.md.references/mcp-and-skills.md.MCPClient can register external MCP tools into a Browser Use Tools registry; if the tool is domain/file/security-sensitive, read ../tools-and-actions/SKILL.md.SkillService fetches and executes hosted skills and validates inputs with Pydantic; missing cookies are explicit failures to recover via login/profile setup.For Slack, Discord, email, or webhook apps, use this shape:
history.final_result() or structured output, not raw chain-of-thought or secrets.Read references/integrations-and-monitoring.md for platform-specific patterns.
ANONYMIZED_TELEMETRY=false before importing Browser Use to opt out.ValueError: BROWSER_USE_API_KEY environment variable is not set: set it in the process environment used by the app, worker, MCP client, or sandbox caller.MCP SDK not installed: install Browser Use with CLI/MCP-capable extras or add mcp to the environment; then retry the MCP command.on_browser_created callback and check API key/cloud connectivity.ANONYMIZED_TELEMETRY=false and restart the process.Read references/troubleshooting.md for step-by-step diagnostics.
Before returning a production integration answer:
@sandbox, REST Cloud API, MCP, hosted skills, or external app integration.ChatBrowserUse, profile sync for auth, domain restrictions with secrets, and runtime/session caps.