Skip to main content
A crystal above a sea of clouds

Browser Use Pydantic

Browser Use, built on Pydantic AI. In Python.

Pydantic AI + a persistent Python REPL + raw CDP. The agent writes Python, controls Chrome, and builds the helpers it needs as it goes.

Your task → Pydantic AI → persistent Python REPL → raw CDP → Chrome
                 ↑                                            │
                 └──────────── AX tree + screenshots ─────────┘

The programmability of Browser Harness in an agent you can put in your app, with cloud browsers, typed results and follow-ups. It scores the same as Browser Use Pi on BU Bench in matched runs.

Start

uv add browser-use-pydantic
export OPENAI_API_KEY=...
export BROWSER_USE_API_KEY=...   # for cloud browsers
import asyncio
from browser_use_pydantic import Agent, Browser

async def main():
    async with Agent('Find the top story on Hacker News', browser=Browser(use_cloud=True)) as agent:
        result = await agent.run()
        print(result.final_result())

        agent.add_new_task('Summarize the comments')
        print((await agent.run()).final_result())

asyncio.run(main())

Cloud browsers

Browser(use_cloud=True) starts a Browser Use Cloud browser with stealth, proxies and CAPTCHA solving. The agent and its files stay on your machine; only the browser is remote.

  • Watch it live. The live view opens in your browser when the agent starts (live_view=False to skip). The link is also on agent.browser.live_url. Anyone with it can drive the browser.
  • Stay logged in. Browser(use_cloud=True, cloud_profile_id='work') takes a profile name or id. Log in once through the live view; cookies are saved when the browser stops.
  • Pick a country. cloud_proxy_country_code='de', or None for no proxy.
  • Files both ways. upload_file(selector, path) sends local files to the remote browser. Files the browser downloads land in workspace/downloads when the agent closes.
  • Never left running. The browser stops when the agent closes, and when your process exits. cloud_timeout (minutes, default 60) caps it either way.
  • Run many at once. Every Agent gets its own browser:
tasks = ['Price of an iPhone 17 on apple.com', 'Price of a Pixel 11 on store.google.com']

async def ask(task):
    async with Agent(task, browser=Browser(use_cloud=True)) as agent:
        return (await agent.run()).final_result()

print(await asyncio.gather(*map(ask, tasks)))

Options

Agent(task, llm='openai/gpt-6-luna',     # default; or 'anthropic/...', 'openrouter/...', a Pydantic AI model
      browser=Browser(),                 # Browser(): your Chrome · Browser(cdp_url=...) · Browser(use_cloud=True)
      output_model_schema=MyModel,       # typed result in result.structured_output
      reasoning='medium',                # default
      workspace='./work')                # files the agent saves; default: a temp dir

result = await agent.run(max_steps=100, timeout=1700)
result.final_result()   # answer text, or None if unfinished
result.status           # completed | max_steps | timeout | error
result.partial          # last checkpoint(..., partial=True) when unfinished

How it works

  ● agent: python  → new_tab(url); screenshot()           one persistent REPL,
  │                                                      browser-harness helpers + raw cdp()
  ● agent: python  → rows = [...]; checkpoint('rows.json', rows, partial=True)
  │                                                      a hung cell is killed, files survive
  ● agent: finish_from_repl('rows')                       delivers the value it already has
  │
  ✓ result.final_result()

The agent keeps its own variables between steps, sees the page as screenshots, and saves progress as it goes, so a timeout still returns partial work.

Develop

uv run pytest   # real headless Chrome, scripted model, no provider calls

eval/ runs the agent on the Browser Use eval platform with the same contract as Browser Use Pi.

Metadata

Release files for browser-use-pydantic 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for browser-use-pydantic 0.2.0
File Size Uploaded Provenance Actions
browser_use_pydantic-0.2.0.tar.gz 30.6 kB With provenance Details for browser_use_pydantic-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for browser-use-pydantic 0.2.0
File Interpreter ABI Platform Actions
browser_use_pydantic-0.2.0-py3-none-any.whl Python 3 none any Details for browser_use_pydantic-0.2.0-py3-none-any.whl

Total release size: 53.1 kB

Release files / browser_use_pydantic-0.2.0.tar.gz

Download URL browser_use_pydantic-0.2.0.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c8eb53e979933312976dc4494bb0433439633a03ffa37c74c4e3c593c1f3f399
BLAKE2b-256 checksum
How to use checksums
1fa876678743dd48c8b0aae6535fd284620c61bec9ba2af9dca49993a093ede2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / browser_use_pydantic-0.2.0-py3-none-any.whl

Download URL browser_use_pydantic-0.2.0-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a63d18bf702457aa1d9393c1026ed0e36451bc468eea20a9b379fbc6a6b66b8d
BLAKE2b-256 checksum
How to use checksums
920f53256047441e207886f2ee5990c67b11f65d87488de49b9ecb5dd8639a70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for browser-use-pydantic 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for browser_use_pydantic-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page