Skip to main content

Agent Identity Protocol (AIP) Specification

Version: v1alpha2
Status: 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:
  1. The policy document schema (AgentPolicy)
  2. Evaluation semantics for authorization decisions
  3. Agent identity and session management (new in v1alpha2)
  4. Server-side validation endpoints (new in v1alpha2)
  5. Error codes for denied requests
  6. Audit log format for compliance
AIP is designed to be implementation-agnostic. Any MCP-compatible runtime (Cursor, Claude Desktop, VS Code, custom implementations) can implement this specification.

Table of Contents

  1. Introduction
  2. Terminology
  3. Policy Document Schema
  4. Evaluation Semantics
  5. Agent Identity (new in v1alpha2)
  6. Server-Side Validation (new in v1alpha2)
  7. Error Codes
  8. Audit Log Format
  9. Conformance
  10. Security Considerations
  11. IANA Considerations
Appendices

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

  1. Interoperability: Any MCP runtime can implement AIP
  2. Simplicity: YAML-based policies readable by security teams
  3. Defense in depth: Multiple layers (method, tool, argument, identity)
  4. Fail-closed: Unknown tools are denied by default
  5. 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 intercepts tools/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)

The signature field provides cryptographic integrity verification for the policy document. Format: <algorithm>:<base64-encoded-signature> Supported algorithms:
  • ed25519 - Ed25519 signature (RECOMMENDED)
Example:
When present, implementations MUST verify the signature before applying the policy. Signature verification failure MUST result in policy rejection. The signature is computed over the canonical form of the policy document (see Section 5.2.1).

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.
Tool names are subject to normalization (see Section 4.1).

3.4.3 allowed_methods

A list of JSON-RPC methods that are permitted. If not specified, implementations MUST use the default safe list:
The wildcard * 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.
Implementations MUST:
  • Expand ~ to the user’s home directory
  • Automatically protect the policy file itself

3.4.6 strict_args_default

When true, 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

The allow_args field maps argument names to regex patterns.
Implementations MUST:
  • 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)

The schema_hash field provides cryptographic verification of tool definitions to prevent tool poisoning attacks. Format: <algorithm>:<hex-digest> Supported algorithms:
  • sha256 (RECOMMENDED)
  • sha384
  • sha512
Example:
Hash computation: The schema hash is computed over the canonical form of the tool’s MCP schema:
Behavior: Use cases:
  1. Tool poisoning prevention: Detect when an MCP server changes a tool’s behavior after policy approval
  2. Compliance auditing: Prove that approved tools haven’t been modified
  3. Supply chain security: Pin specific tool versions in policy
Generating schema hashes:
Operational considerations:
  • 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
Error code (new):

3.6 DLP Configuration

Data Loss Prevention (DLP) scans for sensitive data in requests and responses.

3.6.1 scan_requests (v1alpha2)

When true, 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

When true, 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_size bytes)
  • MUST log a warning
Purpose: Prevents ReDoS and memory exhaustion on large payloads.

3.6.4 on_request_match (v1alpha2)

Action when DLP pattern matches in a request (when scan_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:
  1. Invalid JSON: Redaction in nested structures may break JSON parsing
  2. Schema validation failure: Redacted values may violate tool argument schemas
  3. Tool execution failure: The MCP server may reject redacted arguments
Configuration for redaction failure behavior:
on_redaction_failure values: Example configuration:
Error code for redaction failures (new): Example error response:
Audit logging for redaction events:
⚠️ Security consideration: Setting 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:
When a pattern matches, the matched content MUST be replaced with:

3.7 Identity Configuration (v1alpha2)

The identity section configures agent identity and token management.

3.7.1 enabled

When true, 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:
Error handling: Invalid configuration example:
Policy load error response:
Recommended configurations: Disabling rotation: Setting rotation_interval: "0s" disables automatic rotation. Tokens will only be refreshed when explicitly requested or when they expire.
⚠️ Not recommended for production as it increases token theft window.

3.7.4 require_token

When true, 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: Equals token_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_window MUST be greater than or equal to token_ttl
  • Setting nonce_window less than token_ttl is a configuration error
Storage considerations: 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:
  1. When policy is updated, the previous policy hash is retained in recent_policy_hashes
  2. Tokens with either current or recent policy hash are accepted during the grace period
  3. After grace period expires, only current policy hash is valid
Constraints:
  • policy_transition_grace SHOULD be less than token_ttl to ensure policy changes take effect within one token lifetime
  • Setting very long grace periods weakens security guarantees
Example:
Use cases:

3.7.8 audience (v1alpha2)

The intended audience for identity tokens. This value is included in the token’s aud 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)
Example:
Validation requirements:
  • Implementations MUST reject tokens where aud does 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
Constraints:
  • audience MUST be a valid URI or the policy metadata.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:
⚠️ Multi-instance deployments: Using 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)

The server section configures optional HTTP endpoints for server-side validation.

3.8.1 enabled

When true, 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
fail_open (NOT RECOMMENDED):
  • All requests are allowed when server is unreachable
  • Logs warning: “failover_mode=fail_open triggered”
  • ⚠️ Only use in development or when availability > security
fail_open constraints (v1alpha2): When failover_mode: "fail_open" is configured, implementations SHOULD require additional constraints to limit exposure:
Example with constraints:
Behavior:
  • When validation server becomes unreachable:
    1. Increment fail_open counter
    2. Check if max_requests exceeded → revert to fail_closed
    3. Check if max_duration exceeded → revert to fail_closed
    4. If request tool NOT in allowed_tools → block with -32001
    5. If require_local_policy and no valid local policy → block with -32001
    6. POST to alert_webhook (async, fire-and-forget)
    7. Allow request, log warning
Implementation requirements:
  • Implementations SHOULD warn at policy load time if fail_open is used without constraints
  • Implementations MUST log every request processed in fail_open mode
  • Implementations SHOULD expose a metric aip_fail_open_requests_total
local_policy (RECOMMENDED for hybrid deployments):
  • 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.
Implementations SHOULD support:
  • 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:
This prevents bypass attacks using:
  • Fullwidth characters: deletedelete
  • Ligatures: filefile
  • Zero-width characters: dele​tedelete

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 to tools/call requests.

4.4 Decision Outcomes

4.5 Argument Validation

The 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:
  1. Session binding: Cryptographic proof that requests belong to the same session
  2. Policy integrity: Verification that the policy hasn’t changed mid-session
  3. Replay prevention: Nonces prevent token reuse across sessions
  4. 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

The policy hash is a 64-character lowercase hexadecimal string.

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)

The binding object ties tokens to their execution context:
Hostname Normalization (v1alpha2): Hostnames MUST be normalized for consistent binding:
Environment-specific binding: Kubernetes deployment: For Kubernetes deployments, inject pod UID via downward API:
Session binding modes and hostname: 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
Recommendation for Kubernetes:

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:
Supported signing algorithms (in order of preference):
  1. ES256 (ECDSA with P-256 and SHA-256) - RECOMMENDED for production
  2. EdDSA (Ed25519) - RECOMMENDED for performance
  3. HS256 (HMAC-SHA256) - MAY be used only when server.enabled: false
⚠️ Security: 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:
Compact tokens MUST NOT be sent to remote validation endpoints.

5.4 Token Lifecycle

5.4.1 Token Issuance

Tokens are issued when:
  1. Session starts (first tool call with identity.enabled: true)
  2. Rotation interval elapsed
  3. 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:
Storage requirements:
  • Revoked sessions SHOULD be retained for max_session_duration (implementation-defined, default: 24h)
  • Revoked tokens SHOULD be retained for nonce_window duration (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:
  1. Computing agent_checksum from policy content
  2. Including agent_proof claims in JWT tokens
  3. Supporting the agent_checksum OAuth grant type
See Appendix D.6 for mapping details.

5.8 Key Management (v1alpha2)

This section defines key management requirements for JWT signing when server.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
file:
  • Key loaded from PEM file
  • Implementation MUST NOT expose private key
  • Key rotation requires file replacement and restart/reload
external (future):
  • 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:
Requirements:
  1. New keys MUST be added to JWKS before becoming active
  2. Old keys MUST remain in JWKS for at least token_ttl after rotation
  3. Implementations MUST support at least 2 concurrent keys in JWKS
Configuration:

5.8.5 JWKS Endpoint

When server.enabled: true, implementations MUST expose a JWKS endpoint for token verification. Request:
Response:
Caching:
  • Clients SHOULD cache JWKS responses
  • Cache-Control header 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:
  1. Immediate: Remove compromised key from JWKS
  2. Generate: Create new signing key
  3. Revoke: Revoke all sessions that used compromised key
  4. Rotate: Force token rotation for all active sessions
  5. Audit: Log compromise event with forensic details
Emergency key revocation endpoint (implementation-defined):
⚠️ This is a destructive operation that invalidates all tokens signed with the specified key.

6. Server-Side Validation (v1alpha2)

This section defines the optional HTTP server for remote policy validation.

6.1 Overview

The AIP server provides:
  1. Remote validation: Validate tool calls from external systems
  2. Health checks: Integration with load balancers and orchestrators
  3. 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:
Implementations MUST NOT accept tokens in:
  • Request body parameters
  • Query string parameters
  • Cookies
This prevents:
  • Token leakage via access logs (query strings)
  • CSRF attacks (body parameters)
  • Cross-origin token theft (cookies)
When 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
⚠️ Security: Revocation is a privileged operation. Do not allow agents to revoke their own or other sessions.

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
Implementations MAY support:
  • 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 when identity.require_token: true and no token is provided.

-32009 Token Invalid

Returned when token validation fails.
Possible token_error values:
  • token_expired - Token past expiration time
  • policy_changed - Policy hash mismatch
  • session_mismatch - Session binding mismatch
  • binding_mismatch - Strict binding validation failed
  • replay_detected - Nonce reuse detected
  • audience_mismatch - Token audience does not match expected value (new)
  • malformed - Token structure invalid
Note: 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.
Possible revocation_type values:
  • session - Entire session was revoked (all tokens invalid)
  • token - Specific token was revoked (by nonce)
Operational note: Error -32011 is distinct from -32009 to enable security teams to differentiate between normal token lifecycle events (expiration) and security incident responses (revocation).

-32012 Audience Mismatch (v1alpha2)

Returned when the token’s aud claim does not match the expected audience.
Security note: This error indicates a possible token misuse or attack. The 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.
Security note: This error indicates a potential tool poisoning attack or uncontrolled tool update. Implementations SHOULD:
  1. Alert security teams immediately
  2. Log full schema details for forensic analysis
  3. 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:
  1. Schema validation tests: Verify policy parsing
  2. Decision tests: Input → expected decision
  3. Normalization tests: Verify Unicode handling
  4. Error format tests: Verify JSON-RPC errors
  5. Identity tests: Token lifecycle, rotation, validation (new)
  6. Server tests: HTTP endpoint behavior (new)
See spec/conformance/ for test vectors.

9.3 Implementation Requirements

Implementations MUST:
  • Parse apiVersion: aip.io/v1alpha2 documents
  • Reject documents with unknown apiVersion
  • Apply NFKC normalization to names
  • Return specified error codes
  • Support enforce and monitor modes
Implementations SHOULD:
  • Log decisions in the specified format
  • Support DLP scanning
  • Support rate limiting
  • Support identity tokens (for Identity conformance level)
Implementations MAY:
  • 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:
  1. Policy integrity: The policy file has not been tampered with at load time (verified via signature when metadata.signature is present)
  2. Engine integrity: The AIP implementation is correct and not compromised
  3. Cryptographic security: SHA-256, Ed25519, and other algorithms remain secure
  4. Clock accuracy: System clocks are reasonably synchronized (within TTL tolerance)
  5. 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 to protected_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 the nonce_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:
⚠️ Critical: Non-atomic check-then-record implementations have a race condition window where concurrent requests with the same nonce could both pass validation. Storage strategies: Nonce pruning: Implementations MUST prune nonces older than nonce_window to bound storage:
Example: 100 req/s with 5m window = 30,000 nonces maximum. Distributed deployment requirements: In multi-instance deployments:
  1. Shared storage is REQUIRED - Local-only nonce tracking allows replay across instances
  2. Atomic operations are REQUIRED - Use storage primitives that guarantee atomicity (Redis SET NX, DB unique constraints)
  3. TTL-based expiration - Set storage TTL to nonce_window + clock_skew_tolerance (recommended: 30 seconds tolerance)
  4. Clock synchronization - All instances SHOULD use NTP with drift < 1 second
Configuration for distributed deployments:
A token with a previously-seen nonce MUST be rejected with error code -32009 (replay_detected).

10.6.5 Session Binding

Session binding prevents stolen tokens from being used in different contexts. The strict 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. The reason 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 the aip.io namespace for versioning:
  • aip.io/v1alpha1 - Previous specification
  • aip.io/v1alpha2 - This specification

Appendix A: Complete Schema Reference


Appendix B: Changelog

v1alpha2 (2026-01-24)

Identity and Session Management
  • Added identity configuration section
    • Token generation and rotation with configurable TTL
    • Session binding (process, policy, strict)
    • Policy hash computation for integrity
    • nonce_window for bounded replay prevention storage
    • policy_transition_grace for gradual policy rollouts
    • audience for token audience binding (RFC 8707 alignment)
    • nonce_storage for distributed nonce tracking (Redis, PostgreSQL)
    • keys for 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
Server-Side Validation
  • Added server configuration 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_policy
    • fail_open_constraints for safer fail_open deployments
    • Configurable timeout for validation requests
  • Mandated JWT encoding when server.enabled: true
  • Token transmission via Authorization header only (RFC 6750)
Tool Security
  • Added schema_hash to tool_rules (Section 3.5.4)
    • Cryptographic verification of tool definitions
    • Tool poisoning attack prevention
    • SHA-256/384/512 algorithm support
DLP Enhancements
  • Added scan_requests for request-side DLP scanning
  • Added max_scan_size to prevent ReDoS
  • Added on_request_match action (block, redact, warn)
  • Added on_redaction_failure handling (block, allow_original, reject)
  • Added log_original_on_failure for forensics
  • Added scope to patterns (request, response, all)
Security
  • Added Section 10.0 Threat Model
    • Trust boundaries diagram
    • Threats in scope / out of scope
    • Defense in depth layers
  • Added metadata.signature for policy integrity (Ed25519)
  • Atomic nonce operations required for replay prevention
  • Tool poisoning now addressed via schema hashing
  • Enhanced replay prevention documentation with distributed storage
Configuration Validation
  • Added rotation_interval validation (must be < token_ttl)
  • Policy load failures for invalid configurations
Error Codes
  • 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
Conformance
  • 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


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:
Supported federation types:
  • oidc - OpenID Connect providers
  • spiffe - 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:
Mapping to Agentic JWT claims:

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