Policy Basics (MAPL)
What you can control, how policies compose, why no overrides
14 questions
MAPL (MACAW Agentic Policy Language) is a declarative, JSON-based policy language designed specifically for controlling AI agent behavior. You specify what's allowed, and the engine enforces it deterministically.
MAPL covers:
- Resources - what can be accessed (LLMs, tools, data)
- Constraints - how resources can be used (parameters, rate limits, time windows)
- Attestations - approval gates for sensitive operations
- Inheritance - policies compose via
extends, permissions only narrow
See the MAPL Reference for complete specification.
Not really. The Console includes a Policy Assistant - describe what you want in plain English, and it generates the MAPL.
"Allow developers to use GPT-4 with max 2000 tokens, but deny access to any files containing 'confidential'"
The assistant generates correct MAPL because the formal grammar constrains generation - the LLM checks rules as it produces tokens, so it can only output valid policies. No hallucinations, no syntax errors. The grammar bounds what's producible.
You get the precision of a formal language with the ease of natural language. Learn MAPL if you want to - but you don't have to.
Existing policy languages were designed for infrastructure, not agentic AI. Agents create unique challenges:
Challenge Why Existing Languages Struggle Dynamic composition Agents delegate, chain, and compose at runtime - static pre-computation doesn't work Multi-perspective policies Caller intent, system rules, app policy, and workflow delegation must combine dynamically Approval gates Sensitive operations need human-in-the-loop - not a first-class primitive in infra languages Delegation chains Permissions must narrow through multi-step workflows - requires formal monotonicity Scale Billions of agents need distributed enforcement without central bottleneck MAPL was built from the ground up for these requirements: dynamic composition, first-class attestations, formal inheritance semantics, and O(log m + n) policy resolution instead of O(m×n).
OPA and Cedar are excellent for infrastructure authorization - API gateways, microservices, cloud resources. They're battle-tested and widely adopted.
But agents need more:
Capability OPA/Cedar MAPL Static evaluation Yes Yes Dynamic runtime composition Limited Native - perspectives combine at enforcement time Attestations (approval gates) Bolt-on First-class primitive Delegation with narrowing Manual Automatic via inheritance semantics Distributed PEP enforcement Possible Designed for it Evaluation semantics Varies Deterministic semantics, no overrides We're not replacing OPA/Cedar for infrastructure - use them where they excel. MAPL is purpose-built for the agentic layer.
Already using OPA or Cedar? We can auto-convert your policies to MAPL. Contact us for migration assistance.
MAPL gives you five dimensions of control:
WHAT (Resources)
- Which LLMs:
llm:openai/*,llm:anthropic/claude-3-* - Which tools:
tool:search,tool:database_* - Which data:
data:public/*,data:customer/**
HOW (Constraints)
- Parameter restrictions:
"model": ["gpt-4"],"max_tokens": {"max": 4000} - Rate limits:
"rate_limit": 100 - String patterns:
"pattern": "^[a-z]+$","max_length": 1000
WHY (Attestations & Policy Algebra)
- Required approvals:
"attestations": ["manager_approval"] - Conditional gates:
"trade_approved::{params.amount > 10000}" - Policy intersection ensures all perspectives agree
WHEN (Temporal Constraints)
- Time windows:
"time_restrictions": {"hours": "09:00-17:00"} - Validity periods:
"validity": {"not_after": "2024-10-25T16:00:00Z"} - Time-bounded emergency access
WHERE (Identity & Scope)
- Identity chaining through delegation
- Scope levels: global → company → bu → team → user → app
- Resource namespacing:
tool:customer-support-bot/*
- Which LLMs:
{ "policy_id": "team:engineering", "name": "Engineering Team Policy", "extends": "company:default", "resources": [ "llm:openai/*", "tool:search_*" ], "denied_resources": [ "data:executive/*" ], "constraints": { "rate_limit": 100, "parameters": { "llm:openai/*": { "model": ["gpt-3.5-turbo", "gpt-4"], "max_tokens": {"max": 4000} } } }, "attestations": ["identity_verified"] }Section Purpose resourcesWhitelist - what this principal CAN access denied_resourcesBlacklist - explicitly denied, overrides inherited allows constraintsOperational limits: rate limits, parameter restrictions extendsInherit from parent - permissions narrow, never expand attestationsRequired approvals before operations proceed See MAPL Schema Reference for all fields including
validity,denied_parameters, and constraint types.Two reasons:
1. Whitelist forces explicit scope By requiring
resourcesto enumerate what's allowed, administrators must consciously decide what's in scope. Anything not listed is automatically denied. No "forgot to block it" vulnerabilities.2. Blacklist protects sensitive assets across delegation As policies compose through multi-step workflows and delegation chains, certain assets must remain protected regardless of what permissions flow through.
denied_resourcesensures critical resources (the secrets store, administration, executive data) are never accessible - even if inheritance would otherwise allow them.{ "denied_resources": [ "secrets:**", "admin:**", "data:executive/*" ] }When policies merge:
resourcesintersect (both must allow),denied_resourcesunion (either can deny). Defense in depth.Denial patterns match operations, not the values passed to them. To block a file such as
/etc/shadow, deny the parameter value withconstraints.denied_parameters.No. This is deliberate.
Overrides break provability. The moment you allow arbitrary overrides, you lose the formal guarantees that make MAPL's security deterministic. Theorems about policy behavior no longer hold. You're back to "trust me, the admin knows what they're doing."
The pattern instead: a time-bounded policy
Need emergency access? Bind the person, for the window, to a policy with a validity period, through their identity provider group:
{ "policy_id": "team:incident-1234", "resources": ["data:production/*"], "validity": { "not_after": "2024-10-25T16:00:00Z" }, "attestations": ["ciso_approved"] }This composes via intersection like any other policy - maintaining formal guarantees while supporting operational flexibility. It can only narrow, so the access must already be allowed above it. Outside its validity window the policy refuses every call, so a membership left in place grants nothing.
30 years of "we always need overrides"? That's because those systems couldn't provide provable safety anyway. If you want deterministic security guarantees, you must bound the system. MAPL makes that tradeoff explicit.
Policies can extend other policies:
{ "policy_id": "user:alice", "extends": "team:engineering", "constraints": { "rate_limit": 50 } }Alice inherits engineering team's permissions but with a lower rate limit.
Key principle: Inheritance can only narrow, never expand. A child policy cannot grant more access than its parent. This monotonic narrowing is what makes delegation safe - you can't escalate privileges through the inheritance chain.
Policies intersect dynamically (most restrictive wins):
Field Merge Rule resourcesIntersection (both must allow) denied_resourcesUnion (either can deny) constraints.parametersMost restrictive (min of maxes, max of mins) denied_parametersUnion (either can deny) rate_limitMinimum Example:
- Company:
max_tokens: 4000 - Team:
max_tokens: 2000 - User:
max_tokens: 1000 - Effective:
max_tokens: 1000
This happens at runtime, combining caller intent, system rules, app policy, and workflow delegation automatically.
- Company:
Yes, using attestations. These can be human approvals or programmatic validations:
{ "attestations": [ "identity_verified", "manager_approval::{params.amount > 10000}" ] }This requires identity verification for all actions, and manager approval for high-value transactions.
Attestation metadata can specify approval criteria, timeouts, and whether approvals are one-time or reusable (grants):
{ "constraints": { "attestations": { "manager_approval": { "approval_criteria": "role:manager", "timeout": 300, "one_time": true } } } }Yes, using the
priorityfield. When multiple attestations apply to an operation, higher priority attestations are processed first:{ "constraints": { "attestations": { "critical_approval": { "approval_criteria": "role:security", "priority": 100 }, "standard_approval": { "approval_criteria": "role:manager", "priority": 0 } } } }In this example,
critical_approval(priority 100) is requested beforestandard_approval(priority 0). If a higher-priority attestation is denied, lower-priority ones are not requested.Default priority is 0. Use higher values for attestations that should be checked first.
Pattern Matches *Any characters except /**Any characters including /Examples:
tool:*matchestool:search,tool:analyzetool:**matchestool:openai/chat.completions*sales*matchesquarterly_sales_report.txt
In the Console:
- Go to Policies tab
- Create or edit a policy
- The system validates structure and syntax automatically
- Use the Policy Assistant to explain what a policy does in plain English
For programmatic validation, see the MAPL Schema Reference.