@agentic-passport/agent
v0.4.1
Published
AgentPassport agent SDK — HTTP client that runs the handshake.
Maintainers
Readme
@agentic-passport/agent
Agent-side AgentPassport client. HTTP-only. Runs the full handshake (discovery → mandate → register → authorize) and returns a fetch-like session.
Install
pnpm add @agentic-passport/agentUse
import { AgentClient, HostedMandateProvider, generateEd25519KeyPair } from '@agentic-passport/agent';
const { publicKey, privateKey } = generateEd25519KeyPair();
const agent = new AgentClient(
{
keyId: 'my-agent-1',
publicKey,
privateKey,
directoryUrl: 'https://my-agent.example/.well-known/http-message-signatures-directory',
},
new HostedMandateProvider({ issuerUrl: 'https://issuer.agentpassport.app' }),
);
const session = await agent.access('https://vendor.example', {
task: 'find top keywords for "ai oauth"',
budget: { usd: 5 },
scopes: ['keyword.search'],
});
const res = await session.fetch('https://vendor.example/api/search?q=ai+oauth');
const data = await res.json();
console.log(session.audit()); // signed JSONL trailYou never touch RFC 9421 canonicalization, DPoP proofs, mandate JWTs, or OAuth token exchange. All inside agent.access().
Claude Code skill
The companion agentpassport skill activates on WWW-Authenticate: AgentPassport 401s and runs this handshake automatically.
Spec
License
Apache-2.0. Repository
