Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

GL Browser Use

GL Browser Use is a typed Python SDK for running browser automation tasks through browser-use. It provides a stable client facade, structured stream events, explicit result objects, optional Steel or OpenSandbox browser infrastructure, optional MinIO/S3-compatible recording storage, and bounded retries for recoverable browser-session failures.

Installation

Install the core SDK:

pip install gl-browser-use

Install optional providers only when you need them:

pip install "gl-browser-use[steel]"           # Steel browser infrastructure
pip install "gl-browser-use[opensandbox]"     # OpenSandbox browser infrastructure
pip install "gl-browser-use[infrastructure]"  # All browser infrastructure providers
pip install "gl-browser-use[minio]"           # MinIO/S3-compatible object storage
pip install "gl-browser-use[storage]"         # All object storage providers
pip install "gl-browser-use[full]"            # Infrastructure + storage providers

Use the concrete extras (steel, opensandbox, minio) in application dependency files when you want to pin exactly which provider you depend on. The slot extras (infrastructure, storage, full) are convenience aliases and may include more providers later.

Quick Start

BrowserUseClient supports streaming and non-streaming execution. API keys can be passed directly or read from environment variables.

import asyncio

from gl_browser_use import BrowserUseClient, BrowserUseClientConfig
from gl_browser_use.infrastructure import SteelBrowserInfrastructure
from gl_browser_use.storage import MinIOS3CompatibleStorage


async def main() -> None:
    client = BrowserUseClient(
        config=BrowserUseClientConfig(
            llm_openai_api_key="...",
            page_extraction_llm_openai_api_key="...",
            max_session_retries=2,
            session_retry_delay_in_s=3.0,
        ),
        infrastructure=SteelBrowserInfrastructure(),  # reads STEEL_API_KEY by default
        storage=MinIOS3CompatibleStorage.from_environment(),
    )

    async for event in client.run("Open Hacker News and list five article titles"):
        print(event.content)


asyncio.run(main())

For a single aggregated result:

from gl_browser_use import BrowserUseClient, BrowserUseClientConfig
from gl_browser_use.infrastructure import SteelBrowserInfrastructure

client = BrowserUseClient(
    config=BrowserUseClientConfig(
        llm_openai_api_key="...",
        page_extraction_llm_openai_api_key="...",
    ),
    infrastructure=SteelBrowserInfrastructure(),
)

result = client.run_sync("Open Hacker News and list five article titles")

print(result.status)
print(result.final_output)
print(result.session_id)
print(result.streaming_url)
print(result.recording_url)
print(result.metadata)

Configuration

BrowserUseClientConfig validates required values when the client is created. If llm_openai_api_key or page_extraction_llm_openai_api_key is not passed, both default to OPENAI_API_KEY.

Common client options:

  1. llm_openai_model: primary browser-control model. Default: o3.
  2. page_extraction_llm_openai_model: page extraction model. Default: gpt-5-mini.
  3. sensitive_data: optional browser-use placeholder map. It accepts either a flat placeholder-to-value map or a domain-scoped map. Values are excluded from normal config serialization and redacted from redacted_dict() output.
  4. extend_system_message: optional system prompt extension.
  5. vision_detail_level: auto, low, or high. Default: auto.
  6. llm_timeout_in_s: optional LLM timeout.
  7. step_timeout_in_s: per-step browser timeout. Default: 180.
  8. agent_kwargs: additional browser_use.Agent constructor arguments. It cannot override SDK-managed arguments such as the task, LLMs, browser session, sensitive_data, or timeouts.
  9. enable_cloud_sync: controls browser-use cloud sync. Default: False.
  10. logging_level: debug, info, warning, error, or result. Default: info.
  11. max_session_retries: recoverable session retries. Default: 2.
  12. session_retry_delay_in_s: delay between retries. Default: 3.0.

Sensitive data and Agent options

config = BrowserUseClientConfig(
    llm_openai_api_key="...",
    page_extraction_llm_openai_api_key="...",
    sensitive_data={"username": "example-user", "password": "example-password"},
    agent_kwargs={"use_vision": False, "max_actions_per_step": 2},
)

Keep one configured client per credential scope. Browser-use also accepts domain-scoped sensitive_data maps. Never put real values in logs, serialized configuration, or agent_kwargs.

When supplying sensitive data, restrict browser navigation to the expected domains (for example, through the infrastructure session's browser-use BrowserProfile(allowed_domains=...)) to reduce prompt-injection exfiltration risk. agent_kwargs cannot override browser/session ownership (browser, browser_profile, and browser_session are reserved); configure those controls through the selected infrastructure instead.

Optional provider environment variables:

  1. STEEL_API_KEY: used by SteelBrowserInfrastructure() when api_key is not passed.
  2. OPENSANDBOX_DOMAIN: OpenSandbox control-plane host. Default: localhost:8080.
  3. OPENSANDBOX_API_KEY: required for shared OpenSandbox clusters; optional for local insecure servers.
  4. OBJECT_STORAGE_URL: MinIO/S3 endpoint, for example localhost:9001 or https://storage.example.
  5. OBJECT_STORAGE_USERNAME: object storage access key.
  6. OBJECT_STORAGE_PASSWORD: object storage secret key.
  7. OBJECT_STORAGE_BUCKET_NAME: target bucket name.
  8. OBJECT_STORAGE_DIRECTORY_PREFIX: optional object key prefix.
  9. OBJECT_STORAGE_SECURE: true for HTTPS when the endpoint has no scheme.

Copy .env.example to .env for local development, then load it with your application environment manager.

Runtime API

The client exposes three run methods:

  1. run(task): async generator that yields BrowserUseStreamEvent values as work progresses.
  2. run_once(task): async method that returns one BrowserUseRunResult and includes emitted events in result.events.
  3. run_sync(task): blocking wrapper around run_once() using asyncio.run().

Do not call run_sync() from an already running event loop. Use await run_once() or async for event in run() in async applications.

Cancelling the stream by breaking from async for or calling await stream.aclose() cancels the underlying run task. Browser sessions and infrastructure sessions are released in cleanup.

Result Contract

BrowserUseRunResult contains:

  1. status: success, error, or cancelled.
  2. task: normalized task string.
  3. final_output: final text extracted from the underlying agent, or Task completed when no final text is available.
  4. session_id: infrastructure session ID when an external browser session was used.
  5. streaming_url: browser debug or streaming URL when available.
  6. recording_url: expected recording URL when recording is configured.
  7. steps: number of browser-use steps executed.
  8. error: terminal error message for error results.
  9. events: collected stream events for run_once().
  10. metadata: attempt, retry, and recording metadata.

Recording metadata uses these statuses:

  1. disabled: infrastructure, storage, or browser context is not available.
  2. unsupported: the selected infrastructure does not support recording.
  3. unavailable: storage is configured but not available.
  4. scheduled: a background recording upload has been scheduled.
  5. unknown: recording may have started, but the terminal error did not include enough context to determine the final state.

Streaming Contract

BrowserUseStreamEvent contains:

  1. event_type
  2. content
  3. thinking_and_activity_info
  4. is_final
  5. tool_info
  6. metadata

Important event content values:

  1. Receive streaming URL: emitted when a browser debug or streaming URL is available.
  2. Receive recording URL: emitted when a recording URL can be resolved.
  3. Task completed: emitted for the final successful step.

Activity events encode iframe URLs in thinking_and_activity_info["data_value"] as a JSON string:

{"type": "iframe", "message": "<url>"}

Step events include serialized tool calls in tool_info["tool_calls"].

Retries And Errors

The client retries only classified recoverable browser-session failures, such as browser closure or websocket disconnect messages. Before each retry, it emits a retry status event. Retries are bounded by max_session_retries, so total attempts are max_session_retries + 1.

Non-recoverable task failures return BrowserUseRunResult(status="error"). Recoverable failures that exhaust all attempts raise BrowserUseRetryExhaustedError.

SDK error types:

  1. BrowserUseConfigurationError: missing or invalid runtime configuration.
  2. BrowserUseDependencyError: optional provider dependency problem.
  3. BrowserUseMissingDependencyError: optional provider extra is not installed.
  4. BrowserUseExecutionError: execution-time failure.
  5. BrowserUseRetryExhaustedError: recoverable session retries were exhausted.

Optional Providers

Optional providers are lazy-loaded. Importing gl_browser_use does not require Steel, OpenSandbox, or MinIO to be installed.

from gl_browser_use.infrastructure import OpenSandboxBrowserInfrastructure, SteelBrowserInfrastructure
from gl_browser_use.storage import MinIOS3CompatibleStorage

SteelBrowserInfrastructure creates Steel browser sessions and provides CDP/streaming URLs.

OpenSandboxBrowserInfrastructure provisions the repo-committed Chrome example image (opensandbox/chrome:latest, built from examples/opensandbox/chrome) through a local or shared OpenSandbox server, exposes noVNC inspection URLs, connects over proxied CDP, and uploads WebM session recordings to object storage with the same deferred recording_url semantics as Steel. Pass storage to BrowserUseClient when recording is enabled.

DevTools note: the Chrome image exposes CDP on 0.0.0.0:9222 (--remote-debugging-address=0.0.0.0 plus a socat forward for Chromium M113+). Rebuild from examples/opensandbox/chrome after pulling changes; the SDK discovers CDP via sandbox.get_endpoint(9222). See examples/opensandbox/chrome/README.md.

OpenSandbox local setup:

DOCKER_HOST=unix://${HOME}/.docker/desktop/docker.sock \
  OPENSANDBOX_INSECURE_SERVER=YES opensandbox-server

cd libs/gl-browser-use/examples/opensandbox/chrome
docker build -t opensandbox/chrome:latest .
playwright install chromium

MinIOS3CompatibleStorage uploads session recordings to MinIO or an S3-compatible service and returns presigned URLs.

Development

From libs/gl-browser-use:

make install-dev
make test-unit
make test-integration
make lint
make build-check

Useful targets:

  1. make test: run all tests.
  2. make test-unit: run unit tests with coverage.
  3. make test-integration: run integration-marked contract tests.
  4. make lint: run Ruff checks.
  5. make format: run Ruff fixes and formatter.
  6. make pre-commit: run pre-commit hooks.
  7. make build-check: build the package and validate artifacts with Twine.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gl_browser_use_binary-0.0.0b9-cp313-cp313-win_amd64.whl (411.9 kB view details)

Uploaded CPython 3.13Windows x86-64

gl_browser_use_binary-0.0.0b9-cp313-cp313-manylinux_2_31_x86_64.whl (690.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gl_browser_use_binary-0.0.0b9-cp313-cp313-macosx_13_0_arm64.whl (460.7 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

gl_browser_use_binary-0.0.0b9-cp312-cp312-win_amd64.whl (414.7 kB view details)

Uploaded CPython 3.12Windows x86-64

gl_browser_use_binary-0.0.0b9-cp312-cp312-manylinux_2_31_x86_64.whl (691.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gl_browser_use_binary-0.0.0b9-cp312-cp312-macosx_13_0_arm64.whl (457.9 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

gl_browser_use_binary-0.0.0b9-cp311-cp311-win_amd64.whl (433.7 kB view details)

Uploaded CPython 3.11Windows x86-64

gl_browser_use_binary-0.0.0b9-cp311-cp311-manylinux_2_31_x86_64.whl (634.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gl_browser_use_binary-0.0.0b9-cp311-cp311-macosx_13_0_arm64.whl (456.8 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b653f8cdfcccab63e1dfaf2a3d873e4591012a270c560b712d9d3590172822be
MD5 03a376fa002c51ce1feb786d037d15c4
BLAKE2b-256 a393e63a7f2f1bca3c00d752aa38f4006fa1c800a04c2a7d596e37da50daafb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.0.0b9-cp313-cp313-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 89248931cff3e4075831c576f451dd33f10cc823fde00fae5a2968f8bee483e7
MD5 faa88b9846977ec8aceaccfcafe32e5d
BLAKE2b-256 245ca528004deb6b9a95c70120b1b426c2d361eac154895514968039fced0092

See more details on using hashes here.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 36f3c332fe1130036c00f54c072be9f318eaef858cdf4bb70ae661085ce28db9
MD5 cf50ff2cd7a5e7bfa27f0857a740ebb0
BLAKE2b-256 38c15b4b78bf377956ec43ad1daea3e665e42d42068fe06346bf510b61aa36d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.0.0b9-cp313-cp313-macosx_13_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f0d72777ba8b9c50d768ddcc69e7e17ae573735538795c98cac5f8ebc2501d15
MD5 6039aca42b3b85515224a200de747c01
BLAKE2b-256 e987558ae986588660f4c96903caa4cea51474a1a72dac639e2975417413661f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.0.0b9-cp312-cp312-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 efafb252e39b00e0311eab5fb8f62eb87bcbcee8fcc7e0cd6f9959fe6f450db1
MD5 6d61d3d8a8d3844cd18f4bbc637b1ba8
BLAKE2b-256 7b78631755d53b2c019485fd05d9e8db58db5428bc001d3a2447874b4de561c5

See more details on using hashes here.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 78352ce9dbac387a274a098ec31db27b090b891d936b03d5911a237d8e1d70e4
MD5 8cd2d9a7516db34072580e5d2f5a22b9
BLAKE2b-256 ec0068d51407c911a47ea2cfa6b47e5f9e22f643919952177e62566c3bfa751e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.0.0b9-cp312-cp312-macosx_13_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0d8b2906b8f2bbc12186fb2b90255989144b1daaaca89a1a679602aa1aaf854f
MD5 44dd7251895cce9af6d35e03a59e81de
BLAKE2b-256 9db655e296e375e4756e60707197061a93927fee5a07c1899c212c649716e9c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.0.0b9-cp311-cp311-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 4574f08d92531044eeb1316dd5208bf8885cd9be4ded53f35ed1e4bd31d9b7ce
MD5 3833e49a3d00a72908f7d99ce80065e7
BLAKE2b-256 7fdf692c632502cd662983d3ad80a42c91e917474fe1c36321a2569e76ff8fdf

See more details on using hashes here.

File details

Details for the file gl_browser_use_binary-0.0.0b9-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.0.0b9-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 8ca975d2c0c60a6746abb593ff6f99278aafef2c92fc27ee61f7f7c279899018
MD5 7f8c620e78ee29a6011603d244332df5
BLAKE2b-256 f449c3f6987736912354d4dbf002b951ff704321e7c60fc2913f8b3e4bd9fb52

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.0.0b9-cp311-cp311-macosx_13_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page