feat: agent identity protocol, CIBA proof claims, and E2E hardening#123
Merged
gustavovalverde merged 5 commits intomainfrom Mar 22, 2026
Merged
feat: agent identity protocol, CIBA proof claims, and E2E hardening#123gustavovalverde merged 5 commits intomainfrom
gustavovalverde merged 5 commits intomainfrom
Conversation
Implement the full agent identity system (PRD-04 + PRD-05): - Durable host / ephemeral session identity model with Ed25519 keys - Capability-based authorization (host policies + session grants) - Grant evaluator for CIBA auto-approval, replacing boundary system - Append-only usage ledger with daily caps, amount limits, and cooldown - Risk-graduated approval routing (auto, push, manual) - Pairwise agent subject identifiers per relying party - Three-clock session lifecycle (expiry, idle, absolute max) - Agent/host revocation and host key rotation - AAP token profile (act.sub, authorization_details) per draft-oauth-ai-agents - Agent-Assertion JWT (Ed25519) verified on every CIBA request - Vendor attestation pipeline with hardened JWKS fetcher - RFC 7662-style agent introspection endpoint - Agent discovery at /.well-known/agent-configuration - Dashboard for agent management at /dashboard/agents Schema: agent_host, agent_session, agent_host_policy, agent_session_grant, capability_usage_ledger. Seeded capabilities: purchase, biometric, read_profile, check_compliance, request_approval. Removes: boundary system, agent-claims, auto-approve, agent-policies UI.
Add agent identity layer to the MCP server: - Persistent host key (Ed25519) with XDG-compliant storage - Agent session registration against Zentity auth endpoints - Agent-Assertion JWT attached to every CIBA request - Host-first bootstrap: register host before session on each start - Runtime manager for session lifecycle - CIBA requests carry agent metadata (host_id, task_id, task_hash) - Purchase tool sends authorization_details with agent assertion - Whoami tool surfaces host/session identity - HTTP and stdio transports updated for agent context propagation
Demo RP (apps/demo-rp): - Agent runtime module with Ed25519 key, host/session registration - Aether AI scenario updated for AAP token flow - DCR route hardened with DPoP and attestation headers - Vendor tarballs updated to better-auth 1.5.1-beta.3 Documentation: - New agent-architecture.md (replaces agentic-authorization.md) - ADR-0004: agent-provider-adapter architecture decision record - Updated attestation-privacy-architecture.md with agent data classification - Updated oauth-integrations.md with agent endpoints Landing page: - Agents page and compliance standards text updates
- Copy vendor/ directory before pnpm install in demo-rp Dockerfile (vendor tarballs are referenced in package.json as file: deps) - Remove --reporter github-actions from knip invocation (knip 5.87.0 dropped the --reporter flag)
The deny-all .dockerignore excluded vendor tarballs from the Docker build context, causing pnpm install to fail on file: dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Agent Auth Protocol for Zentity: a system that gives agents enough identity to act on behalf of humans without turning the agent into a long-term container for human PII.
The design solves three problems at once: the caller authenticates as a machine, the human still approves sensitive actions, and the relying party learns who acted without getting a globally trackable agent identifier.
See Agent Architecture for the full design narrative.
Standards implemented
Architecture
The implementation is organized around five protocol concerns that form a chain:
Principal boundaries
Three distinct caller classes, each with its own auth helper:
requireBrowserSession()requireUserAccessToken()client_credentials→requireClientCredentials()Agent registration and lifecycle are machine-facing OAuth surfaces. Human approval comes later through CIBA.
Host and session hierarchy
Agent identity splits into two layers because two lifetimes need two keys:
agent_host) — Ed25519 keypair persisted per installation, keyed bypublic_key_thumbprint. Survives restarts. One user+client can have multiple hosts (laptops, containers).agent_session) — fresh Ed25519 keypair per process. Registered with a host-signedhost-attestation+jwt. Carries runtime metadata (display_name, model, version).Trust tiers
Two operational tiers based on what Zentity can verify about the installation:
unverifiedcheck_compliance,request_approvalattestedOAuth-Client-Attestation+ PoP againstTRUSTED_AGENT_ATTESTERSread_profileAttestation widens default host policy — it does not mint a separate token class.
Capability containment
Answers one question repeatedly: "Can this session do this action without interrupting the user?"
agent_host_policy) — durable grants with constraint operators (max,min,in,not_in,eq)agent_session_grant) — ephemeral, seeded from host policy at registrationcapability_usage_ledger) — append-only, enforcesdaily_limit_count,daily_limit_amount,cooldown_secgrant-evaluation.ts) — the sole CIBA auto-approve pathAuto-approval is refused for: identity scopes, missing capabilities, biometric-strength capabilities, no matching grant, or exceeded limits.
Approval routing
Three outcomes based on risk, not transport:
biometricpurchasealways routes to biometric approval.read_profilecan become silent for attested hosts.Token anatomy (AAP profile)
CIBA access tokens carry the AAP draft claim vocabulary:
agent,task,capabilities,oversight,audit. Exchanged tokens additionally carrydelegation.sub— human pairwise identifier for target clientact.sub— agent pairwise identifier for target client (derived from session ID + sector)authorization_details— round-tripped from CIBA request through approval to tokenpurchase-authorization+jwt— RFC 8693 exchange artifact for downstream merchantsBinding chain
Each phase produces evidence the next can reuse:
Lifecycle
Two session clocks (idle TTL: 30min, max lifetime: 24h). No reactivation — expired sessions require fresh registration under the same host. Host key rotation invalidates all sessions.
Discovery and introspection
/.well-known/agent-configuration— protocol discovery (endpoints, algorithms, features)GET /api/auth/agent/capabilities— capability catalog with schemas and approval strengthsPOST /api/auth/agent/introspect— RFC 7662-style, re-evaluates session lifecycle at query timeGET /api/auth/agent/jwks— signing keys for agent-facing JWT verification/.well-known/agent-card.json— A2A agent card withagent-authsecurity schemeWhat changed
New (apps/web)
agent_host,agent_session,agent_host_policy,agent_session_grant,capability_usage_ledgergrant-evaluation.ts,agent-binding.ts,agent-jwt.ts,agent-lifecycle.ts,aap-profile.ts,pairwise-agent.ts,usage-ledger.ts,approval-path.ts/dashboard/agentsmanagement UINew (apps/mcp)
Agent-Assertionattached to all CIBA requestsauthorization_detailsNew (apps/demo-rp)
Removed
agent-boundaries.ts,boundary-evaluation.ts,auto-approve.ts,/dashboard/agent-policies)agent-claims.ts(replaced byaap-profile.ts)agentic-authorization.md(replaced byagent-architecture.md)