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.
An
AgentIdentity is the primary entity in KavachOS. It represents one AI agent, a process acting on behalf of a human user. Agents are not users. No password, no session, no OAuth flow. Just a token, a set of permissions, and an audit row for every call.Create one against an existing user ID, hand the token to the agent, and check every action through authorize().Anatomy
Stable identifier with an
agt_ prefix. Never changes.Bearer token with a
kv_ prefix. Shown once at creation, then SHA-256 hashed. Rotate to replace.What this agent is allowed to do. Evaluated at every
authorize() call.Current state. Revocation is permanent.
The user ID from your auth provider who owns this agent.
Human-readable label.
Determines how the agent acquires and uses permissions.
Optional expiry. After this time,
status becomes expired.Arbitrary key/value pairs for your own use.
Agent types
autonomous
autonomous
Acts independently without requiring human approval on each call, unless a permission constraint mandates it. The standard type for background agents, cron jobs, and AI assistants that run unattended.
delegated
delegated
Receives permissions from another agent via a delegation chain rather than having them declared at creation. Use this for ephemeral sub-agents spun up to complete one task, then discarded.
service
service
Long-lived identity for infrastructure, such as an MCP server or an internal microservice that calls other services on behalf of users. Treat it like a service account.
Lifecycle
Authenticate
Tokens use the
kv_ prefix followed by 32 random bytes as 64 hex chars. Pass as a Bearer credential:Authorize
When a caller only has the raw token, use One database lookup (hash compare), then in-memory permission evaluation. No JWTs, no network round-trip.
authorizeByToken in your HTTP middleware:Rotate
Rotation issues a new token and immediately invalidates the old one. Atomic: no window where both are valid.Rotate on a schedule, or any time you suspect a token has been exposed.
Update or list
Permission updates take effect immediately. In-flight requests that already passed authorization are not affected.
Limits
The default is 10 active agents per user. Raise at initialization:AGENT_LIMIT_EXCEEDED.
What agents aren’t
An agent is not a user. It has no email, no password, no session, no OAuth account. It has a bearer token and a permission set. If you find yourself reaching for password reset, email verification, or social sign-in on an agent, you want a user, not an agent. Create the user first, then create agents that the user owns.
Next steps
Permission engine
Define what agents can and cannot do.
Delegation chains
Let agents delegate access to sub-agents.
Ephemeral sessions
Short-lived agents for one-off tasks.
Framework adapters
Use agents in HTTP middleware.