Verifiable identity and signed action logs for AI agents. Give every agent a
cryptographic identity (did:key), have an operator issue it a passport (a W3C
Verifiable Credential with scopes), and let the agent sign the actions it takes
so anyone can later prove which agent did what — all offline, no ledger.
🌍 English · Português · 📚 Documentation
As autonomous agents start doing real work — sending email, calling APIs, moving money — three questions become urgent:
- Who is this agent? → a stable, verifiable DID.
- What is it allowed to do? → an operator-signed passport with scopes.
- What did it actually do? → signed action logs verifiable against its DID.
agent-passport gives you all three as tiny, offline primitives you can drop into
any agent framework.
npm install agent-passport
import { createIdentity, issuePassport, verifyPassport, assertScope, signAction, verifyAction, } from 'agent-passport'; const operator = createIdentity(); // your company const agent = createIdentity(); // the agent you run // Operator grants the agent a scoped passport. const passportJwt = await issuePassport({ operator, agentDid: agent.did, name: 'support-bot', model: 'claude-fable-5', scopes: ['email:send', 'crm:read'], }); // A verifier checks identity + enforces a scope. const passport = await verifyPassport(passportJwt); assertScope(passport, 'email:send'); // throws if not granted // The agent signs what it did; anyone can verify who did it. const actionJwt = await signAction(agent, { type: 'email:send', target: '[email protected]' }); const done = await verifyAction(actionJwt); console.log(done.agent === agent.did); // true
Run the demo: npm run demo.
| Function | Purpose |
|---|---|
createIdentity(seed?) |
Create an Ed25519 did:key identity for an agent or operator. |
issuePassport(options) |
Operator issues a scoped passport (VC) to an agent. |
verifyPassport(jwt) |
Verify a passport; returns agent identity + scopes. |
hasScope(p, scope) / assertScope(p, scope) |
Check / enforce a scope ("*" = all). |
signAction(agent, action) |
Agent signs a statement of an action it performed. |
verifyAction(jwt) |
Verify an action; returns the signing agent's DID. |
Identities are Ed25519 did:keys (public key embedded in the DID → offline
verification). Passports are W3C Verifiable Credentials (JWT/EdDSA via
did-jwt-vc); actions are
EdDSA JWTs signed by the agent. See docs/en/concepts.md.
Scope: this is the identity/attestation layer. It does not sandbox an agent or intercept its calls — you enforce
assertScopeat your tool boundary and logsignActionresults to your audit store. See docs/en/patterns.md.
MIT © Marcelo Domingues