Metadata-Version: 2.4
Name: paddock-browser
Version: 0.1.1
Summary: Private, multi-agent browser control for coding agents: drive your real Chrome over CDP with no telemetry and no page footprint.
License-Expression: MIT
Project-URL: Homepage, https://github.com/JacobDavidAlcock/paddock
Project-URL: Issues, https://github.com/JacobDavidAlcock/paddock/issues
Keywords: agent,automation,browser,cdp,chrome,scraping
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cdp-use==1.4.5
Requires-Dist: pillow==13.0.0
Requires-Dist: websockets==15.0.1
Provides-Extra: mcp
Requires-Dist: mcp==2.1.1; extra == "mcp"
Dynamic: license-file

# Paddock

**Your real Chrome, for every agent at once.**

Paddock lets Claude Code, Codex and Cursor use the Chrome you're already signed into. Many agents work in
parallel, each in its own tab, and you can watch them all live. Nothing leaves your machine.

![Claude Code, asked in plain words, sends three sub-agents through three migration guides in one Chrome](https://raw.githubusercontent.com/JacobDavidAlcock/paddock/main/docs/agent.gif)

## Start

```bash
uv tool install --python 3.12 paddock-browser
paddock setup claude      # or: codex, cursor
```

Then ask your agent to do something "using my browser". `setup` installs the skill, so agents pick Paddock over
other browser tools when you say "my browser", "browser harness" or "paddock". Chrome needs
`chrome://inspect/#remote-debugging` ticked once, then asks "Allow remote debugging?" once per run
([install.md](install.md)). Windows, macOS and Linux.

## Many agents, one Chrome

![Eight agents set off at once in eight tabs of one Chrome; each searches Wikipedia for its own topic and lands on its own article, in about 4 s](https://raw.githubusercontent.com/JacobDavidAlcock/paddock/main/docs/speed.gif)

Every Paddock call names its tab (`paddock t3`, `paddock @docs`), so agents never step on each other, even
Claude Code sub-agents, which all share one session id. In `bench/parallel.py`, 8 such sub-agents collide on
**0%** of calls with Paddock and on **87.5%** with browser-harness, the project Paddock forked from.

Each call is fast because Paddock keeps a warm interpreter ready and a single connection to Chrome:

| | Per call | 8 agents in parallel |
|---|---|---|
| Linux | 33 ms (empty script) | 0.38 s median for a real step |
| Windows | 97 ms (empty script) | 0.49 s median for a real step |

Agents read pages as compact text, not screenshots: reading a Wikipedia article and clicking one link takes
about **2,200 tokens** instead of 10,900.

```
[r1] link "Jump to content"
[r3] textbox "Search Wikipedia"
[r4] button "Search"
...
h1 "Thoroughbred"
```

`click("r4")` waits until the button is clickable, clicks it like a person, and returns what changed.

## See every agent, step in any time

![paddock watch: six agents work live in one Chrome; one stops to ask before it pays, you approve, the order goes through](https://raw.githubusercontent.com/JacobDavidAlcock/paddock/main/docs/visibility.gif)

```bash
paddock watch
```

- **Every agent tab, live.** Each card streams its tab as it repaints. Click one to watch it full size.
- **Questions come to you.** An agent can ask for help (`ask_human("Please log in")`), and payment clicks wait for
  your approval. Approve, deny or reply with a note.
- **Take over, pause, replay.** Take a tab and finish the job yourself, pause an agent, or scrub through a replay
  of what it did. Passwords are masked in replays.
- **In Chrome too.** `paddock setup extension` puts each agent's tabs in a named, coloured tab group, and shows
  waiting questions on its toolbar button.

The dashboard runs on 127.0.0.1 behind a random token. From a terminal: `paddock log -f`,
`paddock answer t3 done`, `paddock pause t3`.

## How it compares

| | Paddock | Chrome DevTools MCP | Playwright MCP | Claude in Chrome | browser-harness |
|---|---|---|---|---|---|
| Uses your signed-in Chrome | Yes | With `--autoConnect` | With its extension | Yes | Yes |
| Many agents on that Chrome at once | Yes: every call names its tab | Tools act on one selected page | One client per browser profile | One tab group per session | Collides when agents share a session id |
| Works with | Any agent with a shell; an MCP server too | MCP clients | MCP clients | Claude | Any agent with a shell |
| A live dashboard of every agent's tabs | Yes | No | No | | No |
| Replays a finished task without a model | Yes (`paddock run`) | | | | No |
| Network traffic of its own | None, enforced by a test | | | | Telemetry on by default |

Sources: [DevTools MCP auto-connect](https://developer.chrome.com/docs/devtools/agents/use-cases/auto-connect),
[Playwright MCP extension](https://playwright.dev/mcp/configuration/browser-extension),
[Claude in Chrome](https://code.claude.com/docs/en/chrome),
[Browser Use telemetry](https://docs.browser-use.com/open-source/development/monitoring/telemetry). Blank cells
are ones those projects' documentation doesn't settle.

## Do it once, replay it forever

```bash
paddock save t3 expenses                    # what the agent just did in tab t3 → .paddock/workflows/expenses.py
paddock run expenses amount=42              # replays in seconds, no model, no tokens
paddock record expenses https://app.example # or you do it once in Chrome while paddock watches
```

The saved file is plain Python. Each step finds its element again by role and name, and typed values become
parameters. If a site has changed and a step fails, the run stops there; the agent finishes by hand and saves
again. `paddock guide workflows`.

## Logins the agent never sees

```bash
paddock secrets init        # .paddock/.env in this repository: readable only by you, and gitignored
```

```
GITHUB_USERNAME=me@example.com
GITHUB_PASSWORD=...
GITHUB_TOTP=JBSWY3DP...     # optional: paddock makes the 6-digit code
GITHUB_URL=github.com       # optional: never filled anywhere else
```

Agents call `login("github")` (multi-step forms and one-time codes included) or `fill_secret(ref, "github.password")`.
The values go straight into the page. They are never returned, journaled, saved in workflows or shown in replays,
and are printed as `•••` if they reach a script's output. `paddock guide logins`.

## What agents get

| | |
|---|---|
| **Act and observe** | `click(ref)` waits until clickable, clicks and returns what changed. `observe()` after anything else, including a form post to a slow server. |
| **Read, not scrape** | `read()` gives the main content as markdown, `table()` a table's rows, `responses("api/")` the JSON the page fetched. |
| **Iframes** | Same-site and cross-site iframes appear in `snapshot()` (`f1:r3`), and their refs click and fill. |
| **Re-renders** | When a page replaces an element the agent was about to use, Paddock finds the new one by role and name, and says so. |
| **The person** | `ask_human("Please log in")` hands the tab over and waits. Payment clicks wait for approval (`PD_CONFIRM`). |
| **Separate profiles** | `new_tab(url, context="fresh")` has none of your logins; `context="b"` is a second account. |
| **Tidy up** | `new_tab(..., task="x")` then `release_tabs(task="x")`. A Claude Code hook releases a session's tabs when it ends. |
| **Guardrails** | `PD_DENY` / `PD_ALLOW` sites, `PD_READONLY=1` (look, don't act), and a local journal of every action. |
| **Smaller looks** | `snapshot(within="#results")`, `snapshot(viewport=True)`, and `capture_screenshot(annotate=True)` with refs drawn on. |
| **Debugging** | `network_log()`, `perf()`, `perf_trace()`, `console_log()`, all local. `paddock guide debugging`. |

## Benchmarks

Run them yourself with this repository's `bench/` scripts. Each call is a separate CLI process, as in real agent use.

**Parallel agents** (`bench/parallel.py`): each agent types, clicks and reads back a value unique to it. A call fails
if it errors or sees another agent's page or value. Measured on headless Chromium on a 2-core Linux machine:

| Agents | Identity | browser-harness errors | Paddock errors | browser-harness p50 | Paddock p50 |
|---|---|---|---|---|---|
| 8 | Claude Code sub-agents (shared session id) | **87.5%** | **0%** | 1.37 s | 0.38 s |
| 8 | none (plain shell) | **88.9%** | **0%** | 1.62 s | 0.38 s |
| 8 | each sets its own owner (upstream's best case) | 0% | 0% | 1.00 s | 0.38 s |
| 16 | upstream's best case vs Paddock with no identity | 0% | 0% | 2.22 s | 0.75 s |
| 1 | | 0% | 0% | 0.21 s | 0.085 s |

On Windows 11 with Chrome 158, 8 sub-agents ran 88 calls with 0 errors at a 0.49 s median.

**Tokens** (`bench/tokens.py`): reading a Wikipedia article and clicking one element costs ~10,900 tokens with
browser-harness and ~2,200 with Paddock. A GitHub sign-in page costs ~200 and ~100.

**Real tasks** (`bench/eval.py`): five local sites (a shop order, an inbox, a signup form, a report loaded by fetch,
and three forms filled by parallel sub-agents), each given to Claude Code with one browser tool. The sites check the
result. Run `--tool paddock` and `--tool browser-harness` to compare success rate, tokens and time on your machine.

**The demos** (`bench/demo.py`): `agent`, `speed` and `visibility` re-film the three clips above.

## How it works

- A daemon holds **one** connection to Chrome and hands out tabs as handles (`t1`, `t2`, ...). Each has its own
  session, events, dialogs, journal and network log, and survives a daemon restart.
- `paddock` hands each script to a warm interpreter: forked per script on macOS and Linux, a pool of ready workers
  on Windows. Helpers are pre-imported ([SKILL.md](SKILL.md)).
- Tab sessions enable only `Page`, `Network` and auto-attach. `js()`, `snapshot()` and refs live in an isolated
  world the page can't see.
- Chrome slows background tabs, so agent tabs use focus emulation and run at full speed (`PD_KEEP_ACTIVE=0` turns
  it off). `paddock check-throttle` measures it on your Chrome.
- Guides for browser mechanics: `paddock guide`. Safety settings: `paddock guide safety`.

## Safety

Agents read web pages, and a page can carry instructions meant for them (prompt injection). Paddock can't stop
a model from being fooled, so it limits what a fooled agent can do:

- **Payments wait for you.** A click that pays, buys, subscribes or submits card details asks you first, in
  `paddock watch` or with `paddock answer`. `PD_CONFIRM=destructive` adds deletes and cancellations;
  `PD_CONFIRM=all` adds every form submit.
- **Agents never see your passwords.** `login("github")` types them into the page, and with `GITHUB_URL` set, only
  on that site.
- **You choose the sites.** `PD_DENY=bank.com` keeps agents off a site, `PD_ALLOW=github.com` keeps them on a list,
  and `PD_READONLY=1` lets them look but not act.
- **You can see and stop everything.** Every action is in the journal, every agent tab is live in `paddock watch`,
  and Take over pauses an agent mid-task.

These guard against an agent's mistakes, whatever their cause. They are not a sandbox: an agent with a shell can
already do anything you can. `paddock guide safety` has the details.

## Privacy

Paddock makes no network requests of its own: no telemetry, update checks, crash reports or cloud services
(`tests/unit/test_privacy.py`). Pages see your Chrome as it is: no added headers, no title changes and no `Runtime`
domain, with harness JavaScript in an isolated world (`tests/integration/test_snapshot.py` checks this with a
page-side detector). One deliberate exception: agent tabs report themselves as visible and focused, like a tab
you're looking at. The journal, replays and dashboard stay on your machine, and typed text is never recorded.

Your agent's model still sees what the agent reads, as with any tool. Paddock drives your own profile, so it can't
hide who you are from a site.

## Development

`uv run --with pytest --with mcp==2.1.1 python -m pytest tests/unit` needs no browser. Set
`PD_TEST_CHROME=/path/to/chrome` for `tests/integration` and the benchmarks. CI runs all of them on Linux and
Windows, and the 8-agent benchmark must stay at 0 errors. See [CONTRIBUTING.md](CONTRIBUTING.md).

## Credits and license

Paddock is a fork of [browser-harness](https://github.com/browser-use/browser-harness) (MIT) by Browser Use, rebuilt
for parallel agents, speed and privacy. It is independent and not affiliated with Browser Use. MIT: see
[LICENSE](LICENSE) and [NOTICE](NOTICE).

<p align="center"><img src="https://raw.githubusercontent.com/JacobDavidAlcock/paddock/main/docs/sulky.png" alt="Sulky, Paddock's horse: a pixel-art chestnut in a red saddle cloth, unimpressed" width="300"></p>
<p align="center"><sub>Sulky, Paddock's horse. Named for the harness-racing cart, and for the face.</sub></p>
