Document Structure
- v1alpha2 (Current)
- v1alpha1
Top-Level Fields
apiVersion
API version of the policy schema.Valid values:
aip.io/v1alpha1- Original specificationaip.io/v1alpha2- Current specification with identity and server features
apiVersion.kind
Resource kind. MUST be
AgentPolicy.metadata
Policy metadata for identification and integrity verification.metadata.name
Unique identifier for this policy.Format: DNS-1123 subdomain (lowercase alphanumeric + hyphens)
- Must start and end with alphanumeric
- Max length: 253 characters
- Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
metadata.version
Semantic version of the policy.Format:
MAJOR.MINOR.PATCH[-PRERELEASE]- Pattern:
^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$
metadata.owner
Contact email for policy questions.Format: Valid email address
metadata.signature (v1alpha2)
Cryptographic signature for policy integrity verification.Format:
<algorithm>:<base64-encoded-signature>Supported algorithms:ed25519- Ed25519 signature (RECOMMENDED)ecdsa-p256- ECDSA with P-256 curve
spec
Policy specification defining authorization rules.spec.mode
Enforcement mode for policy violations.Values:
enforce- Block violations, return JSON-RPC error (default)monitor- Log violations but allow through (dry-run)
monitor to test new policies before enforcement.spec.allowed_tools
Allowlist of tool names that the agent MAY invoke.Item type: String (tool name)Validation:
- Must be unique
- Minimum length: 1
- Subject to name normalization (NFKC, lowercase)
tool_rules with action: allow are blocked.spec.allowed_methods
Allowlist of JSON-RPC methods that are permitted.Item type: String (method name)Default: If not specified, implementations use a safe default list (see below).Wildcard:
* allows all methods.spec.denied_methods
Denylist of JSON-RPC methods that are explicitly denied.Item type: String (method name)Precedence: Denied methods take precedence over allowed methods.
spec.protected_paths
File paths that tools MUST NOT access.Item type: String (file path)Behavior:
- Any tool argument containing a protected path is BLOCKED
- Paths are expanded (
~→ home directory) - Policy file itself is automatically protected
spec.strict_args_default
When
true, tool rules reject any arguments not explicitly declared in allow_args.Use case: Enforce strict argument validation for all tools.spec.tool_rules
Fine-grained rules for individual tools.Tool Rule Structure
Complete Tool Rule Schema
Complete Tool Rule Schema
tool_rules[].tool
Tool name this rule applies to.Validation: Subject to name normalization (NFKC, lowercase).
tool_rules[].action
Action to take when this tool is invoked.Values:
allow- Permit (subject toallow_argsvalidation)block- Deny unconditionallyask- Require interactive user approval
tool_rules[].rate_limit
Rate limiting for this tool.Format:
<count>/<period>Periods:second(aliases:sec,s)minute(aliases:min,m)hour(aliases:hr,h)
tool_rules[].strict_args
Override
spec.strict_args_default for this specific tool.When true, reject any arguments not declared in allow_args.tool_rules[].schema_hash (v1alpha2)
Cryptographic hash of the tool’s MCP schema for integrity verification.Format:
<algorithm>:<hex-digest>Algorithms:sha256(RECOMMENDED)sha384sha512
tool_rules[].allow_args
Argument validation using regex patterns.Format: Map of argument name → regex patternBehavior:
- All arguments in this map MUST be present in the request
- Argument values MUST match their regex pattern
- Missing or non-matching arguments result in BLOCK
- String → as-is
- Number → decimal representation
- Boolean → “true” or “false”
- Null → empty string
- Array/Object → JSON serialization
spec.dlp
Data Loss Prevention configuration for scanning and redacting sensitive data.Complete DLP Schema
Complete DLP Schema
- v1alpha2
- v1alpha1
dlp.enabled
Enable DLP scanning.Default:
true when dlp block is presentdlp.scan_requests (v1alpha2)
Scan tool arguments for sensitive data before forwarding to MCP server.Use case: Prevent data exfiltration via arguments (e.g., embedding secrets in API queries).
dlp.scan_responses
Scan tool responses for sensitive data.Use case: Standard DLP to prevent PII/secrets from reaching the agent.
dlp.max_scan_size (v1alpha2)
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.Behavior: Content exceeding this limit is truncated for scanning, and a warning is logged.dlp.on_request_match (v1alpha2)
Action when DLP pattern matches in a request (requires
scan_requests: true).Values:block- Reject the request with error -32001 (default)redact- Replace matched content and forwardwarn- Log warning and forward unchanged
dlp.patterns
List of DLP detection patterns.Item type: Pattern object with
name and regexdlp.patterns[].name
Human-readable identifier for this pattern.Use case: Appears in audit logs and redaction markers.
dlp.patterns[].regex
Regular expression to detect sensitive data.Regex engine: MUST support RE2 semantics (linear-time guarantees)
dlp.patterns[].scope (v1alpha2)
Where to apply this pattern.Values:
all- Scan both requests and responses (default)request- Only scan requests (detect exfiltration attempts)response- Only scan responses (PII protection)
spec.identity (v1alpha2)
Agent identity and session management configuration.Complete Identity Schema
Complete Identity Schema
identity.enabled
Enable identity token generation and management.
identity.token_ttl
Token time-to-live.Format: Go duration string (e.g.,
"5m", "1h", "300s")Recommendation: Use short TTLs (5-15 minutes) to limit token theft window.identity.rotation_interval
How often to rotate tokens before expiry.Constraint: MUST be less than
token_ttlRecommendation: Leave 1-2 minute grace period for in-flight requests.identity.require_token
Require valid identity token for all tool calls.Error code: Requests without tokens are rejected with -32008.Use case: Gradual rollout - start with
false to generate tokens without enforcement.identity.session_binding
Context bound to session identity.Values:
process- Bind to OS process ID (default)policy- Bind to policy hashstrict- Bind to process + policy + hostname
process: Single-machine, local agentspolicy: Distributed agents sharing policystrict: High security, non-ephemeral environments
identity.audience
Intended audience for identity tokens (JWT
aud claim).Default: Value of metadata.nameFormat: URI string identifying the MCP server or servicePurpose: Prevents tokens issued for one MCP server from being accepted by another.identity.nonce_storage
Distributed nonce storage configuration for multi-instance deployments.Storage backend for nonces.Values:
memory- In-memory sync.Map (single-instance only)redis- Redis cluster (RECOMMENDED for production)postgres- PostgreSQL database
Connection string for external storage.Required: When
type is redis or postgresspec.server (v1alpha2)
HTTP server for remote validation endpoints.Complete Server Schema
Complete Server Schema
server.enabled
Enable HTTP server for remote validation.
server.listen
Address and port to bind the HTTP server.Format:
<host>:<port> or :<port>server.failover_mode
Behavior when validation server is unreachable.Values:
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)
server.timeout
Maximum time to wait for validation server response.After timeout,
failover_mode behavior is triggered.server.tls
TLS configuration for HTTPS.Path to TLS certificate (PEM format).Required: When
listen is not localhostPath to TLS private key (PEM format).Required: When
listen is not localhostJSON Schema Validation
Validate your policy file against the JSON Schema:Common Validation Errors
| Error | Cause | Fix |
|---|---|---|
invalid apiVersion | Wrong API version | Use aip.io/v1alpha1 or aip.io/v1alpha2 |
empty allowed_tools | No tools specified | Add tools or tool_rules |
invalid regex in allow_args | Bad regex pattern | Validate regex syntax (RE2) |
invalid rate_limit format | Wrong rate limit format | Use <N>/<period> |
rotation_interval >= token_ttl | Rotation must happen before expiry | Reduce rotation_interval |
missing metadata.name | Required field missing | Add unique policy name |
See Also
- Policy Reference - User-friendly guide
- v1alpha1 Specification - Formal v1alpha1 spec
- v1alpha2 Specification - Formal v1alpha2 spec
- JSON Schema (v1alpha2)
- JSON Schema (v1alpha1)