9. AI Agent Identity
9. AI Agent Identity
← Previous: Operator Identity | Index | Next: Machine Identity →
9.1 The AI Agent Identity Challenge
9.1.1 Emergence of AI Agents
AI agents—LLM-based systems that autonomously perform tasks—represent a new category of workload with unique identity challenges:
| Characteristic | Challenge |
|---|---|
| Autonomous action | Agents act without real-time human approval |
| Human delegation | Agents act on behalf of humans |
| Sub-agent spawning | Agents may create other agents |
| Dynamic scope | Task scope may evolve during execution |
| Tool invocation | Agents call APIs and tools with varying permissions |
9.1.2 Why Traditional Identity Fails
| Traditional Approach | Problem for AI Agents |
|---|---|
| Static ServiceAccount | Agent needs human's permissions, not its own |
| Service-to-service mTLS | Doesn't capture delegation relationship |
| API key | No accountability chain |
| OAuth client credentials | Agent identity, not delegator identity |
9.1.3 Core Requirements
| Requirement | Rationale |
|---|---|
| Delegation tracking | Know who authorized the agent |
| Scope limitation | Agent cannot exceed delegator's permissions |
| Chain preservation | Sub-agents inherit and extend chain |
| Revocation | Delegation can be revoked at any point |
| Audit | Complete trail of delegation and actions |
9.2 Delegation Patterns
9.2.1 OAuth 2.0 Token Exchange (RFC 8693)
Token Exchange enables one identity to act on behalf of another:
Response includes delegation token with claims:
9.2.2 Delegation Token Structure
9.2.3 Delegation Flow
9.3 ARIA Pattern
9.3.1 Agent Relationship-based Identity and Authorization
ARIA extends traditional identity models for AI agents:
| Component | Purpose |
|---|---|
| Agent Identity | Unique identifier for the agent instance |
| Relationship | Who delegated to this agent |
| Scope | What the agent is permitted to do |
| Constraints | Time, resource, and action limits |
9.3.2 ARIA Token Structure
9.3.3 ARIA Policy Enforcement
9.4 Sub-Agent Chains
9.4.1 Chain Delegation
When an agent creates sub-agents:
9.4.2 Chain Preservation
Each delegation preserves the full chain:
9.4.3 Scope Attenuation
Each delegation MUST NOT increase scope:
| Delegation Level | Maximum Scope |
|---|---|
| Human | Full human permissions |
| Primary Agent | ≤ Human's permissions |
| Sub-Agent | ≤ Primary Agent's scope |
| Sub-Sub-Agent | ≤ Sub-Agent's scope |
9.5 Keycloak Integration
9.5.1 Token Exchange Configuration
Configure Keycloak for Token Exchange:
9.5.2 Agent Registration
Agents are registered as Keycloak clients:
9.5.3 Delegation Policies
Define who can delegate to which agents:
9.6 Vault Integration
9.6.1 Agent Authentication to Vault
Agents can authenticate to Vault with delegation tokens:
9.6.2 Delegation-Aware Policies
Vault policies that respect delegation:
9.7 Audit Requirements
9.7.1 Delegation Events
| Event | Required Data |
|---|---|
| Delegation created | Delegator, agent, scope, expiry |
| Delegation used | Agent, action, resource, timestamp |
| Delegation renewed | Original delegation, new expiry |
| Delegation revoked | Delegator/admin, reason, timestamp |
9.7.2 Action Audit
Every agent action must include:
9.7.3 Chain Traceability
9.8 Security Considerations
9.8.1 Threat Model
| Threat | Mitigation |
|---|---|
| Agent impersonation | Unique agent identity, attestation |
| Scope escalation | Strict scope attenuation enforcement |
| Delegation theft | Short-lived tokens, binding to agent |
| Rogue sub-agents | Chain visibility, revocation cascade |
| Data exfiltration | Rate limits, resource constraints |
9.8.2 Defense in Depth
| Layer | Control |
|---|---|
| Identity | Agent attestation (SPIFFE or registered client) |
| Delegation | Token Exchange with scope validation |
| Authorization | Policy enforcement at resource |
| Network | mTLS, service mesh |
| Audit | Complete delegation chain logging |
9.8.3 Revocation Cascade
When a delegation is revoked:
All downstream delegations are automatically invalidated.
9.9 Implementation Guidance
9.9.1 Phased Adoption
| Phase | Scope |
|---|---|
| Phase 1 | Simple delegation (human → agent) |
| Phase 2 | Vault integration with delegation |
| Phase 3 | Sub-agent chains |
| Phase 4 | Full ARIA policy enforcement |
9.9.2 Agent Framework Integration
Agent frameworks should:
- Obtain delegation token before actions
- Pass delegation token to all API calls
- Propagate chain to sub-agents
- Log all actions with chain context
9.9.3 Example: Claude Code Agent
9.10 Compliance Mapping
9.10.1 Invariant Enforcement
| Invariant | AI Agent Implementation |
|---|---|
| INV-8 | Token Exchange preserves delegation chain |
| INV-9 | Scope attenuation at each delegation level |
| INV-11 | Complete delegation event logging |
| INV-12 | Chain ID for cross-system correlation |
9.10.2 Audit Completeness
Every agent interaction produces:
| Audit Record | Source |
|---|---|
| Delegation creation | Keycloak audit |
| Vault access | Vault audit with delegation context |
| API calls | Application logs with chain |
| Sub-delegations | Keycloak audit |
| Revocations | Keycloak audit |
Document Navigation
| Previous | Index | Next |
|---|---|---|
| ← 8. Operator Identity | Table of Contents | 10. Machine Identity → |
End of Section 9