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

@agentid-protocol/core

v0.1.3

Published

AgentID core SDK - cryptographic identity, manifests, signing, verification, and policy evaluation for AI agents

Readme

@agentid-protocol/core

Cryptographic identity, capability constraints, and policy-enforced authorization for AI agents.

npm License

Install

npm install @agentid-protocol/core

Requires Node.js >= 18.

Quick start

import {
  generateKeypair,
  getAgentId,
  createManifest,
  signManifest,
  verifySignedManifest,
  evaluatePolicy,
} from '@agentid-protocol/core';

const keypair = await generateKeypair();
const agentId = getAgentId(keypair.publicKey);

const manifest = createManifest({
  agentId,
  name: 'PaymentBot',
  version: '1.0.0',
  capabilities: [{
    id: 'payments:send',
    description: 'Send payments',
    constraints: {
      max_amount_usd: 500,
      require_human_approval_above_usd: 100,
    },
  }],
  expiresAt: '2027-01-01T00:00:00Z',
});

const signed = await signManifest(manifest, keypair);
const result = await verifySignedManifest(signed);
// result.valid === true
// result.trust_level === 0 (self-signed)

const decision = evaluatePolicy(
  {
    manifest: result.manifest!,
    trustLevel: result.trust_level,
    action: 'payments:send',
    actionParams: { amount_usd: 50 },
    revoked: false,
    expired: false,
  },
  {
    policy_version: '0.1',
    rules: [{
      action: 'payments:send',
      require: { capability_declared: 'payments:send', constraints_satisfied: true },
      on_fail: 'REJECT',
    }],
    default: 'REJECT',
  }
);
// decision.decision === "ACCEPT"

API

Identity

| Function | Description | |---|---| | generateKeypair() | Generate an Ed25519 keypair | | getAgentId(publicKey) | Derive a deterministic agent ID from a public key | | saveKeypair(keypair, path, options?) | Save keypair to disk (0600 permissions, overwrite protection) | | loadKeypair(source) | Load keypair from file path or env:VAR_NAME |

Manifests

| Function | Description | |---|---| | createManifest(config) | Create an agent manifest with capabilities and constraints | | validateManifest(manifest) | Validate manifest structure and fields | | canonicalizeManifest(manifest) | Deterministic JSON serialization (RFC 8785 JCS) |

Signing & verification

| Function | Description | |---|---| | signManifest(manifest, keypair) | Sign a manifest with a private key | | signMessage(payload, nonce, keypair, manifestRef) | Sign an arbitrary message (for handshakes) | | verifySignedManifest(signed, options?) | Verify signature, expiry, and optionally domain proof | | verifySignedMessage(signed, expectedAgentId?) | Verify an arbitrary signed message | | verifyRevocationSignature(statement) | Verify a revocation statement's signature |

Policy

| Function | Description | |---|---| | evaluatePolicy(context, policy) | Evaluate policy rules against an agent's manifest and action | | loadPolicy(source) | Load a policy from a JSON file or URL |

Revocation

| Function | Description | |---|---| | createRevocation(agentId, revokedKeyId, reason, keypair) | Create a signed revocation statement | | checkRevocation(keyId, revocationList) | Check if a key ID has been revoked | | loadRevocationList(source, options?) | Load and signature-verify a revocation list from file or URL |

Key rotation

| Function | Description | |---|---| | createRotation(oldKeypair, newPublicKey) | Create a signed rotation statement (continuity proof) | | verifyRotation(statement) | Verify a rotation statement's signature |

Trust levels

| Level | Name | Verification | |---|---|---| | 0 | Self-signed | Agent controls a keypair. Verified offline. | | 1 | Domain-verified | Operator controls a domain (DNS TXT / .well-known). Requires domainProofVerifier callback. | | 2 | Organization-verified | External issuer vouches for operator. Requires external verification. |

Security

  • Ed25519 via @noble/ed25519 (audited, pure JS)
  • No custom cryptographic primitives
  • Private keys saved with 0600 permissions
  • Revocation lists are signature-verified on load
  • Rotation requires cryptographic continuity proof
  • Trust levels are verified, not self-declared

Links

License

Apache 2.0