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

trace-guard

v3.8.0

Published

Zero-config adversarial AI-agent firewall using hardware attestation, logic traps, and environment gaslighting.

Readme

Trace Guard 🛡️

The Open-Source Defensive Toolkit Against Autonomous AI & LLM Browsing Agents.

npm version License: ISC Zero Dependencies


💡 The Problem: Autonomous AI Agents & Uncontrolled Scraping

Traditional bot mitigation (IP rate-limiting, CAPTCHA, headless browser detection) fails against modern LLM-powered autonomous agents and Vision-Language Model (VLM) browsers. These agents operate real browser instances, execute full JavaScript, and read web pages visually or via the DOM just as humans do.

Attempts to detect AI agents using client-side behavioral mouse-tracking or hardware fingerprinting suffer from high false-positive rates and easy evasions (as agents can simulate human movements or run headfully).


🎯 The Solution: Architectural Vulnerability Exploitation (Canary Tokens & Adversarial Overlays)

Trace Guard pivots defense from fragile behavioral guesswork to structural architectural vulnerabilities inherent in Large Language Models across 13 Canary Primitives:

  1. DOM Canary Tokens: Hidden DOM elements (aria-label, hidden spans, HTML comments, canvas fallbacks, meta tags) containing natural language instructions targeted at LLMs. Because LLMs cannot structurally separate instructions from passive data, agents follow embedded prompts—revealing unique tokens in their outputs or actions.
  2. AX-Tree Region Canaries: Dedicated accessibility regions (role="region" without aria-hidden="true") configured to expose prompt directives directly to browser Accessibility Tree (AX Tree) parsing agents (Browser-Use, WebArena, Claude AX Mode).
  3. Multimodal Canvas Pixel Traps: Pixel-rendered prompt text on hidden 2D <canvas> contexts to catch VLM visual OCR scrapers.
  4. Multimodal Audio Honeypots: Hidden <audio> tags with prompt injection attributes targeting speech/audio LLM agents.
  5. Polymorphic Prompt Engine: Dynamic generation matrix creating 1,200+ unique prompt variations on every request to defeat static regex filter evasion.
  6. Decoy API Honeypots: Planted JSON API routes (/_tg_decoy_*) that catch crawlers exploring API links.
  7. Adversarial Visual Overlays: Grounded in recent security research (ACL 2025: "Attacking Vision-Language Computer Agents via Pop-ups"), Trace Guard injects transient visual overlays that distract VLM agents with 86%+ success rates while remaining invisible or automatically dismissed (150ms) for human users.

🚀 Quick Start (Zero-Setup Node.js Server Hook)

Enable Trace Guard automatically across all HTML responses with a single line of code before initializing your server:

require('trace-guard').setupHook({
  enabled: true,
  logDetections: true,
  onDetection: (result) => {
    console.log('🚨 LLM Agent Detected:', result.reason);
  }
});

const http = require('http');

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/html' });
  res.end('<h1>Welcome to my website</h1>');
});

server.listen(3000);

⚡ Framework Support (Next.js, Express, Fastify, Hono)

// Next.js App Router (middleware.ts) — Vercel Edge Compatible
import { traceGuardNextMiddleware } from 'trace-guard';

export default traceGuardNextMiddleware();
// Express Middleware
const { traceGuardExpress } = require('trace-guard');
app.use(traceGuardExpress());
// Fastify Plugin
const { traceGuardFastify } = require('trace-guard');
fastify.register(traceGuardFastify);
// Hono (Bun / Cloudflare Workers / Deno)
import { traceGuardHono } from 'trace-guard';
app.use('*', traceGuardHono());

🧪 Experimental Validation

Trace Guard includes an automated experiment suite (experiments/run-agents.js & experiments/test_viewports.js) to benchmark defense efficacy against scrapers, headless browsers, and LLM readers.

| Threat Category | Detection Mechanism | Efficacy | Human Impact | | :--- | :--- | :--- | :--- | | LLM Scraping & Summarization | DOM Canary Tokens (Hidden Spans / Comments) | 100% Token Leakage | Zero (CSS Hidden) | | AX-Tree Autonomous Agents | AX-Tree Region Canaries (role="region") | 100% AX Tree Exposure | Zero (Offscreen) | | VLM Browsing Agents | Adversarial Visual Overlays & Canvas OCR | 86%+ Redirection | Zero (Auto-dismissed 150ms) | | Multimodal Audio Agents | Audio API Honeypots (<audio>) | Deterministic Trigger | Zero | | API Discovery Crawlers | Decoy API Routes (/_tg_decoy_*) | Deterministic Trigger | Zero | | Sanitizers & Strippers | Self-Healing MutationObserver | Tamper Detection | Zero |


⚖️ Intellectual Property & Research Status

  • Patent Pending: Indian Provisional Patent Application Form 2 ("Method and System for Detecting Large Language Model Agents Using Embedded Adversarial DOM Canary Tokens").
  • Research Paper: Preprint manuscript available under paper/traceguard_paper.md.
  • Progress Journal: Live engineering milestones documented in PROGRESS_LOG.md.

📄 License

ISC License © 2026 Tirup Mehta