A policy-bounded browser surface for agents, for Python.
pip install prism-ai-browser==0.1.1 Copy PIP instructions
pip install prism-ai-browser from prism_browser import ActionKind, BrowserAction, BrowserPolicy, BrowserRefused, GuardedBrowser policy = BrowserPolicy( allowed_hosts=["docs.example.com", "*.example.org"], allowed_actions=[ActionKind.CLICK, ActionKind.SCROLL], ) browser = GuardedBrowser(my_engine, policy) try: observation = browser.navigate("https://docs.example.com/start") except BrowserRefused as refused: print(refused.code) The package does not drive a browser itself. my_engine is anything that implements the BrowserEngine protocol: navigate(url) and act(action), each returning an Observation.
BrowserPolicy answers two questions before the engine receives anything: where the agent may go, and what it may do there.
A refusal raises BrowserRefused with a stable code: invalid_url, url_credentials_refused, https_required, host_not_allowed, port_not_allowed, private_address_refused, action_not_allowed, observation_too_large.
GuardedBrowser passes every observation through an ObservationGuard before returning it:
The wrapper makes a prompt injection harder. It does not make one impossible: treat page content as untrusted whatever the model is told.
The policy checks the URL as written. It does not resolve DNS, so a public name that resolves to a private address is not refused here, and it does not see redirects, subresources or anything the page loads. Your engine must enforce those itself, ideally in an isolated network namespace behind an egress proxy.
prism-parity's browser-url-policy corpus pins the URL policy against the PHP reference and the TypeScript port.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.




