Open source auth SDK

Identity for humans.
Identity for AI agents.

Give every AI agent a cryptographic identity, scoped permissions, and an audit trail. Plugs into your existing auth stack.

pnpm add kavachos

How it works

With KavachOS

Human

logs in

Clerk / Auth.js / etc.

Your app

session active

kavachos

AI agent

kv_... token

authorize()
KavachOS
MCPscoped
Auditlogged
Delegatechain
identityleast privilegeaudit trail

Without

Human

logs in

Your app

session

AI agent

no identity

shared .env key

MCP server

wide open

no identityno scopingno audit
Can't revoke one agent without rotating all keys

Features

01 Agent identity

Cryptographic bearer tokens.

SHA-256 hashed, shown once, rotatable. Each agent is a first-class identity.

kv_a3f8c2...e91b

02 Permission engine

Wildcard resource matching.

Rate limits, time windows, IP allowlists, and human-in-the-loop approval gates.

mcp:github:*mcp:slack:readmcp:deploy:*

03 Delegation chains

Agent-to-agent delegation.

Pass a strict subset of permissions to a sub-agent. Depth limits and expiry built in.

orchestratorsub-agentworker

04 Audit trail

Every call recorded.

Query by agent, action, or outcome. Export to JSON or CSV for compliance.

allowedread:github:repos2s ago
deniedwrite:deploy:prod5s ago
allowedread:slack:messages12s ago

05 MCP OAuth 2.1

Spec-compliant auth server.

Full authorization server for Model Context Protocol with PKCE S256.

PKCE S256RFC 9728RFC 8707RFC 7591

06 Framework adapters

Works with your stack.

Core has zero deps. Adapters for seven frameworks and any JS runtime.

HonoExpressNext.jsFastifyNuxt+2

Why now

41%

of MCP servers have zero auth

Bitsight 2025

97M

monthly MCP SDK downloads

npm

10K+

MCP servers deployed

Linux Foundation

Aug 2026

EU AI Act enforcement

Article 12

Comparison

KavachOSbetter-authDIY
Agent-first identity×depends
Wildcard permissions×depends
Delegation chains××
MCP OAuth 2.1××
Immutable auditpartial×
Token rotation××
Framework agnostic

Armor for every identity

TypeScript, MIT licensed, works with any auth provider.