Repository navigation
v0.1.0
v0.1.0 - First release on PyPI
A policy-bounded browser surface for agents, for Python. The Python port of particle-academy/prism-browser. The distribution is prism-ai-browser; the package imports as prism_browser.
pip install prism-ai-browser
What it has
BrowserPolicychecks every navigation and action before the engine receives it:- hosts are an allow-list, and
*.example.orgmatches subdomains, not the apex; - HTTPS is required and only port 443 is allowed, by default;
- URLs with credentials are refused;
- private, loopback and link-local addresses are refused by default, including
localhostand169.254.169.254; - actions are an allow-list of
click,fill,select,press,scrollandhover.
- hosts are an allow-list, and
ObservationGuardrefuses an observation over the size budget (65,536 bytes by default) rather than truncating it, and wraps page content in a tag with a random id so the page cannot close it.GuardedBrowserwraps anyBrowserEngineso every navigation and action goes through the policy and every observation through the guard.- Every refusal is a
BrowserRefusedwith a stablecode. - No runtime dependencies. Python 3.10 or later. The package does not drive a browser; you bring the engine.
Limits
The policy checks the URL as written. It does not resolve DNS, and it does not see redirects or anything the page loads. The engine must enforce those. The observation wrapper makes prompt injection harder, not impossible.
prism-parity's browser-url-policy corpus pins the URL policy against the PHP reference and the TypeScript port.