Auth for AI agents. KavachOS gives every agent its own identity, checks permissions at call time, and writes an audit row for every decision. Plugs in after your human auth (Clerk, Auth.js, better-auth, or your own). Runs on Node, edge, Workers, Deno, and Bun.Documentation Index
Fetch the complete documentation index at: https://docs.kavachos.com/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Agent in five minutes.
npm install
npm i kavachosWhat’s in the box
Agent identity as a first-class entity, not an extension of a user.
Resource wildcards with rate limits, time windows, and IP allowlists.
Delegation chains with depth, expiry, and cascading revocation.
Append-only audit with JSON and CSV export.
MCP OAuth 2.1 authorization server, PKCE and DCR built in.
Trust scoring per agent with anomaly detection and budget caps.
Ten adapters for Node, edge, Workers, Deno, Bun.
Four databases: SQLite, Postgres, MySQL, Cloudflare D1.
Web Crypto only in core, no Node-specific APIs.
How it fits with your stack
KavachOS does not replace your human auth. It does not handle login forms, password resets, or social OAuth for users. It starts where human auth ends, at the point your product spins up an agent to act on a user’s behalf.
Pick your framework
Next.js
App Router and Pages.
Hono
Workers, Deno, Bun.
Express
Classic Node handlers.
Fastify
Plugins and decorators.
NestJS
Guards and decorators.
Nuxt
Server routes.
SvelteKit
Hooks and endpoints.
Astro
Server islands.
The six primitives
Agent identity
Bearer tokens (
kv_...), rotation, expiry. SHA-256 hashed at rest.Permission engine
Resource wildcards, rate limits, time windows, IP allowlists, approval gates.
Delegation
Orchestrator delegates a subset to a sub-agent with depth and expiry. Revocation cascades.
Audit trail
Every
authorize() writes agent, user, resource, action, result, duration.MCP OAuth 2.1
Spec-compliant AS with PKCE S256, RFC 9728, RFC 7591.
Trust scoring
Nine-factor score per agent. Anomaly detection and budget policies on top.
Switching from another auth library
From better-auth
Concepts map, code diffs, data migration SQL.
From Clerk
Hooks, middleware, Clerk data export, rollout plan.