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

@warns/sdk

v0.1.1

Published

Stops an AI agent from making a payment it should not make. Guards x402 payments before anything is signed.

Readme

@warns/sdk

Stops an AI agent from making a payment it should not make.

Your agent pays over x402. A merchant can raise its price a thousand times, swap the address it gets paid at, ask for an authorization that stays valid for an hour, or slip an instruction into a response that your model obeys. Warns evaluates every payment against your policy before anything is signed, and refuses to sign what you did not approve.

npm i @warns/sdk

Early access. The hosted decision service is opening to the first testers. Ask for a key at warns.xyz.

import { createGuard } from "@warns/sdk"

const guard = createGuard({
  apiKey: process.env.WARNS_KEY!,
  agentId: "research-agent",
  baseUrl: "https://api.warns.xyz",
  rootAddress: "0xA26aa29cF9b429AD85E7a0F7FA6aBd8edE301e8a", // pinned; also served at https://api.warns.xyz/.well-known/warns-keys.json
})

// A drop-in replacement for the fetch you already pass to the x402 client.
const pay = guard.x402Fetch(signer, {
  intent: () => ({ expectedMaxUsd: 0.05, purpose: "market-data" }),
})

const res = await pay("https://data.vendor.com/quote")

What you get back

The guard throws rather than paying, so a refusal can never be mistaken for a success.

| Error | What happened | | --- | --- | | PaymentBlockedError | The payment was evaluated and refused. reasons says why, in plain language. | | PaymentReviewRequiredError | A human has to approve it. Retry the same request after approval. | | GuardConfigurationError | Your key, agent id or scope is wrong. Not a dangerous payment, a setup mistake. | | GuardUnavailableError | The decision service was unreachable and your fallback rules do not cover this payment. | | BindingViolationError | Something tried to sign a payment that no decision approved. |

It also guards the signer

guard.wrapSigner(signer) refuses any EIP-3009 authorization that does not match an approved decision, field by field, and refuses Permit and Permit2 typed data outright. So a payment that goes around the guarded fetch still cannot be signed.

When the decision service is down

By default the guard fails closed: no decision, no payment. If a short outage must not stop your agent, you can let small payments through under an hourly ceiling:

createGuard({
  // ...
  fallback: {
    default: "closed",
    rules: [{ maxUsd: 0.05, mode: "open_after_local_checks" }],
    localBucket: { usdPerHour: 1 },
  },
})

Those payments still pass the local checks (asset, amount, authorization window, signer binding), and the guard uploads them for reconciliation as soon as it reaches the service again.

Peer dependencies

viem, @x402/evm and @x402/fetch stay yours: the guard uses the signer and client you already have rather than bundling a second copy.

Docs and dashboard: warns.xyz