Works with Playwright, browser-use, LangChain, or any framework that fetches HTML. Choose your integration method below.
| Risk score | Decision | What to do in your agent |
|---|---|---|
| ≥ 70 | BLOCK | Stop. Do not execute. Go back or abort the task. |
| 40-69 | CONFIRM | Log the warning. Proceed carefully. Notify the user. |
| < 40 | ALLOW | Safe to proceed with the planned action. |
pip install -e git+https://github.com/arihantprasad07/guni.git#egg=guni
from guni import GuniScanner from playwright.sync_api import sync_playwright scanner = GuniScanner(goal="Book a train ticket") def safe_goto(page, url: str) -> bool: page.goto(url) result = scanner.scan(html=page.content(), url=url) if result["decision"] == "BLOCK": print(f"[GUNI] BLOCKED: {url} - Risk {result['risk']}/100") page.go_back() return False if result["decision"] == "CONFIRM": print(f"[GUNI] WARNING: {url} - Risk {result['risk']}/100") return True
if safe_goto(page, "https://target.com"): page.click("button#submit")
That is it. Every page your agent visits is now scanned before an action is taken.
pip install guni browser-use langchain-anthropic
from guni import GuniScanner from browser_use import Agent from langchain_anthropic import ChatAnthropic
from examples.langchain_integration import SecureBrowserTool from langchain.agents import initialize_agent, AgentType
import requests def scan_page(html: str, goal: str, api_key: str) -> dict: r = requests.post( "https://your-guni-domain/scan", json={"html": html, "goal": goal}, headers={"X-API-Key": api_key}, timeout=10, ) r.raise_for_status() return r.json()
async with websockets.connect(uri, extra_headers={ "X-API-Key": "guni_live_...", }) as ws: ...
Run the full agent demo - 6 attack scenarios, real threat detection, live terminal output.
python examples/agent_demo.py python examples/agent_demo.py --browser python examples/agent_demo.py --template