Policy Engine
The policy engine is Mule’s control plane for autonomous agent actions:
versioned, owner-scoped bundles of deterministic rules that answer
(agent_id, tool, input) with a synchronous verdict — allow, deny,
or ask. Forge’s before_tool hook is the enforcement point, so an agent
cannot run a blocked tool call; the verdict reason is written into the agent
transcript.
All endpoints live under /api/v1/policies and require
Authorization: Bearer sk_mule_<hex>.
Concepts
| Concept | Meaning |
|---|---|
| Policy | One row of the policies table: a scope, optional agent_id, a non-empty rules array, an enabled flag, and an auto-incremented version. Owned by an owner-scoped API key. |
| Rule | One deterministic decision: “when <tool> is called and <match> applies, the verdict is <disposition>.” |
| Verdict | allow | deny | ask, plus the winning rule_id, a transcript-ready reason, and a memoized flag. |
| Memo | A cached verdict keyed by (agent_id, action_hash) — the “human said yes/no” record for an ask round-trip. |
| Proposal | A drafted policy an agent recorded; a human must approve it before it becomes an active policy. |
Rules
A rule (the rules array of a policy) looks like: