{"_id":"@aria-registry/verify","_rev":"5-7c2996dd88067f94770d04babd21b895","name":"@aria-registry/verify","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.1":{"name":"@aria-registry/verify","version":"1.0.1","keywords":["aria","agent-identity","ai-agent","did","verifiable-credentials","post-quantum","ml-dsa","ed25519","offline-verification","w3c-vc","trust","atp","ariaprotocol"],"author":{"name":"TrustLayer Foundation"},"license":"Apache-2.0","_id":"@aria-registry/verify@1.0.1","maintainers":[{"name":"ariaregistry","email":"developers@tuno.bar"}],"homepage":"https://aria.bar","bugs":{"url":"https://github.com/trustlayer-foundation/aria-verify/issues"},"dist":{"shasum":"814852340a894fa0bd88501dc9aefe87c072b3d6","tarball":"https://registry.npmjs.org/@aria-registry/verify/-/verify-1.0.1.tgz","fileCount":9,"integrity":"sha512-oAgYhhrkYNnC0juOMgyQ5FzxS6Vd+DzRvvZWh6XMORBCX3v/0tjY7aLFhTKGkZhS9oDw4vBzv8f+Si/Vu7L4Pg==","signatures":[{"sig":"MEUCIQD7y4VgK7vK7bhgAo12t+bUZCTXDjXNBydtuDU/2XYlEgIgLVgSCrV/FAx4uDYElAlVZOCosKe8VHsJWCOuXuRgmj0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":202307},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"funding":{"url":"https://trustlayer.foundation","type":"foundation"},"gitHead":"eab68ae9d093e4fed8731e65d10933cb01b66f4f","scripts":{"test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build && npm run test","generate-fixtures":"tsx scripts/generate-fixtures.ts"},"_npmUser":{"name":"ariaregistry","email":"developers@tuno.bar"},"repository":{"url":"git+https://github.com/trustlayer-foundation/aria-verify.git","type":"git"},"_npmVersion":"11.9.0","description":"Verify AI agent identity offline. ARIA Protocol SDK.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","dependencies":{"@noble/curves":"^2.0.1","@noble/hashes":"^2.0.1","@noble/post-quantum":"^0.5.4"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","tsup":"^8.0.0","vitest":"^3.0.0","typescript":"^5.9.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/verify_1.0.1_1775076652540_0.4749164378079691","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aria-registry/verify","version":"1.0.2","keywords":["aria","agent-identity","ai-agent","did","verifiable-credentials","post-quantum","ml-dsa","ed25519","offline-verification","w3c-vc","trust","atp","ariaprotocol"],"author":{"name":"TrustLayer Foundation"},"license":"Apache-2.0","_id":"@aria-registry/verify@1.0.2","maintainers":[{"name":"ariaregistry","email":"developers@tuno.bar"}],"homepage":"https://aria.bar","bugs":{"url":"https://github.com/trustlayer-foundation/aria-verify/issues"},"dist":{"shasum":"f6d381bea9a064328321a6004c8c5f8038c49ad3","tarball":"https://registry.npmjs.org/@aria-registry/verify/-/verify-1.0.2.tgz","fileCount":9,"integrity":"sha512-tnfqpIE/PPbBtwRqmorcREq18uaAx2fjuxXt/+FK8b8ihT5jUcWmQi7/Max9+ftwOyLfzPYUgLnG804KB1Ra+Q==","signatures":[{"sig":"MEUCIQCl+sOWa2l4cbvt01WpNIUVIZMsjnNLAm+Ob31ODXwOpwIgKmXaVoKtsj+jltWv02whW6k2ZEfJDuPe7Dsm0UqSXYw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":202285},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"funding":{"url":"https://trustlayer.foundation","type":"foundation"},"gitHead":"d148c1c6a67c640a335e20cd40b3d37e360c9bf3","scripts":{"test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build && npm run test","generate-fixtures":"tsx scripts/generate-fixtures.ts"},"_npmUser":{"name":"ariaregistry","email":"developers@tuno.bar"},"repository":{"url":"git+https://github.com/trustlayer-foundation/aria-verify.git","type":"git"},"_npmVersion":"11.9.0","description":"Verify AI agent identity offline. ARIA Protocol SDK.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","dependencies":{"@noble/curves":"^2.0.1","@noble/hashes":"^2.0.1","@noble/post-quantum":"^0.5.4"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","tsup":"^8.0.0","vitest":"^3.0.0","typescript":"^5.9.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/verify_1.0.2_1775152521129_0.17012329417627603","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@aria-registry/verify","version":"1.1.0","description":"Verify AI agent identity offline. ARIA Protocol SDK.","license":"Apache-2.0","author":{"name":"TrustLayer Foundation"},"repository":{"type":"git","url":"git+https://github.com/trustlayer-foundation/aria-verify.git"},"homepage":"https://aria.bar","bugs":{"url":"https://github.com/trustlayer-foundation/aria-verify/issues"},"funding":{"type":"foundation","url":"https://trustlayer.foundation"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"sideEffects":false,"keywords":["aria","agent-identity","ai-agent","did","verifiable-credentials","post-quantum","ml-dsa","ed25519","offline-verification","w3c-vc","trust","atp","ariaprotocol"],"engines":{"node":">=18"},"dependencies":{"@noble/post-quantum":"^0.5.4","@noble/curves":"^2.0.1","@noble/hashes":"^2.0.1"},"devDependencies":{"@types/node":"^22.0.0","tsup":"^8.0.0","tsx":"^4.0.0","typescript":"^5.9.0","vitest":"^3.0.0"},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","generate-fixtures":"tsx scripts/generate-fixtures.ts"},"_id":"@aria-registry/verify@1.1.0","_integrity":"sha512-snwPY3/ch5crs7L6Rhk5IhbwZPCOgspZJuqlJR4gmK7pAY26K0uKF25jzJLoCOa0NO9MVVu7iwPFA/CcEltQPw==","_resolved":"/private/var/folders/ry/6r_nq0fd0mzdnn4xrdydjt3w0000gn/T/1eddb4fbcd0fbe4b862f2a86ff2ab13a/aria-registry-verify-1.1.0.tgz","_from":"file:aria-registry-verify-1.1.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-snwPY3/ch5crs7L6Rhk5IhbwZPCOgspZJuqlJR4gmK7pAY26K0uKF25jzJLoCOa0NO9MVVu7iwPFA/CcEltQPw==","shasum":"26c6fe0e75e15741e9e904c3f8fe9fc26e00c840","tarball":"https://registry.npmjs.org/@aria-registry/verify/-/verify-1.1.0.tgz","fileCount":9,"unpackedSize":222354,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGf6imTz9NXhQfUQEQy/XmTeUKZqXrQKfDi2nuRn4Gq3AiBRvjuNPLa2p+5ol3xhjvTHpPl0fcfxCWN1W6I+JRt8lA=="}]},"_npmUser":{"name":"ariaregistry","email":"developers@tuno.bar"},"directories":{},"maintainers":[{"name":"ariaregistry","email":"developers@tuno.bar"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/verify_1.1.0_1777411013862_0.6030958179922168"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-01T20:50:52.358Z","modified":"2026-04-28T21:16:54.144Z","1.0.0":"2026-04-01T20:39:52.859Z","1.0.1":"2026-04-01T20:50:52.693Z","1.0.2":"2026-04-02T17:55:21.304Z","1.1.0":"2026-04-28T21:16:54.035Z"},"bugs":{"url":"https://github.com/trustlayer-foundation/aria-verify/issues"},"author":{"name":"TrustLayer Foundation"},"license":"Apache-2.0","homepage":"https://aria.bar","keywords":["aria","agent-identity","ai-agent","did","verifiable-credentials","post-quantum","ml-dsa","ed25519","offline-verification","w3c-vc","trust","atp","ariaprotocol"],"repository":{"type":"git","url":"git+https://github.com/trustlayer-foundation/aria-verify.git"},"description":"Verify AI agent identity offline. ARIA Protocol SDK.","maintainers":[{"name":"ariaregistry","email":"developers@tuno.bar"}],"readme":"# @aria-registry/verify\n\n**Verify AI agent identity offline. Post-quantum cryptography. Zero dependencies beyond Noble crypto.**\n\n[ARIA](https://aria.bar) (Agent Registry for Identity & Authorization) gives every AI agent a verifiable, cryptographically-signed identity document (AID). This SDK lets any system verify an AID locally — no internet required.\n\nPart of the [ARIA Protocol](https://aria.bar) by [TrustLayer Foundation](https://trustlayer.foundation).\n\n- [Protocol specification](https://aria.bar/spec)\n- [Protocol schema](https://github.com/trustlayer-foundation/aria-protocol)\n- [Security documentation](https://aria.bar/spec#crypto)\n\n## Install\n\n```bash\nnpm install @aria-registry/verify\n```\n\n## Quick Start\n\n```typescript\nimport { verifyAgent } from '@aria-registry/verify';\n\nconst result = await verifyAgent(credential);\n\nif (result.valid) {\n  console.log(result.did);                          // \"did:aria:example.com:my-agent\"\n  console.log(result.trustLevel);                   // \"L1\"\n  console.log(result.scopes);                       // [\"data:general:read\", ...]\n  console.log(result.credentialId);                 // \"https://api.aria.bar/v1/credentials/01906b8f-...\"\n  console.log(result.previousCredentialId);         // URL of the predecessor, or null\n  console.log(result.principal.verificationStatus); // \"self-declared\" | \"registry-confirmed\" | \"legal-verified\" | null\n}\n```\n\n### What's surfaced from AID schema v1.1\n\nEvery verification result includes the v1.1 machine-readable fields so a verifier can act\non identity provenance without re-parsing the raw VC:\n\n| Field | Meaning |\n|---|---|\n| `credentialId` | Unique credential-instance URL — equivalent to a TLS certificate serial number. New on every reissuance. |\n| `previousCredentialId` | URL of the credential this one supersedes, enabling explicit chain-of-issuance walks. `null` on first issuance. |\n| `principal.verificationStatus` | Machine-readable provenance of the legal name: `self-declared` (L0/L1), `registry-confirmed` (L2), or `legal-verified` (L3). `null` for pre-v1.1 credentials. |\n\nPre-v1.1 credentials continue to verify; the v1.1 fields are surfaced as `null`.\n\n## Verify with Policy\n\nApply industry-specific requirements after signature verification:\n\n```typescript\nimport { verifyAgent, PolicyLevel } from '@aria-registry/verify';\n\nconst result = await verifyAgent(credential, {\n  policy: PolicyLevel.FINANCIAL,\n});\n\nif (result.policyResult?.passed) {\n  // Agent meets financial services requirements (L1+, checked in last 24h)\n}\n```\n\n### Reject self-declared organizational identity\n\nFor verifiers that only accept credentials whose principal name was checked against\nan authoritative registry (GLEIF LEI, government registries, etc.), use the\n`requirePrincipalVerified` policy option:\n\n```typescript\nimport { verifyAgent } from '@aria-registry/verify';\n\nconst result = await verifyAgent(credential, {\n  policy: { maxOfflineAge: null, requirePrincipalVerified: true },\n});\n\nif (result.policyResult?.passed) {\n  // principal.verificationStatus is \"registry-confirmed\" or \"legal-verified\"\n}\n// Otherwise result.policyResult.reason starts with \"PRINCIPAL_NOT_VERIFIED:\"\n```\n\nThis closes the L1 brand-impersonation gap: an attacker registering a self-declared\norganization name (e.g. \"Goldman Sachs\" on a look-alike domain) is rejected before\nthe `legalName` is treated as authoritative.\n\n## Parse without Verification\n\nFast inspection of credential contents without signature verification.\nUseful for logging, routing, or UI display — **not for access control**.\n\n```typescript\nimport { parseCredential } from '@aria-registry/verify';\n\nconst parsed = parseCredential(credential);\nif (parsed) {\n  console.log(parsed.agent);       // \"my-agent\"\n  console.log(parsed.trustLevel);  // \"L1\"\n  console.log(parsed.scopes);      // [\"data:general:read\", ...]\n  console.log(parsed.expired);     // false\n}\n```\n\n## Check Revocation Online\n\nThe **only function** that requires internet access:\n\n```typescript\nimport { checkRevocation } from '@aria-registry/verify';\n\ntry {\n  const status = await checkRevocation('did:aria:example.com:agent');\n  console.log(status.status);    // 'active' | 'revoked'\n  console.log(status.checkedAt); // ISO 8601 timestamp\n} catch (err) {\n  // Network error — handle gracefully\n}\n```\n\nCustom API endpoint (for local development or private registries):\n\n```typescript\nconst status = await checkRevocation(did, {\n  apiUrl: 'http://localhost:3003',\n});\n```\n\n## Policy Presets\n\n| Preset | Max Offline Age | Min Trust Level | Revocation Check | Based On |\n|--------|----------------|-----------------|-------------------|----------|\n| `COMMERCE` | Unlimited | L0 | No | — |\n| `FINANCIAL` | 24 hours | L1 | No | NIST SP 800-63-4 / PCI-DSS |\n| `HEALTHCARE` | 1 hour | L1 | No | HIPAA §164.312 |\n| `GOVERNMENT` | 1 hour | L1 | No | NIST SP 800-63-4 IAL2 |\n| `SOVEREIGN` | 15 minutes | L2 | **Yes** | NIST SP 800-63-4 IAL3 |\n\n## Custom Policy\n\n```typescript\nimport { verifyAgent } from '@aria-registry/verify';\nimport type { PolicyConfig } from '@aria-registry/verify';\n\nconst myPolicy: PolicyConfig = {\n  maxOfflineAge: 4 * 60 * 60 * 1000, // 4 hours\n  minTrustLevel: 'L1',\n  requiredScopes: ['data:general:read', 'communication:email:send'],\n  requireRevocationCheck: false,\n  lastRevocationCheck: Date.now() - 60 * 1000, // 1 minute ago\n};\n\nconst result = await verifyAgent(credential, { policy: myPolicy });\n```\n\n## Trust Levels\n\n| Level | Name | Description |\n|-------|------|-------------|\n| L0 | Anchored | Cryptographic identity. Self-service. No DNS required. |\n| L1 | Identified | DNS-anchored and verified. An identified person controls this agent. |\n| L2 | Certified | Organization verified via DoH. vLEI-compatible. |\n| L3 | Sovereign | Legal entity. Government registry. HSM. |\n\n## How It Works\n\nThe SDK verifies ARIA Agent Identity Documents (AIDs) entirely offline. Aligned with ARIA Protocol v1.0 (filed with NIST, March 2026).\n\n1. **Parse** the W3C Verifiable Credential and extract agent metadata\n2. **Check expiration** against the credential's `validUntil` timestamp\n3. **Verify ML-DSA-65** (FIPS 204) — the post-quantum primary signature\n4. **Verify Ed25519** (RFC 8032) — the classical transition signature\n5. **Evaluate policy** constraints (trust level, scopes, offline age)\n\nBoth signatures are verified against the ARIA Registry's public keys, which are embedded in the SDK package. No network calls are made during verification.\n\nThe composite proof format encodes both signatures in a single base64url `proofValue` field using a length-prefix binary layout, following the ARIA composite signature specification (`mldsa65-ed25519-2026`).\n\n## Error Handling\n\n```typescript\nimport { verifyAgent, AriaVerifyError, RevocationCheckError } from '@aria-registry/verify';\n\nconst result = await verifyAgent(input);\nif (!result.valid) {\n  // result.reason contains a machine-readable code + description\n  // e.g. \"SIGNATURE_INVALID: ML-DSA-65 and Ed25519 signature verification failed.\"\n  // e.g. \"EXPIRED: credential has expired\"\n  // e.g. \"MISSING_FIELDS: required fields are missing from credentialSubject.\"\n}\n```\n\n## Security\n\n- The SDK is **verification-only** — it never handles private keys\n- Cryptographic operations use the [Noble](https://paulmillr.com/noble/) library family\n- `@noble/post-quantum` has not yet received an independent security audit — use in production at your own risk assessment\n- Input validation: max 100 KB credential size, strict JSON parsing, no `eval` or `Function`\n- For the full ARIA security specification, see [aria.bar/spec#crypto](https://aria.bar/spec#crypto)\n\n## Runtime Compatibility\n\n- Node.js 18+\n- Modern browsers (Chrome, Firefox, Safari, Edge)\n- Deno\n- Bun\n\n## License\n\nApache 2.0 — [TrustLayer Foundation](https://trustlayer.foundation)\n","readmeFilename":"README.md"}