Status: Draft
Last Updated: 2026-01-24
Authors: Eduardo Arango ([email protected])
This is the current version of the AIP specification. For the previous version, see v1alpha1.
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
What’s New in v1alpha2
Agent Identity
Token-based session management with cryptographic binding to policy and process context. Automatic token rotation and replay prevention.
Server-Side Validation
Optional HTTP endpoints for distributed policy enforcement. Supports remote validation, token verification, and centralized audit.
Policy Signing
Cryptographic integrity verification using Ed25519 signatures. Prevents unauthorized policy modifications.
MCP Authorization Alignment
Complementary to MCP’s OAuth 2.1 authorization layer (MCP 2025-06-18). Can be used together for defense in depth.
Formal Specification
Download Formal Specification
View the complete formal specification document on GitHub
Introduction
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 v1alpha2 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)
- Server-side validation: Optional HTTP endpoints for distributed policy enforcement (new)
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)
Relationship to MCP
- Architecture
Policy Document Schema
Complete v1alpha2 Schema
Complete v1alpha2 Schema
Required Fields
MUST be
aip.io/v1alpha2MUST be
AgentPolicyUnique identifier for this policy. Must be a valid DNS-1123 subdomain (lowercase alphanumeric + hyphens).
New in v1alpha2: Policy Signature
Cryptographic signature for policy integrity verification.Format:
<algorithm>:<base64-encoded-signature>Supported algorithms:ed25519- Ed25519 signature (RECOMMENDED)
Core Spec Fields (from v1alpha1)
For core fields likemode, allowed_tools, allowed_methods, denied_methods, protected_paths, and tool_rules, see the v1alpha1 specification.
New in v1alpha2: Tool Schema Hashing
Cryptographic verification of tool definitions to prevent tool poisoning attacks.Format:
<algorithm>:<hex-digest>Supported algorithms:sha256(RECOMMENDED)sha384sha512
| Condition | Behavior |
|---|---|
schema_hash absent | No schema verification (backward compatible) |
| Hash matches | Tool allowed (proceed to argument validation) |
| Hash mismatch | Tool BLOCKED with error -32013 |
| Tool not found | Tool BLOCKED with error -32001 |
- 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
Enhanced DLP Configuration (v1alpha2)
v1alpha2 DLP Features
v1alpha2 DLP Features
When
true, DLP patterns are applied to tool arguments before the request is forwarded.Use case: Prevents data exfiltration via arguments (e.g., embedding secrets in API queries).Maximum size of content to scan per request/response.Format: Size string (e.g.,
"1MB", "512KB", "10MB")Purpose: Prevents ReDoS and memory exhaustion on large payloads.Action when DLP pattern matches in a request:
block: Reject the request with error -32001 (default)redact: Replace matched content and forwardwarn: Log warning and forward unchanged
Where the pattern should be applied:
all: Scan both requests and responsesrequest: Only scan requests (detect exfiltration attempts)response: Only scan responses (PII protection)
Agent Identity (v1alpha2)
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
Identity Configuration
Complete Identity Schema
Complete Identity Schema
When
true, the AIP engine generates and manages identity tokens for the session.The time-to-live for identity tokens.Format: Go duration string (e.g.,
"5m", "1h", "300s")Implementations SHOULD use short TTLs (5-15 minutes) to limit token theft window.How often to rotate tokens before expiry.Constraint: MUST be less than
token_ttl.When
true, all tool calls MUST include a valid identity token. Calls without tokens are rejected with error code -32008.This enables gradual rollout: start with require_token: false to generate tokens without enforcement, then enable enforcement.Determines what context is bound to the session identity:
process: Session bound to process ID (default)policy: Session bound to policy hashstrict: Session bound to process + policy + hostname
The intended audience for identity tokens. This value is included in the token’s
aud claim and MUST be validated by recipients.Default: Value of metadata.namePurpose: Prevents tokens issued for one MCP server from being accepted by another.Identity Token Structure
An AIP Identity Token is a JWT-like structure with the following fields:Token format version (
aip/v1alpha2)Intended audience (from
identity.audience or metadata.name)SHA-256 hash of canonical policy
UUID identifying this session
Random value for replay prevention
Token Encoding
Implementations MUST encode tokens using one of the following formats:- JWT (Required for Server Mode)
- Compact (Local-only)
When Supported signing algorithms (in order of preference):
server.enabled: true, tokens MUST be encoded as RFC 7519 JWTs.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
Token Lifecycle
Token Validation
Token validation follows this algorithm:Complete Validation Algorithm
Complete Validation Algorithm
Server-Side Validation (v1alpha2)
Server Configuration
Complete Server Schema
Complete Server Schema
When
true, the AIP engine starts an HTTP server for remote validation.The address and port to bind the HTTP server.Format:
<host>:<port> or :<port>Behavior when the validation server is unreachable:
fail_closed: Deny all requests (RECOMMENDED for production)fail_open: Allow all requests (NOT RECOMMENDED)local_policy: Fall back to local policy evaluation (RECOMMENDED for hybrid deployments)
Maximum time to wait for validation server response.After timeout, the
failover_mode behavior is triggered.Validation Endpoints
| Endpoint | Default | Description |
|---|---|---|
validate | /v1/validate | Policy validation endpoint |
revoke | /v1/revoke | Token/session revocation |
jwks | /v1/jwks | JSON Web Key Set for token verification |
health | /health | Health check (for load balancers) |
metrics | /metrics | Prometheus metrics (optional) |
Error Codes (v1alpha2)
New error codes in v1alpha2:Missing identity token when
identity.require_token: trueExpired, malformed, or invalid token
Policy signature verification failed
Tool schema hash does not match policy
Request redaction produced invalid content
Conformance Levels
- Basic
- Full
- Extended
- Identity
- Server
Requirements: Method authorization, tool allowlist, error codesAPI Version: v1alpha1+
Migration from v1alpha1
v1alpha1 policies continue to work in v1alpha2 implementations. Simply update the
apiVersion to access new features.References
- Model Context Protocol (MCP)
- MCP Authorization (2025-06-18)
- JSON-RPC 2.0 Specification
- RFC 7519 - JSON Web Tokens
- RFC 8785 - JSON Canonicalization Scheme
- Agentic JWT Draft
See Also
- v1alpha1 Specification - Previous version
- Policy Schema Reference - Complete field documentation
- Policy Reference - User-friendly policy guide