pi-browser-use 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: browser-policy
3
+ description: Browser-use policy for Pi agents. Use before any browser_* tool call: prefer CLIs and APIs over browser automation, default to fresh headless sessions, escalate to the authenticated profile only on login walls, and never steal user focus.
4
+ ---
5
+
6
+ # Browser Policy
7
+
8
+ `browser_*` tools (this `pi-browser-use` package, powered by `chrome-devtools-mcp` — not Playwright) drive a real Chrome. They are the tool of last resort, not the first.
9
+
10
+ ## Decision order
11
+
12
+ 1. **CLI/API first** — `gh` for GitHub, `wrangler` / Cloudflare API for Cloudflare, repo scripts for local apps. Reviewable, deterministic, no windows.
13
+ 2. **Read-only web** — `pi-web-access` / `fetch_content` for docs and page content. No login, no focus steal.
14
+ 3. **Browser to act** — only for dashboard-only toggles with no API, or visual "does it render?" checks.
15
+
16
+ ## Session modes
17
+
18
+ - **Default: fresh headless** (`sessionMode: isolated`, `headless: true`). Ephemeral profile, no window, never steals focus. Use for public pages and smoke checks.
19
+ - **Authenticated profile** (`sessionMode: persistent`). Log in once in `~/.pi/browser-profile`; cookies persist. Use when the task needs your identity (private repos, Cloudflare dashboard). Headed windows pop — warn the user before launching.
20
+ - **Existing Chrome** (`sessionMode: existing` + `autoConnect`) is intrusive (drives the user's daily browser, sees all tabs). Avoid unless the user explicitly asks.
21
+ - **Visual analysis** (`browser_analyze_screenshot`, only when `visionModel` is configured) is for canvas/WebGL scenes and coordinate clicks the tree cannot describe — not a substitute for reading the snapshot first.
22
+
23
+ `--chrome-arg` flags only apply when `chrome-devtools-mcp` launches Chrome itself — never with `autoConnect`/`browserUrl`. On macOS `--start-minimized` is ignored; only `headless: true` truly hides the window.
24
+
25
+ ## Bot walls and logins
26
+
27
+ Turnstile, device checks, SSO/2FA cannot be automated away. On hitting one: stop, report which profile is parked where, and ask the human to solve it once in that profile. Never loop retries against a challenge page.
28
+
29
+ ## Safety
30
+
31
+ - Mutating actions (save, deploy, merge, delete) need explicit user approval.
32
+ - Prefer `allowedUrlPattern` to cage the session to the task domains.
33
+ - `redactNetworkHeaders` stays on; never paste secrets into pages.