This release is a pre-release and may not be stable for production use.
CookieGuard for Browser Use
A successful agent login is not a secure session cookie. CookieGuard for Browser Use watches the browser your Browser Use agent drives, checks the authentication cookies it receives, and returns PASS / FAIL / INCOMPLETE with rule IDs, explanations, and fixes. The decision comes from the local CookieGuard policy engine, never from the model.
Overview · Install · Policy · How it works · Results · Limits & privacy · Demo & tests
Your policy decides what fails
fail_on sets the line: a confirmed finding at or above it fails the run; anything below
is reported. Only cookies you name in auth_cookies can be confirmed.
All options and a stricter example: Policy.
See it run
Claude (claude-opus-5-5) drives a real Browser Use agent through the same login twice.
The insecure app's cookie lacks HttpOnly, so CookieGuard returns FAIL — CG001 (exit 1).
The secure app gets PASS (exit 0). Recorded from a real run: Demo & tests.
Add it to your agent
from browser_use import Agent, BrowserProfile, BrowserSession, Tools
from cookieguard_browser_use import CookieGuardAudit
audit = CookieGuardAudit(
allowed_origins=['http://127.0.0.1:3000'], # exact origins you are authorized to test
auth_cookies=['session_id'], # the real session cookie name(s)
fail_on='high',
)
session = BrowserSession(browser_profile=BrowserProfile(
keep_alive=True, # required: Agent.run() otherwise closes the browser
enable_default_extensions=False, # avoid the bundled cookie-consent extension
allowed_domains=audit.browser_allowed_domains(),
))
tools = Tools()
audit.register_tools(tools) # optional agent-visible check
await session.start()
await audit.start(session) # before the login
agent = Agent(task=..., llm=..., browser_session=session, tools=tools,
sensitive_data={'http://127.0.0.1': {'login_password': '...'}})
await agent.run()
result = await audit.finish() # decided by the CookieGuard engine
await session.kill()
print(result.summary)
result.assert_policy() # raises CookiePolicyError on FAIL or INCOMPLETE
assert_policy() raises even if the agent never called the tool, or reported
success. CookieGuardAudit is also an async context manager; close() stops
collection without a result. One instance audits one workflow.
Needs Python 3.11+, Node.js 24+, and Chrome or Chromium: Install.
Status: 0.1.0b1 pre-release, tested with browser-use 0.13.14.
This is a community integration, not an official Browser Use package.
Metadata
Release files for cookieguard-browser-use 0.1.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cookieguard_browser_use-0.1.0b1.tar.gz | 84.5 kB | With provenance | Details for cookieguard_browser_use-0.1.0b1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cookieguard_browser_use-0.1.0b1-py3-none-any.whl | Python 3 | none | any | Details for cookieguard_browser_use-0.1.0b1-py3-none-any.whl |
Total release size: 154.5 kB
Security for cookieguard-browser-use 0.1.0b1
Provenance
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.