Agent Identity Protocol (AIP) Specification
Version: v1alpha2Status: Draft
Last Updated: 2026-01-24
Authors: Eduardo Arango ([email protected])
Abstract
The Agent Identity Protocol (AIP) defines a standard for policy-based authorization of AI agent tool calls. AIP enables runtime environments to enforce fine-grained access control over Model Context Protocol (MCP) tool invocations, providing a security boundary between AI agents and external resources. This specification defines:- The policy document schema (
AgentPolicy) - Evaluation semantics for authorization decisions
- Agent identity and session management (new in v1alpha2)
- Server-side validation endpoints (new in v1alpha2)
- Error codes for denied requests
- Audit log format for compliance
Table of Contents
- Introduction
- Terminology
- Policy Document Schema
- Evaluation Semantics
- Agent Identity (new in v1alpha2)
- Server-Side Validation (new in v1alpha2)
- Error Codes
- Audit Log Format
- Conformance
- Security Considerations
- IANA Considerations
- Appendix A: Complete Schema Reference
- Appendix B: Changelog
- Appendix C: References
- Appendix D: Future Extensions
- Appendix E: Implementation Notes
1. Introduction
1.1 Motivation
AI agents operating through the Model Context Protocol (MCP) have access to powerful tools: file systems, databases, APIs, and cloud infrastructure. Without a policy layer, agents operate with unrestricted access to any tool the MCP server exposes. AIP addresses this gap by introducing:- Capability declaration: Explicit allowlists of permitted tools
- Argument validation: Regex-based constraints on tool parameters
- Human-in-the-loop: Interactive approval for sensitive operations
- Audit trail: Immutable logging of all authorization decisions
- Agent identity: Cryptographic binding of policies to agent sessions (new in v1alpha2)
- Server-side validation: Optional HTTP endpoints for distributed policy enforcement (new in v1alpha2)
1.2 Goals
- Interoperability: Any MCP runtime can implement AIP
- Simplicity: YAML-based policies readable by security teams
- Defense in depth: Multiple layers (method, tool, argument, identity)
- Fail-closed: Unknown tools are denied by default
- Zero-trust ready: Support for token-based identity verification (new in v1alpha2)
1.3 Non-Goals
The following are explicitly out of scope for this version of the specification:- Network egress control (see Appendix D: Future Extensions)
- Subprocess sandboxing (implementation-defined)
- External identity federation (OIDC/SPIFFE - see Appendix D)
- Rate limiting algorithms (implementation-defined)
- Policy expression languages beyond regex (CEL/Rego - see Appendix D)
1.4 Relationship to MCP
AIP is designed as a security layer for MCP. It interceptstools/call requests and applies policy checks before forwarding to the MCP server.
1.5 Relationship to MCP Authorization
MCP defines an optional OAuth 2.1-based authorization layer (MCP 2025-06-18 and later). AIP is complementary to MCP authorization:
Implementations MAY use both MCP authorization (for server access) and AIP (for tool access) simultaneously.
2. Terminology
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.3. Policy Document Schema
3.1 Document Structure
An AIP policy document is a YAML file with the following top-level structure:3.2 Required Fields
3.3 Metadata
3.3.1 Policy Signature (v1alpha2)
Thesignature field provides cryptographic integrity verification for the policy document.
Format: <algorithm>:<base64-encoded-signature>
Supported algorithms:
ed25519- Ed25519 signature (RECOMMENDED)
3.4 Spec Fields
[Sections 3.4.1 through 3.6 remain unchanged from v1alpha1]3.4.1 mode
Controls enforcement behavior.
Implementations MUST support both modes.
3.4.2 allowed_tools
A list of tool names that the agent MAY invoke.3.4.3 allowed_methods
A list of JSON-RPC methods that are permitted. If not specified, implementations MUST use the default safe list:* MAY be used to allow all methods.
3.4.4 denied_methods
A list of JSON-RPC methods that are explicitly denied. Denied methods take precedence over allowed methods.3.4.5 protected_paths
A list of file paths that tools MUST NOT access. Any tool argument containing a protected path MUST be blocked.- Expand
~to the user’s home directory - Automatically protect the policy file itself
3.4.6 strict_args_default
Whentrue, tool rules reject any arguments not explicitly declared in allow_args.
Default: false
3.5 Tool Rules
Tool rules provide fine-grained control over specific tools.3.5.1 Actions
3.5.2 Rate Limiting
Format:<count>/<period>
Example:
"10/minute", "100/hour", "5/second"
Rate limiting algorithm is implementation-defined (token bucket, sliding window, etc.).
3.5.3 Argument Validation
Theallow_args field maps argument names to regex patterns.
- Use a regex engine with linear-time guarantees (RE2 or equivalent)
- Match against the string representation of the argument value
- Treat missing constrained arguments as a violation
3.5.4 Tool Schema Hashing (v1alpha2)
Theschema_hash field provides cryptographic verification of tool definitions to prevent tool poisoning attacks.
Format: <algorithm>:<hex-digest>
Supported algorithms:
sha256(RECOMMENDED)sha384sha512
Use cases:
- Tool poisoning prevention: Detect when an MCP server changes a tool’s behavior after policy approval
- Compliance auditing: Prove that approved tools haven’t been modified
- Supply chain security: Pin specific tool versions in policy
- Schema hashes MUST be regenerated when MCP server is updated
- Implementations SHOULD log hash mismatches with both expected and actual hashes
- Policy authors SHOULD document which tool version the hash corresponds to
3.6 DLP Configuration
Data Loss Prevention (DLP) scans for sensitive data in requests and responses.3.6.1 scan_requests (v1alpha2)
Whentrue, DLP patterns are applied to tool arguments before the request is forwarded.
Default: false (backward compatible)
Use case: Prevents data exfiltration via arguments (e.g., embedding secrets in API queries).
3.6.2 scan_responses
Whentrue, DLP patterns are applied to tool responses.
Default: true
3.6.3 max_scan_size (v1alpha2)
Maximum size of content to scan per request/response. Format: Size string (e.g.,"1MB", "512KB", "10MB")
Default: "1MB"
Content exceeding this limit:
- SHOULD be truncated for scanning (scan first
max_scan_sizebytes) - MUST log a warning
3.6.4 on_request_match (v1alpha2)
Action when DLP pattern matches in a request (whenscan_requests: true).
Default:
block
Security note: redact for requests may produce invalid tool arguments. Use with caution.
Redaction failure handling (v1alpha2):
When on_request_match: "redact" is configured, redacted content may cause downstream failures:
- Invalid JSON: Redaction in nested structures may break JSON parsing
- Schema validation failure: Redacted values may violate tool argument schemas
- Tool execution failure: The MCP server may reject redacted arguments
on_redaction_failure values:
Example configuration:
Example error response:
log_original_on_failure: true will log sensitive data that DLP attempted to redact. This SHOULD only be enabled:
- In development environments
- With appropriate log access controls
- For time-limited forensic investigations
3.6.5 Pattern Scope (v1alpha2)
Patterns can be scoped to requests, responses, or both:3.7 Identity Configuration (v1alpha2)
Theidentity section configures agent identity and token management.
3.7.1 enabled
Whentrue, the AIP engine generates and manages identity tokens for the session.
Default: false
3.7.2 token_ttl
The time-to-live for identity tokens. Format: Go duration string (e.g.,"5m", "1h", "300s")
Default: "5m" (5 minutes)
Implementations SHOULD use short TTLs (5-15 minutes) to limit token theft window.
3.7.3 rotation_interval
How often to rotate tokens before expiry. Format: Go duration string Default:"4m" (4 minutes, ensuring rotation before 5m TTL)
Constraint: rotation_interval MUST be less than token_ttl.
Validation behavior (v1alpha2):
When loading a policy, implementations MUST validate the rotation_interval constraint:
Invalid configuration example:
Disabling rotation:
Setting
rotation_interval: "0s" disables automatic rotation. Tokens will only be refreshed when explicitly requested or when they expire.
3.7.4 require_token
Whentrue, all tool calls MUST include a valid identity token. Calls without tokens are rejected with error code -32008.
Default: false
This enables gradual rollout: start with require_token: false to generate tokens without enforcement, then enable enforcement.
3.7.5 session_binding
Determines what context is bound to the session identity.3.7.6 nonce_window
The duration to retain nonces for replay detection. Format: Go duration string Default: Equalstoken_ttl (e.g., "5m" if token_ttl is "5m")
Purpose: Bounds the storage required for replay prevention. Nonces older than nonce_window MAY be pruned from storage.
Constraints:
nonce_windowMUST be greater than or equal totoken_ttl- Setting
nonce_windowless thantoken_ttlis a configuration error
Example:
3.7.7 policy_transition_grace
The grace period during which tokens issued with the previous policy hash remain valid after a policy update. Format: Go duration string Default:"0s" (no grace period - strict policy enforcement)
Purpose: Allows gradual policy rollouts without invalidating all in-flight tokens immediately.
Behavior:
- When policy is updated, the previous policy hash is retained in
recent_policy_hashes - Tokens with either current or recent policy hash are accepted during the grace period
- After grace period expires, only current policy hash is valid
policy_transition_graceSHOULD be less thantoken_ttlto ensure policy changes take effect within one token lifetime- Setting very long grace periods weakens security guarantees
3.7.8 audience (v1alpha2)
The intended audience for identity tokens. This value is included in the token’saud claim and MUST be validated by recipients.
Format: URI string identifying the MCP server or service
Default: Value of metadata.name
Purpose: Prevents tokens issued for one MCP server from being accepted by another. This is critical for:
- Multi-tenant deployments where agents access multiple MCP servers
- Defense against token theft and replay across services
- Compliance with OAuth 2.1 audience binding requirements (RFC 8707)
- Implementations MUST reject tokens where
auddoes not match the expected audience - When
server.enabled: true, the audience SHOULD be the server’s canonical URL - Wildcards are NOT permitted in audience values
audienceMUST be a valid URI or the policymetadata.name- Empty string is NOT valid; use default (metadata.name) instead
3.7.9 nonce_storage (v1alpha2)
Configuration for distributed nonce storage, required for multi-instance deployments.
Storage type requirements:
Example configurations:
type: "memory" with multiple AIP instances is a security vulnerability that allows cross-instance replay attacks. Implementations SHOULD warn when memory storage is detected in environments with multiple instances.
3.8 Server Configuration (v1alpha2)
Theserver section configures optional HTTP endpoints for server-side validation.
3.8.1 enabled
Whentrue, the AIP engine starts an HTTP server for remote validation.
Default: false
3.8.2 listen
The address and port to bind the HTTP server. Format:<host>:<port> or :<port>
Default: "127.0.0.1:9443" (localhost only)
⚠️ Security: Binding to 0.0.0.0 exposes the validation endpoint to the network. Implementations MUST require TLS when listen address is not localhost.
3.8.3 failover_mode
Defines behavior when the validation server is unreachable (for clients) or when internal validation fails (for server).
Default:
fail_closed (deny-by-default for security)
fail_closed (RECOMMENDED for production):
- All validation requests are denied when server is unreachable
- Returns error code -32001 (Forbidden) with reason “validation_unavailable”
- Highest security, may cause availability issues
- All requests are allowed when server is unreachable
- Logs warning: “failover_mode=fail_open triggered”
- ⚠️ Only use in development or when availability > security
failover_mode: "fail_open" is configured, implementations SHOULD require additional constraints to limit exposure:
Example with constraints:
- When validation server becomes unreachable:
- Increment fail_open counter
- Check if
max_requestsexceeded → revert to fail_closed - Check if
max_durationexceeded → revert to fail_closed - If request tool NOT in
allowed_tools→ block with -32001 - If
require_local_policyand no valid local policy → block with -32001 - POST to
alert_webhook(async, fire-and-forget) - Allow request, log warning
- Implementations SHOULD warn at policy load time if
fail_openis used without constraints - Implementations MUST log every request processed in fail_open mode
- Implementations SHOULD expose a metric
aip_fail_open_requests_total
- Falls back to local policy file evaluation
- Requires local policy to be loaded and valid
- Provides security with graceful degradation
3.8.4 timeout
Maximum time to wait for validation server response. Format: Go duration string Default:"5s" (5 seconds)
After timeout, the failover_mode behavior is triggered.
Example:
3.8.5 TLS Configuration
When the listen address is not localhost (127.0.0.1 or ::1), TLS MUST be configured.
- PEM-encoded certificates and keys
- Let’s Encrypt/ACME integration (implementation-defined)
3.8.6 Endpoints
Customizable endpoint paths:4. Evaluation Semantics
[Sections 4.1 through 4.5 remain unchanged from v1alpha1]4.1 Name Normalization
Tool names and method names MUST be normalized before comparison using the following algorithm:- Fullwidth characters:
delete→delete - Ligatures:
file→file - Zero-width characters:
delete→delete
4.2 Method-Level Authorization
Method authorization is the FIRST line of defense, evaluated BEFORE tool-level checks.4.3 Tool-Level Authorization
Tool authorization applies totools/call requests.
4.4 Decision Outcomes
4.5 Argument Validation
STRING() function converts values to string representation:
- String → as-is
- Number → decimal representation
- Boolean → “true” or “false”
- Null → empty string
- Array/Object → JSON serialization
5. Agent Identity (v1alpha2)
This section defines the agent identity model introduced in v1alpha2.5.1 Overview
Agent identity provides:- Session binding: Cryptographic proof that requests belong to the same session
- Policy integrity: Verification that the policy hasn’t changed mid-session
- Replay prevention: Nonces prevent token reuse across sessions
- Audit correlation: Session IDs link related audit events
5.2 Policy Hash
The policy hash uniquely identifies a policy configuration.5.2.1 Canonical Form
Before hashing, the policy MUST be converted to canonical form:5.2.2 Hash Computation
5.3 Identity Token Structure
An AIP Identity Token is a JWT-like structure (but NOT necessarily JWT-encoded) with the following fields:5.3.2 Binding Object (v1alpha2)
Thebinding object ties tokens to their execution context:
Hostname Normalization (v1alpha2):
Hostnames MUST be normalized for consistent binding:
Kubernetes deployment:
For Kubernetes deployments, inject pod UID via downward API:
Strict binding in ephemeral environments:
⚠️ Using
session_binding: "strict" in Kubernetes or serverless environments may cause issues:
- Pod restarts change pod UID → tokens invalid
- Horizontal scaling creates multiple instances → tokens not portable
5.3.1 Token Encoding
Implementations MUST encode tokens using one of the following formats:
JWT Encoding (REQUIRED for server mode):
When
server.enabled: true, tokens MUST be encoded as RFC 7519 JWTs. This ensures interoperability with external systems and standard JWT libraries.
JWT Header:
ES256(ECDSA with P-256 and SHA-256) - RECOMMENDED for productionEdDSA(Ed25519) - RECOMMENDED for performanceHS256(HMAC-SHA256) - MAY be used only whenserver.enabled: false
HS256 requires a shared secret, which is unsuitable for distributed validation. Implementations MUST reject HS256 tokens on server endpoints.
Compact Encoding (local-only):
When server.enabled: false, implementations MAY use compact encoding:
5.4 Token Lifecycle
5.4.1 Token Issuance
Tokens are issued when:- Session starts (first tool call with
identity.enabled: true) - Rotation interval elapsed
- Policy changes (new policy_hash)
5.4.2 Token Rotation
Rotation creates a new token while the old token is still valid (grace period).5.4.3 Token Validation
5.5 Session Management
5.5.1 Session Start
A session starts when:- The AIP engine loads a policy with
identity.enabled: true - A new process starts with AIP configured
5.5.2 Session End
A session ends when:- The AIP engine process terminates
- The policy is unloaded or changed significantly
- Explicit session termination (implementation-defined)
5.5.3 Session ID
Session IDs MUST be:- UUID v4 (random) - RECOMMENDED
- Globally unique
- Not predictable
5.6 Token and Session Revocation (v1alpha2)
Revocation allows immediate invalidation of tokens or sessions before their natural expiration.5.6.1 Revocation Targets
5.6.2 Revocation Storage
Implementations MUST maintain a revocation set containing:- Revoked sessions SHOULD be retained for
max_session_duration(implementation-defined, default: 24h) - Revoked tokens SHOULD be retained for
nonce_windowduration (then naturally expire)
5.6.3 Revocation Check
Token validation MUST include revocation check:5.6.4 Local Revocation
For local-only deployments (server.enabled: false), implementations SHOULD provide:
- Signal handler (e.g.,
SIGUSR1) to trigger session termination - File-based revocation list that is polled periodically
- API for programmatic revocation (implementation-defined)
5.7 Compatibility with Agentic JWT
AIP Identity Tokens are designed to be compatible with the emerging Agentic JWT standard (draft-goswami-agentic-jwt-00). Implementations MAY support Agentic JWT by:- Computing
agent_checksumfrom policy content - Including
agent_proofclaims in JWT tokens - Supporting the
agent_checksumOAuth grant type
5.8 Key Management (v1alpha2)
This section defines key management requirements for JWT signing whenserver.enabled: true.
5.8.1 Key Configuration
5.8.2 Supported Algorithms
⚠️ Security:
HS256 uses symmetric keys and MUST NOT be used when server.enabled: true. Implementations MUST reject this configuration.
5.8.3 Key Sources
generate (default):- Implementation generates and manages keys automatically
- Private key stored in memory (RECOMMENDED) or encrypted file
- JWKS endpoint exposes public keys for verification
- Key loaded from PEM file
- Implementation MUST NOT expose private key
- Key rotation requires file replacement and restart/reload
- Keys managed by external KMS (HashiCorp Vault, AWS KMS, etc.)
- Implementation-defined integration
5.8.4 Key Rotation
Keys SHOULD be rotated periodically to limit exposure from key compromise. Rotation process:- New keys MUST be added to JWKS before becoming active
- Old keys MUST remain in JWKS for at least
token_ttlafter rotation - Implementations MUST support at least 2 concurrent keys in JWKS
5.8.5 JWKS Endpoint
Whenserver.enabled: true, implementations MUST expose a JWKS endpoint for token verification.
Request:
- Clients SHOULD cache JWKS responses
Cache-Controlheader SHOULD indicate TTL (default: 1 hour)- Clients MUST refresh JWKS when encountering unknown
kid
5.8.6 Key Compromise Response
If a signing key is compromised:- Immediate: Remove compromised key from JWKS
- Generate: Create new signing key
- Revoke: Revoke all sessions that used compromised key
- Rotate: Force token rotation for all active sessions
- Audit: Log compromise event with forensic details
6. Server-Side Validation (v1alpha2)
This section defines the optional HTTP server for remote policy validation.6.1 Overview
The AIP server provides:- Remote validation: Validate tool calls from external systems
- Health checks: Integration with load balancers and orchestrators
- Metrics: Prometheus-compatible metrics export
6.2 Validation Endpoint
6.2.1 Request Format
Token Transmission (RFC 6750 compliant):
The identity token MUST be transmitted in the
Authorization header using the Bearer scheme:
- Request body parameters
- Query string parameters
- Cookies
- Token leakage via access logs (query strings)
- CSRF attacks (body parameters)
- Cross-origin token theft (cookies)
identity.require_token: true, requests without a valid Authorization header MUST be rejected with HTTP 401.
6.2.2 Response Format
6.2.3 Error Responses
6.3 Health Endpoint
6.3.1 Request
6.3.2 Response
6.4 Metrics Endpoint
When enabled, the metrics endpoint exposes Prometheus-compatible metrics.6.4.1 Request
6.4.2 Metrics
6.5 Revocation Endpoint (v1alpha2)
The revocation endpoint allows immediate invalidation of tokens or sessions.6.5.1 Request Format
6.5.2 Response Format
6.5.3 Error Responses
6.5.4 Authorization
The revocation endpoint MUST require elevated privileges:- Separate admin token (not user identity token)
- mTLS with admin certificate
- Operator API key
6.5.5 Audit Logging
Revocation events MUST be logged:6.6 Authentication
The validation endpoint SHOULD be protected. Implementations MUST support:- Bearer tokens: AIP Identity Tokens in Authorization header
- mTLS: Mutual TLS for service-to-service authentication
- API keys
- OAuth 2.0 tokens (for integration with external IdPs)
7. Error Codes
AIP defines the following JSON-RPC error codes:7.1 Error Response Format
7.2 New Error Codes (v1alpha2)
-32008 Token Required
Returned whenidentity.require_token: true and no token is provided.
-32009 Token Invalid
Returned when token validation fails.token_error values:
token_expired- Token past expiration timepolicy_changed- Policy hash mismatchsession_mismatch- Session binding mismatchbinding_mismatch- Strict binding validation failedreplay_detected- Nonce reuse detectedaudience_mismatch- Token audience does not match expected value (new)malformed- Token structure invalid
token_revoked errors use the dedicated -32011 error code for clearer operational distinction.
-32010 Policy Signature Invalid
Returned when policy signature verification fails.-32011 Token Revoked (v1alpha2)
Returned when a token or its session has been explicitly revoked via the revocation endpoint.revocation_type values:
session- Entire session was revoked (all tokens invalid)token- Specific token was revoked (by nonce)
-32012 Audience Mismatch (v1alpha2)
Returned when the token’saud claim does not match the expected audience.
token_audience value SHOULD be logged for forensics but MAY be omitted from client responses to prevent information disclosure.
-32013 Schema Mismatch (v1alpha2)
Returned when a tool’s schema hash does not match the expected value in the policy.- Alert security teams immediately
- Log full schema details for forensic analysis
- Consider blocking the MCP server until verified
8. Audit Log Format
[Section 8.1-8.3 remain unchanged from v1alpha1]8.1 Required Fields
8.2 Optional Fields
8.3 Example
8.4 Identity Events (v1alpha2)
Identity-related events SHOULD be logged:Token Issued
Token Rotated
Token Validation Failed
9. Conformance
9.1 Conformance Levels
9.2 Conformance Testing
Implementations MUST pass the conformance test suite to claim AIP compliance. The test suite consists of:- Schema validation tests: Verify policy parsing
- Decision tests: Input → expected decision
- Normalization tests: Verify Unicode handling
- Error format tests: Verify JSON-RPC errors
- Identity tests: Token lifecycle, rotation, validation (new)
- Server tests: HTTP endpoint behavior (new)
spec/conformance/ for test vectors.
9.3 Implementation Requirements
Implementations MUST:- Parse
apiVersion: aip.io/v1alpha2documents - Reject documents with unknown
apiVersion - Apply NFKC normalization to names
- Return specified error codes
- Support
enforceandmonitormodes
- Log decisions in the specified format
- Support DLP scanning
- Support rate limiting
- Support identity tokens (for Identity conformance level)
- Use any regex engine with RE2 semantics
- Implement additional security features (egress control, sandboxing)
- Implement server-side validation (for Server conformance level)
10. Security Considerations
10.0 Threat Model
This section defines the security assumptions and threat model for AIP.10.0.1 Trust Boundaries
AIP defines the following trust boundaries:10.0.2 Threats In Scope
AIP is designed to mitigate the following threats:10.0.3 Threats Out of Scope
The following threats are explicitly not addressed by this specification:10.0.4 Security Assumptions
AIP makes the following assumptions:- Policy integrity: The policy file has not been tampered with at load time (verified via signature when
metadata.signatureis present) - Engine integrity: The AIP implementation is correct and not compromised
- Cryptographic security: SHA-256, Ed25519, and other algorithms remain secure
- Clock accuracy: System clocks are reasonably synchronized (within TTL tolerance)
- TLS security: Transport encryption prevents eavesdropping and tampering
10.0.5 Defense in Depth
AIP implements multiple layers of defense:10.1 Policy File Protection
The policy file itself MUST be protected from modification by the agent. Implementations MUST automatically add the policy file path toprotected_paths.
10.2 Regex Denial of Service (ReDoS)
Implementations MUST use a regex engine that guarantees linear-time matching (RE2 or equivalent). Pathological patterns like(a+)+$ MUST NOT cause exponential execution time.
10.3 Unicode Normalization
Implementations MUST apply NFKC normalization to prevent homoglyph attacks. However, implementers should be aware that NFKC does not normalize all visually similar characters (e.g., Cyrillic ‘а’ vs Latin ‘a’).10.4 Monitor Mode Risks
Monitor mode allows all requests through. Implementations SHOULD warn users when monitor mode is enabled in production environments.10.5 Audit Log Integrity
Audit logs SHOULD be written to a location not writable by the agent. Implementations MAY support log signing or forwarding to external systems.10.6 Identity Token Security (v1alpha2)
10.6.1 Token Storage
Identity tokens SHOULD be stored in memory only, not persisted to disk. If persistence is required, tokens MUST be encrypted at rest.10.6.2 Token Transmission
Tokens transmitted over the network MUST use TLS 1.2 or later. Implementations MUST NOT send tokens over unencrypted connections.10.6.3 Token Lifetime
Short token lifetimes (5-15 minutes) limit the window for token theft. Implementations SHOULD NOT allow token_ttl greater than 1 hour.10.6.4 Replay Prevention
Implementations MUST track nonces to prevent token replay within thenonce_window duration.
Atomic Operation Requirement (v1alpha2):
Nonce validation MUST be performed as an atomic check-and-record operation to prevent race conditions in concurrent environments:
Nonce pruning:
Implementations MUST prune nonces older than
nonce_window to bound storage:
- Shared storage is REQUIRED - Local-only nonce tracking allows replay across instances
- Atomic operations are REQUIRED - Use storage primitives that guarantee atomicity (Redis
SET NX, DB unique constraints) - TTL-based expiration - Set storage TTL to
nonce_window + clock_skew_tolerance(recommended: 30 seconds tolerance) - Clock synchronization - All instances SHOULD use NTP with drift < 1 second
replay_detected).
10.6.5 Session Binding
Session binding prevents stolen tokens from being used in different contexts. Thestrict binding mode provides the strongest guarantees but may cause issues with process restarts.
10.7 Server Endpoint Security (v1alpha2)
10.7.1 Authentication
Validation endpoints MUST require authentication. Unauthenticated endpoints allow attackers to probe policy configurations.10.7.2 Rate Limiting
Validation endpoints SHOULD implement rate limiting to prevent denial of service attacks.10.7.3 Information Disclosure
Error responses SHOULD NOT reveal detailed policy configuration. Thereason field SHOULD provide minimal information needed to diagnose issues.
11. IANA Considerations
This specification requests registration of the following:11.1 Media Type
- Type name: application
- Subtype name: vnd.aip.policy+yaml
- Required parameters: None
- File extension: .yaml, .yml
11.2 URI Scheme
This specification uses theaip.io namespace for versioning:
aip.io/v1alpha1- Previous specificationaip.io/v1alpha2- This specification
Appendix A: Complete Schema Reference
Appendix B: Changelog
v1alpha2 (2026-01-24)
Identity and Session Management- Added
identityconfiguration section- Token generation and rotation with configurable TTL
- Session binding (
process,policy,strict) - Policy hash computation for integrity
nonce_windowfor bounded replay prevention storagepolicy_transition_gracefor gradual policy rolloutsaudiencefor token audience binding (RFC 8707 alignment)nonce_storagefor distributed nonce tracking (Redis, PostgreSQL)keysfor JWT signing key management and rotation
- Added token revocation mechanism (Section 5.6)
- Session and token-level revocation
- Revocation storage and pruning
- Added Section 5.8 Key Management
- Signing algorithm selection (ES256, EdDSA, RS256)
- Key rotation with grace periods
- JWKS endpoint for remote verification
- Key compromise response procedures
- Added Section 5.3.2 Binding Object
- Hostname normalization for containers and Kubernetes
- Container ID and Pod UID binding support
- Added
serverconfiguration section- HTTP validation endpoint (
/v1/validate) - Revocation endpoint (
/v1/revoke) - JWKS endpoint (
/v1/jwks) for key distribution - Health and metrics endpoints
failover_mode:fail_closed,fail_open,local_policyfail_open_constraintsfor safer fail_open deployments- Configurable
timeoutfor validation requests
- HTTP validation endpoint (
- Mandated JWT encoding when
server.enabled: true - Token transmission via Authorization header only (RFC 6750)
- Added
schema_hashto tool_rules (Section 3.5.4)- Cryptographic verification of tool definitions
- Tool poisoning attack prevention
- SHA-256/384/512 algorithm support
- Added
scan_requestsfor request-side DLP scanning - Added
max_scan_sizeto prevent ReDoS - Added
on_request_matchaction (block,redact,warn) - Added
on_redaction_failurehandling (block,allow_original,reject) - Added
log_original_on_failurefor forensics - Added
scopeto patterns (request,response,all)
- Added Section 10.0 Threat Model
- Trust boundaries diagram
- Threats in scope / out of scope
- Defense in depth layers
- Added
metadata.signaturefor policy integrity (Ed25519) - Atomic nonce operations required for replay prevention
- Tool poisoning now addressed via schema hashing
- Enhanced replay prevention documentation with distributed storage
- Added rotation_interval validation (must be < token_ttl)
- Policy load failures for invalid configurations
- Added -32008 Token Required
- Added -32009 Token Invalid (with detailed error types)
- Added -32010 Policy Signature Invalid
- Added -32011 Token Revoked (distinct from -32009)
- Added -32012 Audience Mismatch
- Added -32013 Schema Mismatch (tool poisoning detection)
- Added -32014 DLP Redaction Failed
- Added Identity conformance level
- Added Server conformance level
- Added identity and server tests to conformance suite
v1alpha1 (2026-01-20)
- Initial draft specification
- Defined core policy schema
- Defined evaluation semantics
- Defined error codes
- Defined audit log format
Appendix C: References
- Model Context Protocol (MCP)
- MCP Authorization (2025-06-18)
- JSON-RPC 2.0 Specification
- RFC 2119 - Key words for use in RFCs
- RFC 7519 - JSON Web Token (JWT)
- RFC 8785 - JSON Canonicalization Scheme (JCS)
- Unicode NFKC Normalization
- RE2 Syntax
- Agentic JWT (draft-goswami-agentic-jwt-00)
Appendix D: Future Extensions
This appendix describes features under consideration for future versions of AIP.D.1 Network Egress Control
Status: Proposed for v1beta1 [Content unchanged from v1alpha1]D.2 Policy Inheritance
Status: Under Discussion Allow policies to extend base policies:D.3 External Identity Federation
Status: Proposed for v1beta1 Allow policies to integrate with external identity providers:oidc- OpenID Connect providersspiffe- SPIFFE/SPIRE workload identity
D.4 Telemetry and Metrics
Status: Partially implemented in v1alpha2 (metrics endpoint) Full telemetry specification:D.5 Advanced Policy Expressions
Status: Under Discussion Support for CEL (Common Expression Language) or Rego for complex validation:D.6 Agentic JWT Compatibility
Status: Under Discussion for v1beta1 Full compatibility with the Agentic JWT specification:Appendix E: Implementation Notes
E.1 Reference Implementation
The reference implementation is available at: https://github.com/ArangoGutierrez/agent-identity-protocol It provides:- Go-based proxy (
aip-proxy) - Policy engine (
pkg/policy) - DLP scanner (
pkg/dlp) - Audit logger (
pkg/audit) - Identity manager (
pkg/identity) (v1alpha2) - HTTP server (
pkg/server) (v1alpha2)
E.2 Testing Against Conformance Suite
E.3 Token Implementation Guidance
Generating Secure Nonces
Computing Policy Hash
E.4 Registering Your Implementation
Implementations that pass the conformance suite may be listed in the official registry. Submit a PR to the AIP repository with:- Implementation name and URL
- Conformance level achieved (Basic/Full/Extended/Identity/Server)
- Platform support matrix