L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Déploiement et opérations · SKILL.md

production-integrations

production-integrations

Deploy 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

Documentation de la Skill

GitHub

name: production-integrations description: "Deploy 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/telemetry." disable-model-invocation: true metadata: disco-role: operating license: MIT

Production Integrations

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.

Quick Routing

User needRead
@sandbox, cloud browser execution, profile sync, Cloud REST/API flowsreferences/cloud-and-sandbox.md
MCP server/client setup, hosted skills, cloud skill parameter/cookie validationreferences/mcp-and-skills.md
Slack, Discord, email/2FA, app webhooks, monitoring, telemetry opt-outreferences/integrations-and-monitoring.md
Production failure triage and recovery checklistsreferences/troubleshooting.md

Boundaries

  • For Python Agent(...), run loops, history, callbacks, initial actions, or task prompt design, route to ../agent-programming/SKILL.md.
  • For Browser(...), BrowserSession, BrowserProfile, local Chrome, CDP, proxy, download, HAR, recording, or domain/session parameters, route to ../browser-control/SKILL.md.
  • For custom Tools, ActionResult, parameter injection, file tools, sensitive data, and action security guardrails, route to ../tools-and-actions/SKILL.md.
  • For ChatBrowserUse, provider credentials, structured output schemas, cost calculation, or fallback model selection, route to ../llm-and-output/SKILL.md.
  • For persistent terminal sessions, browser-use/bu CLI commands, --mcp help, doctor/setup/init, and CLI cloud commands, route to ../cli-and-sessions/SKILL.md.

Production Defaults

  • Recommend ChatBrowserUse() for Browser Use automation unless the user has already selected another model; do not replace user-specified model names.
  • Require BROWSER_USE_API_KEY for Browser Use Cloud, @sandbox, cloud skills, profile sync, and cloud MCP.
  • Use hosted cloud browsers for production when the user wants speed, captcha resistance, geo proxies, live streaming, or avoiding local Chromium setup.
  • Use 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.
  • Use cloud profiles for authenticated production workflows instead of embedding passwords in prompts.
  • With secrets, add allowed_domains or equivalent domain restrictions in the owning Browser/Cloud configuration.
  • Keep API keys, app tokens, signing secrets, OAuth client files, and cookies out of code snippets, logs, final output, and committed files.

Minimal Cloud Browser Pattern

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.

Minimal @sandbox Pattern

Use 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:

  • The decorated function must accept injected browser as its first argument and the caller should not pass it.
  • Configure cloud_profile_id for authenticated sessions, cloud_proxy_country_code for geo/captcha needs, and cloud_timeout to cap session runtime.
  • Use callbacks such as 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.

Cloud Task REST Pattern

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"}'

Authentication and Profiles

  • For cloud task authentication, prefer Browser Use profile sync: export BROWSER_USE_API_KEY=... && curl -fsSL https://browser-use.com/profile.sh | sh.
  • Store the returned cloud profile id in a secret manager or deployment variable, then pass it as cloud_profile_id or Cloud API profile_id.
  • If a user asks how to handle production login, recommend profile sync first, then domain-restricted secrets or custom tools only when profile sync is impossible.
  • Do not tell future agents to read original repo examples for profile setup; use references/cloud-and-sandbox.md.

MCP and Hosted Skills

  • Local MCP server exposes Browser Use automation to MCP clients via stdio; details live in references/mcp-and-skills.md.
  • Cloud MCP exposes Browser Use hosted tools over HTTP and requires the Browser Use API key header.
  • 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.
  • Cloud SkillService fetches and executes hosted skills and validates inputs with Pydantic; missing cookies are explicit failures to recover via login/profile setup.

App Integration Pattern

For Slack, Discord, email, or webhook apps, use this shape:

  1. Verify the inbound request signature or bot token before accepting the task.
  2. Deduplicate event ids or message ids to avoid duplicate browser runs.
  3. Acknowledge quickly if the platform has a short response deadline.
  4. Run Browser Use asynchronously in a worker or background task.
  5. Use headless or cloud browser defaults in production; use cloud profiles for logged-in accounts.
  6. Return history.final_result() or structured output, not raw chain-of-thought or secrets.

Read references/integrations-and-monitoring.md for platform-specific patterns.

Observability

  • For Browser Use anonymous telemetry, set ANONYMIZED_TELEMETRY=false before importing Browser Use to opt out.
  • For cloud sync and hosted run views, authenticate with Browser Use Cloud and keep sync enabled.
  • For third-party monitoring, Laminar and OpenLIT patterns are evidence-backed; keep vendor keys in environment variables.
  • For production support tickets, collect task id/session id, live URL if safe, timestamps, model name, Browser Use version, and sanitized error logs.

Troubleshooting Entry Points

  • 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.
  • Sandbox has no live URL: add on_browser_created callback and check API key/cloud connectivity.
  • Cloud skill reports missing cookie: run with an authenticated cloud profile or navigate/login so required cookies are available.
  • App integration times out: acknowledge immediately and move Browser Use work to a background task.
  • Telemetry concerns: set ANONYMIZED_TELEMETRY=false and restart the process.

Read references/troubleshooting.md for step-by-step diagnostics.

Handoff Checklist

Before returning a production integration answer:

  • State which runtime mode is being used: local code plus cloud browser, @sandbox, REST Cloud API, MCP, hosted skills, or external app integration.
  • List required env vars without revealing values.
  • Include one short validation command or import check.
  • Mention safe defaults: ChatBrowserUse, profile sync for auth, domain restrictions with secrets, and runtime/session caps.
  • Cross-link sibling sub-skills only for their owned details.
Skills enregistrées