Status: Draft
Last Updated: 2026-01-20
Authors: Eduardo Arango ([email protected])
This is the v1alpha1 specification. For the latest version, see v1alpha2.
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
- Error codes for denied requests
- Audit log format for compliance
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 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
Goals
- Interoperability: Any MCP runtime can implement AIP
- Simplicity: YAML-based policies readable by security teams
- Defense in depth: Multiple layers (method, tool, argument)
- Fail-closed: Unknown tools are denied by default
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.
Policy Document Schema
Complete Schema Structure
Complete Schema Structure
Required Fields
MUST be
aip.io/v1alpha1MUST be
AgentPolicyUnique identifier for this policy. Must be a valid DNS-1123 subdomain (lowercase alphanumeric + hyphens).
Metadata Fields
Semantic version (e.g., “1.0.0”, “2.1.0-beta”)
Contact email for policy questions
Spec Fields
mode - Enforcement Behavior
mode - Enforcement Behavior
Controls enforcement behavior:
enforce: Violations are blocked (default)monitor: Violations are logged but allowed
allowed_tools - Tool Allowlist
allowed_tools - Tool Allowlist
A list of tool names that the agent MAY invoke.
allowed_methods - JSON-RPC Method Allowlist
allowed_methods - JSON-RPC Method Allowlist
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.denied_methods - Method Denylist
denied_methods - Method Denylist
A list of JSON-RPC methods that are explicitly denied. Denied methods take precedence over allowed methods.
protected_paths - File Path Protection
protected_paths - File Path Protection
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
strict_args_default - Argument Strictness
strict_args_default - Argument Strictness
When
true, tool rules reject any arguments not explicitly declared in allow_args.Tool Rules
Tool rules provide fine-grained control over specific tools.Tool Rule Structure
Tool Rule Structure
Actions
Actions
| Action | Behavior |
|---|---|
allow | Permit (subject to argument validation) |
block | Deny unconditionally |
ask | Require interactive user approval |
Rate Limiting
Rate Limiting
Format:
Example:Rate limiting algorithm is implementation-defined (token bucket, sliding window, etc.).
<count>/<period>| Period | Aliases |
|---|---|
second | sec, s |
minute | min, m |
hour | hr, h |
Argument Validation
Argument Validation
The Implementations MUST:
allow_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
DLP Configuration
Data Loss Prevention (DLP) scans tool responses for sensitive data.DLP Schema
DLP Schema
Evaluation Semantics
Name Normalization
Tool names and method names MUST be normalized before comparison using the following algorithm:This prevents bypass attacks using:
- Fullwidth characters:
delete→delete - Ligatures:
file→file - Zero-width characters:
delete→delete
Method-Level Authorization
Method authorization is the FIRST line of defense, evaluated BEFORE tool-level checks.Tool-Level Authorization
Complete Evaluation Algorithm
Complete Evaluation Algorithm
Decision Outcomes
| Decision | Mode=enforce | Mode=monitor |
|---|---|---|
| ALLOW | Forward request | Forward request |
| BLOCK | Return error | Forward request, log violation |
| ASK | Prompt user | Prompt user |
| RATE_LIMITED | Return error | Return error (always enforced) |
| PROTECTED_PATH | Return error | Return error (always enforced) |
Error Codes
AIP defines the following JSON-RPC error codes:Tool not in allowed_tools list
Rate limit exceeded
User rejected approval prompt
Approval prompt timed out
JSON-RPC method not permitted
Access to protected path blocked
Error Response Format
Audit Log Format
Implementations SHOULD log all authorization decisions in JSON Lines format.Required Fields
ISO 8601 timestamp of the decision
upstream (client→server) or downstream (server→client)ALLOW, BLOCK, ALLOW_MONITOR, RATE_LIMITEDenforce or monitorWhether a policy violation was detected
Example Audit Entry
Conformance
Conformance Levels
- Basic
- Full
- Extended
Requirements: Method authorization, tool allowlist, error codesMinimum viable implementation suitable for simple use cases.
Implementation Requirements
Implementations MUST:- Parse
apiVersion: aip.io/v1alpha1documents - 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
- Use any regex engine with RE2 semantics
- Implement additional security features (egress control, sandboxing)
Security Considerations
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’).
Version History
v1alpha1 (2026-01-20)
- Initial draft specification
- Defined core policy schema
- Defined evaluation semantics
- Defined error codes
- Defined audit log format
References
- Model Context Protocol (MCP)
- JSON-RPC 2.0 Specification
- RFC 2119 - Key words for use in RFCs
- Unicode NFKC Normalization
- RE2 Syntax
See Also
- v1alpha2 Specification - Latest version with agent identity
- Policy Schema Reference - Complete field documentation
- Policy Reference - User-friendly policy guide