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-trust/gateway

v1.3.0

Published

Express middleware that lets trusted AI agents interact with your website. Verifies cryptographic certificates, enforces scope manifests, checks reputation scores, reports behavior, and detects prompt injection attacks with ML.

Readme

@agent-trust/gateway

Express middleware that lets trusted AI agents interact with your website. Part of the AgentTrust ecosystem.

Install

npm install @agent-trust/gateway

TypeScript users: Types are included. You'll also need @types/express if you don't already have it:

npm install -D @types/express

Quick Start

import express from 'express';
import { createGateway } from '@agent-trust/gateway';

const app = express();
app.use(express.json());

const gateway = createGateway({
  stationUrl: 'https://agentgateway-6f041c655eb3.herokuapp.com',
  gatewayId: 'my-store',
  stationApiKey: 'YOUR_API_KEY',
  actions: {
    'search_products': {
      description: 'Search the product catalog',
      minScore: 30,
      parameters: {
        query: { type: 'string', required: true, description: 'Search query' }
      },
      handler: async (params) => {
        return await db.products.search(params.query);
      }
    },
    'place_order': {
      description: 'Place an order',
      minScore: 70,  // Higher trust required
      parameters: {
        productId: { type: 'string', required: true },
        quantity: { type: 'number', required: true }
      },
      handler: async (params, agent) => {
        return await db.orders.create({ ...params, agentId: agent.agentId });
      }
    }
  },
  behavior: {
    maxActionsPerMinute: 30,
    derivatives: {
      enabled: true,
      velocityThresholds: { actions_per_minute: 8, failures_per_minute: 3 },
      useAccelerationBlocking: true,
      predictiveBlockingSeconds: 30,
    },
    onSuspiciousActivity: (event) => {
      console.warn('Suspicious agent:', event.flag, event.description);
    }
  }
});

app.use('/agent-gateway', gateway.router());
app.listen(3000);

Features

  • Certificate verification — validates RS256 JWT certificates from the AgentTrust Station
  • Score-based access — different actions require different reputation levels
  • Real-time behavioral tracking — detects and blocks suspicious agents mid-session
  • Auto-reporting — reports agent behavior back to Station automatically (synced to Base L2 on-chain)
  • Discovery endpoints — agents can discover available actions programmatically
  • On-chain trust — every certificate and reputation score is recorded on Base L2, independently verifiable on BaseScan

Behavioral Tracking

The gateway monitors agent behavior in real-time and detects:

| Detection | What it catches | |-----------|----------------| | rapid_fire | Too many requests per minute | | high_failure_rate | Probing / brute force | | action_enumeration | Scanning endpoints | | repeated_action | Automation (same action on loop) | | scope_violation | Accessing above trust level | | burst_detected | Sudden activity after idle | | velocity_spike | Metric rate-of-change exceeds threshold (ramping attack) | | accelerating_attack | Metric acceleration indicates escalating threat | | predictive_breach | Forecasted score will breach block threshold in 30s |

Agents get a behavioral score (0-100) that degrades with violations. Drop below threshold = blocked mid-session.

Derivative-Based Detection (NEW)

The gateway now computes mathematical derivatives (velocity and acceleration) on behavioral metrics in real-time. This catches attacks that static thresholds miss:

  • Velocity spike — detects slow ramp-up attacks before they hit static limits
  • Accelerating attack — catches explosive probing and escalation patterns
  • Predictive blocking — forecasts behavioral score 30 seconds ahead and blocks before breach

Configure via the derivatives option in behavior config.

API

Routes (mounted on your chosen path)

| Method | Path | Description | |--------|------|-------------| | GET | /.well-known/agent-gateway | Discovery manifest | | GET | /actions | List available actions | | POST | /actions/:name | Execute an action (cert required) | | GET | /behavior/sessions | Monitor active sessions |

Links

License

MIT