Cedar is an open source policy language for authorization. A Cedar policy states which principal may perform which action on which resource, and under which conditions, and a request is denied unless a policy permits it. For AI agents, it gives platform teams an attribute-based way to decide before each call whether this agent, acting for this user, may call this model, tool or agent, without writing a rule per agent.
Key takeaways
- Cedar decides a request from four inputs: principal, action, resource and context. For an agent call these are the agent, the kind of call, the destination, and facts such as the user and the tool’s arguments
- Three rules govern a decision: default deny, forbid overrides permit, and a policy that errors is skipped
- Attribute-based rules are written once against properties such as team and risk level, so a new agent is governed as soon as it is registered with those attributes
In this article:
- What is Cedar?
- Why do AI agents need a policy language?
- How does Cedar decide a request?
- How do you model agents, tools and users in Cedar?
- What do Cedar policies for AI agents look like?
- Why do attribute-based policies scale when roles do not?
- How do you test and roll out Cedar policy safely?
- Where is Cedar policy enforced?
- Frequently asked questions
- How Lynx approaches this
- Related guides
What is Cedar?
Cedar is a language for writing authorization policies and an engine for evaluating them. It was designed at Amazon Web Services, released as open source, and joined the Cloud Native Computing Foundation as a Sandbox project in October 2025.
A policy has a fixed shape. It begins with an effect, permit or forbid, names a principal, an action and a resource, and can add when and unless conditions on attributes and context. That shape supports role-based, attribute-based and relationship-based access control in one language.
Two design choices matter for a control that sits in front of agent calls. The language has no loops and no input or output, so evaluation cannot hang or call another system. It also has a formal model in the Lean theorem prover, and the production engine is tested against that model.
Why do AI agents need a policy language?
Agents make access control harder in three ways, and each pushes toward policy written as code.
- Agents multiply: the number of principals grows faster than a hand-maintained permission list
- Agents choose at runtime: an agent decides which tool or agent to call from the task in front of it, so access has to be decided per call
- Agents act for someone: an export that is fine for a finance analyst is not fine for an intern, even when the same agent makes the call
Most organizations have not caught up. In Gravitee’s State of AI Agent Security 2026, 29.5 percent of organizations running agents had a defined scope of what an agent may access in place before launch. The usual substitutes are allow-lists in application code and network rules that know addresses and ports but not agents, tools or users.
How does Cedar decide a request?
Cedar evaluates a request made of four parts, abbreviated PARC: the principal, the action, the resource and a context record of additional facts. It then applies three rules.

- Default deny: a request is denied unless at least one permit policy is satisfied
- Forbid overrides permit: if a forbid policy is satisfied, the answer is deny, however many permits also match
- Errors are skipped: a policy that fails during evaluation is ignored, so it cannot grant access by failing
The response also lists the determining policies: the permits that allowed the request or the forbids that denied it. That is what makes a decision auditable.
Policy order does not matter, and there are no priorities to tune. Adding a permit can only widen access and adding a forbid can only narrow it, so a reviewer can reason about each policy on its own.
How do you model agents, tools and users in Cedar?
Model a small set of entity types, each with attributes that policies can test.
- Agent: the principal in most requests, with attributes such as team, risk level, environment and owner
- Tool: a single tool on an MCP server, as the resource. Tools can be grouped, so one rule can cover a group such as exports
- Model: a model endpoint, with attributes such as provider and whether it is approved for sensitive data
- User: the person an agent acts for, with group membership
- Actions: a short, fixed list such as
call_tool,call_modelanddelegate

The user reaches the policy through the context. OAuth 2.0 token exchange produces a token that keeps the user as the subject and names the agent as the actor, and the enforcement point places that user in the request.
Write the model down in a schema. It declares entity types, attributes and which principal and resource types each action accepts, which lets a validator check policies before they are used.
What do Cedar policies for AI agents look like?
Four short policies cover the patterns most platforms need. The entity and attribute names are illustrative and come from your own schema.
Pattern 1. Allow by attribute
Any agent may call a low-risk tool that belongs to its own team. No agent and no tool is named, so new ones are covered by their attributes.
permit (
principal is Agent,
action == Action::"call_tool",
resource is Tool
)
when {
principal.team == resource.owner_team &&
resource.risk == "low"
};
Pattern 2. Guardrail with a user condition
No agent may call a tool in the exports group unless the request carries a user in the finance group. Because it is a forbid, it holds whatever permits exist.
forbid (
principal,
action == Action::"call_tool",
resource in ToolGroup::"exports"
)
unless {
context has user &&
context.user in Group::"finance"
};
Pattern 3. Tiering
Low-risk agents may delegate only to low-risk agents. One rule expresses a relationship between two sets of agents.
permit (
principal is Agent,
action == Action::"delegate",
resource is Agent
)
when {
principal.risk == "low" &&
resource.risk == "low"
};
Pattern 4. Argument constraint
An agent may export only its own region. The policy reaches inside the call and compares a tool argument with an agent attribute.
forbid (
principal is Agent,
action == Action::"call_tool",
resource == Tool::"crm-tools/export_customers"
)
when {
context.arguments has region &&
context.arguments.region != principal.region
};
The working method is a few broad permits written against attributes, plus a few forbids that state what must not happen.
Why do attribute-based policies scale when roles do not?
Role-based control needs a binding for each agent and each permission, so the work grows with both agents and tools. Attribute-based rules are stated once.
| Question | Role-based policy | Attribute-based policy in Cedar |
|---|---|---|
| What happens when agent number 101 ships? | Someone chooses its roles and edits the bindings by hand | It is covered once it is registered with matching attributes |
| How do you allow one tool on a server and not the others? | A role per tool, or a broader role than intended | A condition on the tool, its group or its attributes |
| Can the decision depend on the user the agent acts for? | Not without a second system | Yes, the user travels in the context of the request |
| What must be kept accurate? | The bindings | The attributes set at registration |

The last row is the trade-off. Attribute-based policy moves the work from maintaining bindings to maintaining attributes. If anyone can set an agent’s risk level to low, the policy is only as good as that field, so attributes used in policy should be set at registration and changed through review.
How do you test and roll out Cedar policy safely?
Treat policy as code: validate it, test it and enforce it in stages.
- Validate against the schema in the pipeline, to catch unrecognized names and type mismatches
- Keep a suite of requests that must be allowed and requests that must be denied, and run it on each change
- Observe before you enforce: the calls agents make today are the first draft of your permits
- Start with a few broad permits, turn on default deny, then tighten
- Add forbids for the non-negotiables early, and review denials after enforcement
One pitfall deserves a test of its own. A policy that errors is skipped, so a forbid that reads an attribute the request may not have protects nothing when it is missing. Check for presence with has before reading it.
Where is Cedar policy enforced?
Policy is enforced by a policy enforcement point in the path of the call, which asks a policy decision point for an answer. The OpenID AuthZEN Authorization API 1.0 standardizes that exchange: the enforcement point sends a subject, an action, a resource and a context, and receives a decision.
For agents, the enforcement point is usually a gateway, as described in Agent gateway vs AI gateway vs MCP gateway. Each step of a task is authorized as it is made, whichever path the agent takes.
That placement also defines the limit. An agent that calls a model directly, or starts a tool as a local subprocess, does not ask the question. Sandboxing and kernel-level observation with eBPF cover that gap.
Frequently asked questions
How is Cedar different from OPA and Rego?
Open Policy Agent is a general-purpose policy engine, and its Rego language can express a wide range of rules over structured data. Cedar is narrower by design. It is built only for authorization, has a fixed permit and forbid structure with default deny, and limits the language so policies can be validated and analyzed.
Can Cedar policies control individual MCP tools?
Yes, if the enforcement point supplies the detail. A tool can be modeled as a resource with its own attributes and groups, and the arguments of a call can be passed in the context. A policy can then allow one tool on a server, deny another, and constrain argument values.
Does Cedar policy stop prompt injection?
It does not prevent an agent from being manipulated. It limits what a manipulated agent can do. An injected instruction to call a tool the agent is not permitted to use is denied like any other unauthorized call.
Do you have to change agent code to use Cedar?
Not if policy is enforced at a gateway. The agent makes its calls as before, and the gateway identifies the caller, asks the policy engine for a decision and forwards or blocks the call. Policy can then change without redeploying agents.
How Lynx approaches this
In Lynx by Tigera, Cedar policy decides which agents, users and service identities may call which agents, MCP servers, LLM providers and LLM routes. Enforcement is default-deny and cannot be switched off: with no policies loaded, a request is refused. A rule can name an explicit pair of entities or match the policy attributes set at registration, such as a shared team.
For MCP, the request context carries the JSON-RPC method, the tool name and arguments, the resource URI and the prompt name, so a policy can forbid tool calls except for an allow-listed tool. Tool rules are written as forbids, because the server is the resource and the tool is part of the context. Malformed request parameters or oversized tool arguments are denied, not evaluated on partial data. Rules can also test token claims, including, with delegated identity turned on, the groups of the user an agent acts for.
The gateway’s authorization sidecar and the registry each run a Cedar engine from the same Policy resources, and the registry exposes an AuthZEN API. The sidecar evaluates policy in-process without calling the registry, so a registry restart does not interrupt enforcement. Policies are Kubernetes resources, and a policy playground tests a rule before it is applied. Attributes are not schema-checked at runtime, so a rule must confirm an attribute exists before reading it.
Explore the AI agent security guides or learn more about Lynx by Tigera.