Skip to main content

nullify-guard

Stops AI browser agents from being clickjacked. Playwright-Python wrapper for Nullify Agent Guard: every click lands on what is visible at that point, or is refused with a reason the agent can act on.

pip install nullify-guard
playwright install chromium
from playwright.async_api import async_playwright
from nullify_guard import guard, NullifyBlockedError

async with async_playwright() as p:
    browser = await p.chromium.launch()
    context = await browser.new_context()
    g = await guard(context)                 # before any navigation
    page = await context.new_page()
    await page.goto("https://example.com")

    try:
        await page.mouse.click(400, 300)     # checked automatically
    except NullifyBlockedError as e:
        print(e)                             # says what was really under the pointer

    text = await g.visible_text(page)        # page text without hidden text, for your model

Sync Playwright: from nullify_guard.sync_api import guard (same methods, without await).

Call What it does
guard(page_or_context, ...) Injects the engine and returns a guard; page.mouse clicks are then checked
g.click(page, x, y) / g.click_element(locator) Checked clicks; the element version fails immediately with a reason
g.assess(page, x, y) / g.assess_element(locator) What a click would hit, without clicking
g.visible_text(page) / g.hidden_text(page) / g.page_risk(page) Read the page safely
g.interventions Clicks refused and tabs closed so far

Same engine and behaviour as the npm package @nullifyads/agent-guard, including its limits: Chromium only, and visible prompt injection still reaches your model.

MIT License.

Metadata

Release files for nullify-guard 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nullify-guard 0.1.0
File Size Uploaded
nullify_guard-0.1.0.tar.gz 39.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nullify-guard 0.1.0
File Interpreter ABI Platform
nullify_guard-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.5 kB

Release files / nullify_guard-0.1.0.tar.gz

Download URL nullify_guard-0.1.0.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a01007e1024c68c5c4464d471849fce3cdf07d9b5ddf9cef6f71c84cb850d334
BLAKE2b-256 checksum
How to use checksums
06861616a536a37672ca93b20e8c402e3a5ab650d1ba68f801c2c093c75f467e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / nullify_guard-0.1.0-py3-none-any.whl

Download URL nullify_guard-0.1.0-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c54ed8077f546cfab4f752c560153e7b5a0d191b1bc93d0ba525589a4a75053
BLAKE2b-256 checksum
How to use checksums
cd0da6f52b97cf33da45a6c00c1b881429e099197a0ef60a6e5bd32b054518dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page