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

@keygent-ai/agentic-jwt-sdk

v1.0.3

Published

Client SDK for Agentic JWT — Zero-Trust Identity, Intent & Delegation for AI Agents

Readme

@keygent-ai/agentic-jwt-sdk

Zero-trust identity, intent binding, and delegation tracking for AI agents. This SDK handles all the cryptography, token lifecycle, and workflow tracking so your agents can make secure API calls with three lines of code.

Install

npm install @keygent-ai/agentic-jwt-sdk

Quick start

import { AgenticShim } from '@keygent-ai/agentic-jwt-sdk';

// 1. Initialize the Shim (once, at app startup)
const shim = new AgenticShim({
  idpBaseUrl: 'https://your-idp.fly.dev',
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  enablePoP: true,
  maxRetries: 3,
  requestTimeoutMs: 10_000,
  tokenCacheTtlSeconds: 60,
  enableWorkflowTracking: true,
});

// 2. Register your agent with the Shim
const agent = await shim.registerAgentWithIDP({
  agentName: 'Data Reader',
  signature: {
    promptTemplate: 'You are a financial data reader...',
    tools: [{
      name: 'fetch_report',
      signature: '(id: string) => Report',
      description: 'Fetch a quarterly report',
    }],
    config: { model: 'gpt-4o', temperature: 0, maxTokens: 4096 },
  },
  approvedWorkflowIds: ['your-workflow-id'],
  permissions: [{ resource: 'reports', actions: ['read'] }],
});

// 3. Make a secure API call (the Shim handles everything)
const response = await shim.secureRequest({
  agentId: agent.agentId,
  url: 'https://api.yourcompany.com/reports/q3',
  method: 'GET',
  intent: { action: 'read_report' },
  workflow: { workflowId, executionId, currentStepId },
  resourceOwner: { sub: 'user:alice', authTime: Date.now() / 1000, authMethod: 'oauth2' },
  scopes: ['reports:read'],
  audience: 'api.yourcompany.com',
});

What happens under the hood

When you call shim.secureRequest(), the Shim:

  1. Verifies the agent's identity — computes a SHA-256 checksum of the agent's prompt, tools, and config
  2. Requests an Intent Token from the IDP — the IDP runs a 4-part security checkpoint (registration, checksum, workflow authorization, delegation chain)
  3. Creates a PoP proof — signs the HTTP request with the agent's ephemeral private key so stolen tokens are useless
  4. Injects agentic headersAuthorization, DPoP, X-Shim-Checksum, X-Agent-Id, X-Workflow-Execution-Id
  5. Sends the request to the target API
  6. Returns the response to your agent

If the agent's prompt has been tampered with (prompt injection), the checksum fails at step 2 and the IDP refuses the token. The agent never reaches the API.

Workflow tracking

Track multi-step agent workflows with delegation chains:

// Start a workflow execution
const execution = shim.tracker.startExecution({
  workflowId: 'vuln-scan',
  clientId: 'your-client-id',
  initiatingAgentId: supervisorId,
  firstStepId: 'step-1',
  resourceOwnerSub: 'user:alice',
});

// Record delegation: Supervisor → Worker
shim.tracker.recordDelegation(execution.executionId, {
  fromAgentId: supervisorId,
  toAgentId: workerId,
  delegatedAction: 'scan_repository',
  delegatedAt: new Date().toISOString(),
  delegatorChecksum: supervisorChecksum,
});

// Advance through steps
shim.tracker.advanceStep(execution.executionId, completedStep, nextStepId);

// Complete
shim.tracker.completeExecution(execution.executionId);

Token caching

The Shim caches intent tokens by agent + action + resource. If the same agent requests the same action within the token's TTL (5 minutes), the cached token is reused without hitting the IDP. This is safe because the checksum is validated at mint time — if the agent's prompt changes, the next mint will fail.

API Reference

AgenticShim

| Method | Description | |--------|-------------| | registerAgent(params) | Register an agent locally with the Shim | | registerAgentWithIDP(params) | Register an agent with both the Shim and the IDP | | registerWorkflowWithIDP(params) | Register a workflow with the IDP | | mintIntentToken(params) | Request an Intent Token from the IDP | | secureRequest(params) | Full pipeline: mint token → PoP proof → headers → send request | | verifyAgentIntegrity(agentId, signature) | Re-verify an agent's checksum at runtime | | getShimChecksum() | Get the Shim library's own integrity hash | | getStats() | Get current Shim state (cached tokens, active executions) |

WorkflowTracker

| Method | Description | |--------|-------------| | startExecution(params) | Begin tracking a new workflow execution | | recordDelegation(executionId, link) | Record agent-to-agent delegation | | advanceStep(executionId, completed, nextStepId) | Move to the next workflow step | | completeExecution(executionId) | Mark workflow as completed | | failExecution(executionId, reason) | Mark workflow as failed | | getDelegationChain(executionId) | Get the current chain of command |

License

MIT