Agent Policies (Cedar)
Agent Authorization decides what an agent may do: the tools and destinations it was granted. Agent policies are the other half: your organisation's own rules for what an agent must never do, whatever it was granted.
Policies are written in Cedar, an open policy language, and run unmodified: no custom syntax, nothing proprietary to learn. What you write can be read, tested and reviewed with the standard Cedar tooling.
What a policy looks like
A policy only refuses. Each one is a forbid naming what it applies to and when:
@id("finance-no-email")
forbid (principal in MeetLoyd::Team::"<team id>", action == MeetLoyd::Action::"call_tool", resource)
when { context.tool.base == "send_email" };
Because agents sit inside teams, workspaces and your organisation, a policy on a team applies to every agent in it.
A few more patterns:
| Rule | Policy |
|---|---|
| Never call a tool | forbid (principal, action == MeetLoyd::Action::"call_tool", resource) when { context.tool.base == "crm_delete_contact" }; |
| Nothing outside working hours (UTC) | forbid (principal, action, resource) when { context.utc.minute < 420 || context.utc.minute >= 1140 }; |
| Cap an amount | forbid (principal, action == MeetLoyd::Action::"call_tool", resource) when { context.tool.base == "wire_transfer" && context has args && context.args has amount && context.args.amount > 10000 }; |
| Only from the corporate network | forbid (principal, action, resource) when { !(context has sourceIp4 && context.sourceIp4.isInRange(ip("10.0.0.0/8"))) }; |
Granting stays the job of agent authorization: a document that contains a permit is refused when
it is proposed.
What a policy can read
The platform measures the facts before evaluation and hands them to Cedar. Facts are measured, never decisions: whether a fact blocks a call is always a policy you can read.
| Fact | What it is |
|---|---|
context.tool.name, context.tool.base | The tool called (base: its name without a platform prefix) |
context.utc.dow, context.utc.minute, context.nowMs | The time (day of week, 0 = Sunday; minute of the day, UTC) |
context.purpose | The purpose declared for the call, empty when none |
context.sourceIp, context.sourceIp4 | The caller's address, when known |
context.budget.blocked, context.budget.throttled | The agent's spend state |
context.halted | Whether a kill switch applies to the agent |
context.args | The tool's arguments, on the platform runtime only |
A policy that reads a fact the call does not carry cannot be evaluated, and refuses: policies fail closed.
Where policies apply
The same policy set applies on every path an agent call takes:
- The platform runtime: every tool call by a MeetLoyd agent, and by an external agent governed through the gateway. Only here are the tool's arguments known.
- The decision points: the policy set reaches them within seconds of activation, so calls that go through them get the same answer.
Platform rules, such as the kill switch, are applied as well, and no policy of yours can lift them.
Watch first, then enforce
Each version runs in one of two modes:
| Mode | Behaviour |
|---|---|
| Watch only | The call goes through. What the policies would have refused is recorded in the authorization audit trail, with the policy that would have refused it. |
| Enforced | A policy that applies refuses the call. The agent is told which policy refused it. |
Start with Watch only on real traffic, read what would have been refused, then propose the same policies as Enforced.
Four eyes, versions and rollback
- Write the policies, or start from an example.
- Check them: a document that does not parse is refused; anything that does not match the MeetLoyd schema (a misspelt fact) is reported.
- Try a call: describe a tool call and see whether the policies would refuse it.
- Propose a version, with its mode and a note on what changes and why.
- A second person approves it. The author cannot approve their own version. Once approved, it is in force within seconds.
Every version is kept and never edited. Moving from Watch only to Enforced is a new version, reviewed like any other. Rolling back to a version that was already approved takes one click and needs no second approval.
Managing policies
Agent policies live in Compliance → Policies → Agent policies (/compliance/policies). Anyone
with governance read access sees the policies in force and their history; proposing and reviewing
need governance write access.
Writing your own policies is part of the Strategic tier. Reviewing, withdrawing and rolling back a version that already exists always work, so a policy can always be loosened or reverted.
Agents that correct themselves
Policies set the hard limits. Within them, agents also improve from how their work went:
- Learning from experience. When people correct or approve an agent's work, when its runs are evaluated, or when it moves one of your measures, the agent keeps a lesson: what works, or a pitfall and its cause. A person's correction is used at once and proposed to the agent's team; a lesson that was only inferred waits until a second, separate run confirms it. Repeated corrections can become a proposed standing rule, which a person accepts or rejects. See Learning from Experience.
- Recent notices. Monitoring alerts about an agent or its team (a loop, a cost spike, a run of errors) are shown to the agent for a few days, so it can take them into account.
- Recalibration. An agent that finds its objectives outdated can ask its team lead to review them, without pausing its own work.
- Structured error recovery. When a tool fails, the agent is told what went wrong, what to try instead, and when to stop retrying and escalate.
Next: Compliance Verification: sampled, continuous checks that agents follow your policies.