npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agent-browser-guard

v1.0.0

Published

Zero-dependency DOM firewall & risk interceptor for autonomous browser agents (Playwright, Puppeteer, Computer Use). Blocks accidental payments, deletions, and irreversible transactions.

Readme

agent-browser-guard

Zero-dependency DOM firewall & risk interceptor for autonomous browser agents (Playwright, Puppeteer, Anthropic Computer Use, Browser Use). Blocks accidental payments, deletions, and irreversible transactions.

npm version License: MIT Website: oiyo.net


Why agent-browser-guard?

When autonomous AI browser agents browse web apps, dashboards, or SaaS consoles, they risk clicking irreversible buttons:

  • Financial Risk: Clicking "Pay Now", "Upgrade to Enterprise", "Charge Credit Card", "Subscribe".
  • Destructive Risk: Clicking "Delete Project", "Drop Database", "Cancel Membership", "Wipe Logs".
  • Privilege Risk: Transferring organization ownership or creating admin API tokens.

agent-browser-guard acts as a real-time DOM firewall:

  • Semantic Risk Classifier: Intercepts element text, ARIA attributes, classes, and form action URLs before clicks execute.
  • Client-Side Injection: 1-line script injection into Playwright / Puppeteer pages.
  • Zero External Dependencies: Pure regex heuristics, <8KB unpacked, 0.1ms evaluation.
  • Dual CLI & MCP: Evaluates actions via CLI or directly inside Claude Code, Cursor, and Antigravity.

1. Quick Start (CLI)

# Check if clicking a button is safe or dangerous
npx agent-browser-guard check --text "지금 결제하기"
# ❌ BLOCKED: Financial transaction or payment action

npx agent-browser-guard check --text "Delete project permanently"
# ❌ BLOCKED: Irreversible destruction action

npx agent-browser-guard check --text "View Analytics Dashboard"
# ✅ SAFE

2. Playwright / Puppeteer Integration

Inject the guardrail into your browser agent workflow in 3 lines:

import { chromium } from 'playwright';
import { getBrowserInjectionSnippet } from 'agent-browser-guard';

const browser = await chromium.launch();
const page = await browser.newPage();

// Inject real-time DOM firewall before page loads
await page.addInitScript(getBrowserInjectionSnippet());

await page.goto('https://app.example.com');

// If the agent tries to click a payment or deletion button,
// the browser event listener automatically halts the event (preventDefault)
// and sets window.__AGENT_GUARD_INTERCEPTED__!

3. Programmatic Usage (Node.js / TypeScript)

import { evaluateAction } from 'agent-browser-guard';

const verdict = evaluateAction({
  actionType: 'click',
  target: {
    text: 'Confirm $490 Subscription',
    href: '/api/billing/subscribe',
  },
});

if (!verdict.allowed) {
  console.error(`Action blocked! Reason: ${verdict.reason}`);
  // Request human confirmation before proceeding
}

4. MCP Server Configuration

Add browser-guard-mcp to your MCP configuration (~/.claude/settings.json, Cursor MCP settings, or Antigravity config):

{
  "mcpServers": {
    "browser-guard": {
      "command": "npx",
      "args": ["-y", "agent-browser-guard"]
    }
  }
}

Available Tools:

  1. evaluate_browser_action: Evaluates element text/URL before clicking.
  2. get_injection_snippet: Returns client-side injection script for browser runtimes.

License

MIT © OIYO Lab