Skip to main content

1. Basic Deployment

Wrap your existing local code with @sandbox():
from browser_use import Browser, sandbox, ChatBrowserUse
from browser_use.agent.service import Agent
import asyncio

@sandbox()
async def my_task(browser: Browser):
    agent = Agent(task="Find the top HN post", browser=browser, llm=ChatBrowserUse())
    await agent.run()

# Just call it like any async function
asyncio.run(my_task())
That’s it - your code now runs in production at scale. We handle agents, browsers, persistence, and LLMs.

2. Add Proxies for Stealth

Use country-specific proxies to bypass captchas, Cloudflare, and geo-restrictions:
@sandbox(cloud_proxy_country_code='us')  # Route through US proxy
async def stealth_task(browser: Browser):
    agent = Agent(task="Your task", browser=browser, llm=ChatBrowserUse())
    await agent.run()

3. Sync Local Cookies to Cloud

To use your local authentication in production: First, create an API key at cloud.browser-use.com/new-api-key or follow the instruction on Cloud - Profiles Then, sync your local cookies:
export BROWSER_USE_API_KEY=your_key && curl -fsSL https://browser-use.com/profile.sh | sh
This opens a browser where you log into your accounts. You’ll get a profile_id. Finally, use it in production:
@sandbox(cloud_profile_id='your-profile-id')
async def authenticated_task(browser: Browser):
    agent = Agent(task="Your authenticated task", browser=browser, llm=ChatBrowserUse())
    await agent.run()
Your cloud browser is already logged in!
For more sandbox parameters and events, see Sandbox Quickstart.