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

@moltrust/sdk

v1.1.0

Published

MolTrust Agent Verification — verify AI agents in 3 lines of code

Downloads

165

Readme

@moltrust/sdk

Verify AI agent trust scores in 3 lines of code.

import { AgentTrust } from '@moltrust/sdk';

const result = await AgentTrust.verify('did:moltrust:abc123');
if (!result.verified) throw new Error(result.reason);

Install

npm install @moltrust/sdk

Standalone Verification

import { AgentTrust } from '@moltrust/sdk';

// Simple check
const result = await AgentTrust.verify('did:moltrust:abc123');
console.log(result.verified);    // true/false
console.log(result.trustScore);  // 0-100
console.log(result.grade);       // "A" | "B" | "C" | "D" | "F"
console.log(result.flags);       // [] or ['low_confidence', ...]

// With minimum score
const result = await AgentTrust.verify('did:moltrust:abc123', {
  minScore: 70,
});

// Block specific flags
const result = await AgentTrust.verify('did:moltrust:abc123', {
  minScore: 50,
  blockFlags: ['young_endorser_cluster', 'score_drop_anomaly'],
});

VerificationResult

{
  verified: boolean;     // true if all checks passed
  did: string;
  trustScore: number;    // 0-100
  grade: string;         // "A" | "B" | "C" | "D" | "F"
  flags: string[];       // anomaly flags (empty = clean)
  reason?: string;       // why verified=false
  checkedAt: string;     // ISO timestamp
}

Express Middleware

import express from 'express';
import { AgentTrust } from '@moltrust/sdk';

const app = express();

// Reads DID from X-Agent-DID header, returns 403 if score < 70
app.use('/api/action', AgentTrust.middleware({ minScore: 70 }));

// Block specific anomaly flags
app.use('/api/payment', AgentTrust.middleware({
  minScore: 60,
  blockFlags: ['young_endorser_cluster'],
}));

// Access verification result in handler
app.post('/api/action', (req, res) => {
  const trust = req.agentVerification;
  console.log(trust?.did, trust?.trustScore, trust?.flags);
  res.json({ ok: true });
});

Hono Middleware

import { Hono } from 'hono';
import { AgentTrust } from '@moltrust/sdk';

const app = new Hono();
app.use('/api/action', AgentTrust.honoMiddleware({ minScore: 70 }));

AAE Evaluation

The middleware can evaluate Agent Authorization Envelopes:

app.use('/api/purchase', AgentTrust.middleware({
  minScore: 50,
  requireAAE: true,
  evaluateAction: 'commerce/purchase',
  evaluateAmount: 500,
}));

Register an Agent

const agent = await AgentTrust.register({
  displayName: 'My Trading Agent',
  apiKey: process.env.MOLTRUST_API_KEY!,
});
// { did: 'did:moltrust:...', ... }

Trust Flags

Flags signal behavioral anomalies. They are informational for verifiers — no score deduction:

| Flag | Trigger | |---|---| | repetitive_endorsements | >80% of endorsements to one DID | | low_confidence | Active in only 1 vertical after 30+ days | | young_endorser_cluster | Endorsed by >5 agents under 7 days old | | score_drop_anomaly | Score dropped >20 points in 24h |

Headers Convention

| Header | Purpose | |---|---| | X-Agent-DID | Agent's MolTrust DID (primary) | | X-Agent-Credential | Credential ID for AAE lookup | | Authorization: Bearer did:... | Fallback DID extraction |

Full docs: https://moltrust.ch/developers