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

@rakesh90466/aip-sdk

v0.2.1

Published

Zero‑dependency Agent Identity Protocol (AIP) SDK – Ed25519‑based token signing & delegation.

Readme

AIP — Agent Identity Protocol

JWT extension for agent delegation chains. Zero dependencies.

npm license

The Problem

JWT authenticates users. Agents need to authenticate themselves AND prove who delegated authority to them.

AIP is JWT + delegation chains. Same signing, same verification, same ecosystem — extended with permanent agent identities and cryptographic delegation tracking.

Install

npm install @rakesh90466/aip-sdk

Quick Start

import { AIP } from '@rakesh90466/aip-sdk';

const aip = new AIP();

// 1. Create an agent identity
const { agentId, privateKey } = await aip.createAgent({
  name: 'demo_agent',
  version: 'v1'
});

// 2. User delegates to agent
import { generateKeypair } from '@rakesh90466/aip-sdk';
const userKeys = generateKeypair();

const token = await aip.createRootToken({
  user: 'user_alice',
  agent: agentId,
  capabilities: { search: true, checkout: true },
  userPrivateKey: userKeys.privateKey,
});

// 3. Agent delegates to sub-agent (scope attenuation)
const sub = await aip.createAgent({ name: 'searcher', version: 'v1' });
const subToken = await aip.delegate({
  parentToken: token,
  subAgent: sub.agentId,
  capabilities: { search: true, checkout: false },
  agentPrivateKey: privateKey,
});

// 4. Verify the entire chain
const payload = await aip.verify(subToken, {
  publicKeys: { 'user_alice': userKeys.publicKey }
});

console.log(payload.sub);                    // "agent:searcher_v1"
console.log(payload.aip.delegated_by.id);    // "agent:demo_agent_v1"
console.log(payload.aip.chain.length);       // 2

Core API

| Method | Description | |--------|-------------| | aip.createAgent({ name, version }) | Create agent identity with Ed25519 keypair | | aip.createRootToken({ user, agent, capabilities, userPrivateKey }) | User delegates to root agent | | aip.delegate({ parentToken, subAgent, capabilities, agentPrivateKey }) | Agent delegates to sub-agent | | aip.verify(token, { publicKeys }) | Verify token + entire delegation chain | | aip.decode(token) | Inspect token without verification |

Delegation Rules (Enforced)

  1. Scope Attenuation Only — Sub-agents can only receive a subset of parent capabilities
  2. Signature Chain Integrity — Every delegation step is cryptographically signed
  3. Maximum Chain Depth — Default 8 hops (configurable)
  4. Expiry Inheritance — Child tokens cannot outlive parent tokens

Express Middleware

import { aipMiddleware, requireCapability } from '@rakesh90466/aip-sdk/express';

app.use(aipMiddleware({
  agentRegistry: {
    'agent:orchestrator_v1': orchestratorPublicKey,
    'agent:price_bot_v2': priceBotPublicKey,
  }
}));

app.post('/checkout', requireCapability('checkout'), checkoutHandler);

CLI

npx aip keygen                    # Generate Ed25519 keypair
npx aip agent price_bot v2        # Create agent identity
npx aip decode <token>            # Inspect a token
npx aip verify <token> --key <pk> # Verify with public key

Security

  • Algorithm: EdDSA (Ed25519) only — alg: "none" is unconditionally rejected
  • Default TTL: 15 minutes (configurable, 1 hour hard cap)
  • Replay protection: JTI required by default
  • Zero infrastructure: Verify with just a public key. No database, no auth server.

Configuration

const aip = new AIP({
  defaultTTL: 900,        // 15 min
  maxTTL: 3600,           // 1 hour cap
  maxChainDepth: 8,       // Max delegation hops
  requireJTI: true,       // Replay protection
});

Token Schema

AIP tokens are valid JWTs — standard JWT libraries can parse them:

{
  "sub": "agent:price_bot_v2",
  "aip": {
    "version": 1,
    "delegated_by": { "type": "user", "id": "user_123", "signature": "..." },
    "chain": [
      { "agent_id": "agent:orchestrator_v1", "scope": ["search", "checkout"], "signature": "..." },
      { "agent_id": "agent:price_bot_v2", "scope": ["search"], "signature": "..." }
    ],
    "capabilities": { "search": true, "checkout": false }
  }
}

License

MIT