Skip to main content
Browser Use turns a task into browser actions. This example runs both the agent and Chromium inside one isolated microsandbox.
The browser image is large. Its first pull and Python package install can take a few minutes. Use a snapshot to avoid repeating that setup.

Run Browser Use

1

Create the agent

Save this as browser-use-task.py:
2

Start the sandbox

Export a Browser Use API key, then run the task. The secret stays on the host and can only be substituted into requests to Browser Use’s model endpoint.
The agent prints its final result and exits. The Browser Use browser session uses the Chromium already included in the image, so it does not download a second browser.
--secret routes egress through microsandbox’s TLS-terminating proxy. Chromium reads its own NSS store, not SSL_CERT_FILE or NODE_EXTRA_CA_CERTS, so without the certutil step above every page load fails with net::ERR_CERT_AUTHORITY_INVALID and the agent burns steps clicking through the interstitial. Importing /.msb/tls/ca.pem into $HOME/.pki/nssdb is what makes navigation clean.
3

Clean up

Remove the stopped sandbox and unset the API key:

Reference