@lumoauth/agent
v1.0.0
Published
LumoAuth AAuth client — agent identity, HTTP message signing (RFC 9421), and agent-to-agent delegation. Node 18+ only.
Readme
@lumoauth/agent
The LumoAuth SDK for AI agents (Node 18+). Two layers:
LumoAgent— high-level client: OAuth 2.0 client-credentials auth with transparent refresh, preflight checks (ask/isAllowed), self-inspection (capabilities,budget), and thejit,delegation,approvals, andmcpnamespaces.AAuthClient+ signing primitives — the AAuth protocol: cryptographic agent identity, proof-of-possession tokens, and RFC 9421 HTTP message signing (node:crypto, hence Node-only).
Install
npm install @lumoauth/agentExample
import { LumoAgent } from '@lumoauth/agent';
// Reads LUMOAUTH_URL / LUMOAUTH_ORG_ID / AGENT_CLIENT_ID / AGENT_CLIENT_SECRET
const agent = new LumoAgent();
// Preflight before running a tool
if (!(await agent.isAllowed('document.read', { id: 'doc_99' }))) {
throw new Error('not allowed');
}
// Human approval for an irreversible action — push lands on the user's phone
const approval = await agent.approvals.require({
taskId: 'wire-001',
reason: 'Wire $4,500 to vendor INV-7741',
impact: 'high',
onBehalfOf: '[email protected]',
});
if (approval.status !== 'approved') throw new Error(`denied: ${approval.status}`);
// Short-lived token for a secured MCP server
const mcpToken = await agent.mcp.getToken('urn:mcp:financial-data');Docs
https://docs.lumoauth.dev
License
MIT
