🌙 Toggle Dark Mode Home MoltGuard MolTrust Sports MT Shopping MT Salesguard MT Music Integrity Dashboard Blog Developers Status API Docs About Whitepapers Contact

Build trust-aware
agent applications.

One middleware. Any framework. W3C standard.

$ npm install @moltrust/sdk
1

Install

bash
npm install @moltrust/sdk
2

Add middleware

typescript
import { AgentTrust } from '@moltrust/sdk'; // Express app.use(AgentTrust.verify({ minScore: 60 })); // Hono app.use('*', AgentTrust.honoVerify({ minScore: 60 }));
3

Read the result

typescript
app.get('/api/resource', (req, res) => { const { did, trustScore, grade, aae } = req.agentVerification; // Agent verified — proceed with trust context });

Framework adapters

typescript
import express from 'express'; import { AgentTrust } from '@moltrust/sdk'; const app = express(); // Verify all agents — minimum trust score 60 app.use(AgentTrust.verify({ minScore: 60 })); app.post('/api/purchase', (req, res) => { const { did, trustScore, aae } = req.agentVerification; // AAE already evaluated — safe to proceed res.json({ authorized: true, agentDid: did }); });
typescript
import { Hono } from 'hono'; import { AgentTrust } from '@moltrust/sdk'; const app = new Hono(); app.use('*', AgentTrust.honoVerify({ minScore: 60 })); app.post('/api/purchase', (c) => { const verification = c.get('agentVerification'); return c.json({ authorized: true, did: verification.did }); });
typescript
import Fastify from 'fastify'; import { AgentTrust } from '@moltrust/sdk'; const app = Fastify(); app.addHook('preHandler', AgentTrust.verify({ minScore: 60 }));

Agent Authorization Envelope

Every MolTrust credential embeds an Agent Authorization Envelope — a machine-readable permission contract your API can inspect before every transaction.

📜 MANDATE

  • Purpose & allowed actions
  • Denied actions
  • Target resources
  • Delegation rules

🔒 CONSTRAINTS

  • Time bounds & TTL
  • Financial thresholds
    Autonomous: < $100 · Step-up: $100–$1,000 · Human approval: > $10,000
  • Jurisdictions
  • Counterparty min score

✅ VALIDITY

  • Issuer DID
  • Holder binding
  • Expiry timestamp
  • Revocation endpoint
  • Base L2 anchor

Read the full specification in Protocol Whitepaper v0.5 →

Query any agent's trust score

GET /skill/trust-score/...

VerifyOptions

OptionTypeDefaultDescription
minScorenumber0Minimum trust score required to pass verification. Agents below this threshold receive a 403.
requireAAEbooleanfalseRequire a valid Agent Authorization Envelope in the credential. Rejects agents without one.
evaluateActionstringCheck whether the AAE mandate permits this specific action (e.g. "purchase", "transfer").
evaluateAmountnumberEvaluate AAE financial constraints against this transaction amount (USD).
evaluateJurisdictionstringVerify the AAE permits operations in this ISO 3166-1 jurisdiction code.
apiBasestringapi.moltrust.chOverride the MolTrust API base URL. Useful for staging or self-hosted deployments.

AgentVerification interface

typescript
interface AgentVerification { did: string; // e.g. "did:moltrust:d34ed796a4dc4698" trustScore: number; // 0–100 grade: 'S'|'A'|'B'|'C'|'D'|'F'; aae: AAE | null; // parsed Agent Authorization Envelope credential: VerifiableCredential; // full W3C VC issuer: string; // issuer DID issuedAt: Date; expiresAt: Date; onChainAnchor: string | null; // Base L2 tx hash }

@moltrust/sdk

Express + Hono middleware for agent trust verification.

@moltrust/aae

AAE schema definition & runtime validator.

Protocol WP v0.5

Full specification — trust scoring, AAE, swarm intelligence.

API Reference

All endpoints — identity, scoring, credentials, swarm.

Start verifying agents in minutes.