Skip to main content
Sandbox settings control how your Browser Use code runs in production environments with cloud-hosted browsers.
Sandboxes are the easiest way to run Browser Use in production. They handle agents, browsers, persistence, auth, cookies, and LLMs with minimal latency.See Going to Production for the complete guide.

Quick Start

Wrap your function with @sandbox() to run it in production:

Cloud Browser Parameters

use_cloud

bool
default:"False"
Enable Browser Use cloud browser service.Automatically provisions a remote browser optimized for automation.Example:

cloud_profile_id

string
UUID of a browser profile to use.If not specified, uses the default profile.Get profile ID:
See Going to Production for details.

cloud_proxy_country_code

string
Country code for proxy location.Supported countries: us, uk, fr, it, jp, au, de, fi, ca, inUse cases:
  • Bypass captchas
  • Bypass Cloudflare protection
  • Access geo-restricted content
Example:

cloud_timeout

int
Session timeout in minutes.Limits:
  • Free users: max 15 minutes
  • Paid users: max 240 minutes
Example:

Authentication Setup

Prerequisites

  1. Get an API key from cloud.browser-use.com/new-api-key
  2. Set the environment variable:

Sync Local Cookies to Cloud

To use your local authentication in production:
This:
  1. Opens a browser where you log into your accounts
  2. Syncs cookies to the cloud
  3. Returns a profile_id

Use Authenticated Profile

Your cloud browser is already logged in!

Sandbox Decorator Parameters

All parameters are optional:
string
Browser profile ID for authentication
string
Proxy country code (us, uk, fr, etc.)
int
Session timeout in minutes

Complete Example


Benefits of Cloud Sandboxes

Zero Setup

No local browser configuration or dependencies needed

Built for Scale

Handle millions of agents with automatic resource management

Lowest Latency

Agent runs next to the browser for minimal network overhead

Anti-Bot Protection

Bypass captchas, Cloudflare, and bot detection automatically

Global Proxies

Access geo-restricted content with country-specific proxies

Authentication

Sync local cookies to cloud for seamless authenticated sessions

Advanced Configuration

For more sandbox parameters and events, see Sandbox Quickstart.