Skip to main content

GL Browser Use

GL Browser Use is a typed Python package 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

Published binary package

Install the published binary distribution for normal application use:

pip install gl-browser-use-binary

Supported Python versions are 3.11, 3.12, and 3.13.

Install optional providers with the binary package only when you need them:

pip install "gl-browser-use-binary[steel]"           # Steel browser infrastructure
pip install "gl-browser-use-binary[opensandbox]"     # OpenSandbox browser infrastructure
pip install "gl-browser-use-binary[infrastructure]"  # All browser infrastructure providers
pip install "gl-browser-use-binary[minio]"           # MinIO/S3-compatible object storage
pip install "gl-browser-use-binary[storage]"         # All object storage providers
pip install "gl-browser-use-binary[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.

The repository project is named gl-browser-use; the release workflow compiles and publishes it as gl-browser-use-binary. Both use the same gl_browser_use import namespace.

Local development

From the repository checkout, install the source project and development dependencies with uv:

cd libs/gl-browser-use
uv sync --all-extras --group dev

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 client-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.

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; GL Browser Use 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.1.4-cp313-cp313-win_amd64.whl (413.7 kB view details)

Uploaded CPython 3.13Windows x86-64

gl_browser_use_binary-0.1.4-cp313-cp313-manylinux_2_31_x86_64.whl (692.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gl_browser_use_binary-0.1.4-cp313-cp313-macosx_13_0_arm64.whl (462.3 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

gl_browser_use_binary-0.1.4-cp312-cp312-win_amd64.whl (416.6 kB view details)

Uploaded CPython 3.12Windows x86-64

gl_browser_use_binary-0.1.4-cp312-cp312-manylinux_2_31_x86_64.whl (693.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gl_browser_use_binary-0.1.4-cp312-cp312-macosx_13_0_arm64.whl (459.5 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

gl_browser_use_binary-0.1.4-cp311-cp311-win_amd64.whl (435.5 kB view details)

Uploaded CPython 3.11Windows x86-64

gl_browser_use_binary-0.1.4-cp311-cp311-manylinux_2_31_x86_64.whl (636.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gl_browser_use_binary-0.1.4-cp311-cp311-macosx_13_0_arm64.whl (458.5 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

Details for the file gl_browser_use_binary-0.1.4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 74adabd05bf24fdd9d53088e53cd05683b0909c06d9c7d13fcd0338ed5f2c516
MD5 e7528b60134b8224b00f17869226fee3
BLAKE2b-256 c4890739cfc31ae0cb08351e6517e735d2810e6ace720abd50085eccbf6d2ba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.1.4-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.1.4-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b63cdac7c6a93d54a800ad708944f832025211eb06e2dd3136f151c434775188
MD5 39514324e14229ec1d9fa72c2951fb9a
BLAKE2b-256 51f490705cb41eae38c2ffd4a3b3e8da8cc6bcd9d18ce95501461ff6997559c4

See more details on using hashes here.

File details

Details for the file gl_browser_use_binary-0.1.4-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 59a0c9d6af7ec9699a05e99ddd8513d082804835f945df1eccd52260af0345c2
MD5 28a31f6e672185d70b8f55e60f2793a9
BLAKE2b-256 52ac69c4502382722ef9eaf910533350993df493956f17f3c0555c835c2ca435

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.1.4-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.1.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1167383968651287f802e3a8a82300d469da2b03201469754a40303a4c6713f7
MD5 5b10d69adb3826a891654c3a91d01f17
BLAKE2b-256 88edef226d3b63c9ca199f058e1276243138dddee91616e9ff0bc214c866b439

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.1.4-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.1.4-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 055f286a7d31d0b86b453741e394bbdb5e5ee4447856132f8945ba7d7a8430a4
MD5 318e31c4728e7541c428aef41373f002
BLAKE2b-256 6decdf48a6e0885604247d8cac2edacdf56dc22c6380d149c2f8b387d79d7a5e

See more details on using hashes here.

File details

Details for the file gl_browser_use_binary-0.1.4-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6161fd8e690e476dc0e9e26c1ddafcf0e1bb723b8fde548b2cf0dd509b7973d5
MD5 702912391d2607b8b26430d77fc6315e
BLAKE2b-256 d4c28cd12a151f696dd7f0fe1e67bbdfb0e468668f491f523fefba312e6e5834

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.1.4-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.1.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f93121c5ff1b5b68c111725ab4a872a26d301552aa3e7d9f8fb9c3a95f29da08
MD5 d87560c69bf9983487564c5b8d6be3b6
BLAKE2b-256 8cdd85e7337731d57351d47f050a6a5bb7ee4c2044a2c14bb71e8348c03d728c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.1.4-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.1.4-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 7a41658cedd5ecf3006e217d34b3974ba7e8b69dab0b9d76fa42baa43c08ba73
MD5 54f02b0bd105c87512021a3e1cedcaad
BLAKE2b-256 f838d514974636db4f86af1acf07391433d23bff3cd41ee0efd1efba23953882

See more details on using hashes here.

File details

Details for the file gl_browser_use_binary-0.1.4-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for gl_browser_use_binary-0.1.4-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 fcb543b54e19295dd7400e75eb5531c47baee8e2d15c12817fd23fa856b574f8
MD5 538b92ea8364d6de829320dd9b12bf41
BLAKE2b-256 e3c92a087ec5cd7b04df831be9f12f68eadc3c08e0a0fbbe68bcb41246d7b658

See more details on using hashes here.

Provenance

The following attestation bundles were made for gl_browser_use_binary-0.1.4-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