# web-pilot A browser-use agent built on the rule that makes browser agents safe to run: **the model proposes one action, the code disposes.** Claude decides what to do on a page; code validates every action against guardrails before it touches the browser, and logs every step. A model driving a browser is exactly where you do not want the model in charge. So here it never is. The model gets a short, closed list of actions and proposes one per step; the agent parses it, checks it against an allowlist and a sensitive-field rule, and only then executes it. A blocked action is fed back as a reason and the model tries again, within a step budget. Every step is recorded, because a browser agent nobody can audit is a liability. ![architecture](docs/architecture.png) ## See it drive (no API key) ``` pip install playwright && playwright install chromium python main.py demo ``` This serves a bundled sandbox store and drives it with a key-free heuristic brain. A real captured run, against a real Chromium browser: ``` goal: Find the price of the Standing Desk. outcome: finished result: (demo brain) found $389.00 step 1 @ http://127.0.0.1:.../index.html proposed: click ok (clicked e1 (Products)) step 2 @ http://127.0.0.1:.../products.html proposed: click ok (clicked e2 (Standing Desk)) step 3 @ http://127.0.0.1:.../desk.html proposed: finish ok (finished) ``` The agent started on the store home, walked to Products, opened the Standing Desk page, read the price off it, and stopped. The demo brain is a labelled heuristic so the whole loop runs for free; with `python main.py run` the same loop is driven by Claude. ## The guardrails are the point Give the agent a goal that needs a password or a trip off-site, and it refuses. This is a real captured run on the sandbox (reproduce it with `python examples/safety_demo.py`), where a scripted brain tries exactly those two things: ``` goal: Log into the account outcome: gave_up step 1 @ .../login.html proposed: type BLOCKED (typing into a credential or payment field ('Password') is not allowed) step 2 @ .../login.html proposed: navigate BLOCKED (navigation to 'https://example.com/steal' is outside the allowed sites; stay on the allowed hosts) step 3 @ .../login.html proposed: give_up ok (gave up) ``` Three rules, enforced in code, that the model cannot talk its way around: - **Domain allowlist.** The agent only acts on hosts you allow. A navigate off the list is refused, and after every action the agent re-checks where the page actually landed, because a click can redirect. - **No credential or payment fields.** The agent never types into a password, card, CVV or similar field. This is decided by the input's `type` and `autocomplete` attributes, not by guessing from its label, so a password box named `pwd` or a card field labelled only by an external `