Policy Engine
The Policy Engine is Phase 1 of CLPI (Card Lifecycle & Policy Intelligence) — the governance layer that transforms alignment cards into lifecycle-managed artifacts with policy enforcement, trust recovery, risk intelligence, and on-chain anchoring.
web_fetch. The capabilities section of the same card says web_fetch means mcp__browser__navigate and mcp__browser__click — but not mcp__filesystem__delete. The card declares intent. The enforcement section enforces it.
Since UC-4 (2026-04-15), policy is part of the alignment card, not a separate artifact. The
capabilities, enforcement, and per-capability forbidden rules live as sections of the unified card. There is no standalone policy YAML file, no PUT /v1/agents/:id/policy endpoint, and no mnemom policy CLI group. Use mnemom card evaluate + PUT /v1/agents/{id}/alignment-card instead. See the policy management guide for the customer workflow and the migration guide if you’re coming from the pre-UC model.The policy engine is a parallel enforcement layer to alignment enforcement (observe/nudge/enforce). Alignment enforcement checks agent behavior against card values. Policy enforcement checks tool usage against the card’s
capabilities + enforcement sections. Both run independently and produce separate verdicts.How the engine reads the card
The policy engine reads three sections of the canonical (composed) alignment card:| Section | Purpose |
|---|---|
capabilities | Bridge card-level semantic actions (web_fetch, read_file) to concrete tool glob patterns (mcp__browser__*) |
enforcement.forbidden | Tools that are always blocked, regardless of mappings |
enforcement (top-level knobs) | Fallback behavior for unmatched tools — default_mode, unmapped_tool_action, grace_period_hours |
| Section | Purpose |
|---|---|
autonomy.escalation_triggers | Conditions that trigger escalation regardless of individual tool verdicts |
autonomy.max_autonomous_value | Currency-denominated ceiling on autonomous actions |
Example excerpt of a card’s policy sections
Three evaluation contexts
The samecapabilities + enforcement sections are evaluated at three stages, each with different inputs and consequences.
- CI/CD (Static)
- Gateway (Live)
- Observer (Post)
CI/CD evaluation
Static evaluation runs in pipelines before deployment. It validates the card against the unified schema and evaluates its policy sections against a declared tool list.Commands:- Card YAML conforms to the unified schema (capability glob validity, enforcement-mode enums, forbidden-rule structure).
- Capability
card_actionsreference actions that exist inautonomy.bounded_actions. - Each tool in the
--toolslist matches a capability, hits a forbidden rule, or falls through to theunmapped_tool_actiondefault. - Coverage report identifies card actions with no backing capability mapping.
Capability mapping
Capability mappings are the core of the card’s policy sections. They bridge the gap between what the card declares (abstract actions likeweb_fetch) and what agents actually invoke (concrete tool names like mcp__browser__navigate).
Structure
Each capability has a name, a list of tool glob patterns, and a list of card actions it satisfies:Glob patterns
Tool patterns support standard glob syntax for flexible matching:| Pattern | Matches |
|---|---|
mcp__browser__* | All browser tools (navigate, click, screenshot, etc.) |
mcp__filesystem__read* | read_file, read_directory, read_metadata |
mcp__*__list* | Any MCP server’s list operations |
custom_tool_v? | custom_tool_v1, custom_tool_v2, etc. |
How matching works
When the policy engine evaluates a tool, it follows this order:- Forbidden check: does the tool match any
enforcement.forbidden[].pattern? If yes, the tool is a violation regardless of capability mappings. - Capability match: does the tool match any
capabilities[*].toolsglob? If yes, the tool is allowed and mapped to the corresponding card actions. - Default fallback: if neither forbidden nor mapped, apply
enforcement.unmapped_tool_action.
read_file and read_source_code).
Enforcement modes
enforcement.default_mode is the card’s policy-enforcement posture:
Warn
Log violations but do not block.
X-Policy-Verdict: warn header returned. Default mode.Enforce
Block requests with policy violations.
X-Policy-Verdict: fail header returned. HTTP 403 for non-streaming requests.Off
Skip policy evaluation entirely. No
X-Policy-Verdict header. No performance overhead.Relationship to alignment enforcement
| System | Card section | What it checks | Verdict source |
|---|---|---|---|
| Alignment enforcement | integrity.enforcement_mode | Agent behavior against card values and autonomy envelope | AIP integrity checkpoints, AAP verification |
| Policy enforcement | enforcement.default_mode | Tool usage against policy rules and capability mappings | Policy engine evaluation |
Forbidden rules
enforcement.forbidden defines tools that must never be used, regardless of capability mappings. They’re always checked first in the evaluation pipeline.
| Field | Type | Description |
|---|---|---|
pattern | string (glob) | Tool name pattern to match |
reason | string | Human-readable explanation for auditing |
severity | enum | critical, high, medium, or low |
Policy
enforcement.forbidden rules complement alignment card autonomy.forbidden_actions. Card forbidden actions declare intent (“this agent must never delete files”). Policy forbidden rules enforce that intent at the tool level (“block all tools matching mcp__filesystem__delete*”). Both are checked — card-level by alignment enforcement, tool-level by policy enforcement.Unmapped tool handling
When a tool does not match any capability or forbidden rule,enforcement.unmapped_tool_action determines what happens.
Unmapped tool actions
| Action | Behavior |
|---|---|
deny | Treat the unmapped tool as a violation. Blocked in enforce mode. |
warn | Log a warning but allow the tool invocation. Default. |
allow | Silently permit the tool. No log entry. |
Choosing the right default
- Development
- Staging
- Production
Use
allow during early development when tool sets are still evolving. This avoids noise from constantly changing tool inventories.Grace period
New tools appear when agents gain new MCP server connections or when tool providers add capabilities. The grace period prevents these newly discovered tools from immediately becoming violations.- The policy engine tracks when each tool is first seen via
tool_first_seenrecords. - When an unmapped tool is encountered, the engine checks how long ago it was first seen.
- If the tool was first seen within the grace period window, it is treated as
allowregardless ofunmapped_tool_action. - After the grace period expires, the tool falls back to the configured
unmapped_tool_action.
capabilities section after adding new tools or MCP servers, without immediately triggering violations in enforce mode.
Composition across scopes
In organizations with multiple agents, thecapabilities and enforcement sections compose from platform → org → agent scopes per card composition rules. These are merged at storage time, not request time: every gateway read hits the pre-composed canonical card.
Merge rules
| Section | Merge strategy | Effect |
|---|---|---|
capabilities | Union | Agent can add new capabilities but cannot remove platform or org capabilities |
enforcement.forbidden | Deny-overrides union | Both org and agent forbidden rules are enforced; agent cannot subtract |
enforcement.default_mode | Strictest wins (enforce > warn > off) | Agent can tighten, not loosen |
enforcement.unmapped_tool_action | Org is floor | Agent can strengthen (allow → warn → deny) but cannot weaken |
autonomy.escalation_triggers | Union | Both org and agent triggers are evaluated |
Strengthening enforcement
The org mode acts as a floor; the agent can only move in the stricter direction:unmapped_tool_action: warn, an agent can set it to deny (stricter) but not allow (weaker).
Transaction guardrails
Transaction-scoped cards can further restrict the composed enforcement via intersection semantics. A transaction guardrail can only narrow what’s permitted — never expand it.Coverage report
Everymnemom card evaluate run produces a coverage report that quantifies how well the card’s capabilities section maps to its autonomy.bounded_actions. This identifies gaps between what the card declares and what the policy actually covers.
Coverage metrics
| Metric | Description |
|---|---|
total_card_actions | Number of actions declared in the card’s autonomy.bounded_actions |
mapped_card_actions | Number of card actions covered by at least one capability |
unmapped_card_actions | Card actions with no corresponding capability |
coverage_pct | mapped_card_actions / total_card_actions * 100 |
Example output
Using coverage in CI/CD
Putting it together
Here’s the full alignment card for a research agent that can browse the web and read files but cannot delete anything or execute shell commands:Limitations
- Policy evaluation adds latency to gateway requests (typically under 5 ms for cards with fewer than 100 capability patterns).
- Glob patterns match tool names only, not tool arguments. A tool can be permitted by policy but still violate alignment constraints based on how it’s called.
- Grace periods are tracked per-agent, not per-card-version. Updating a card doesn’t reset grace-period timers for previously seen tools.
- Coverage reports require a valid
autonomy.bounded_actionslist. Agents with an empty envelope get a coverage report with 0% coverage (no denominator).
See also
- Alignment Card Schema — normative schema for the unified alignment card (including capabilities + enforcement sections)
- Policy Management Guide — step-by-step guide to authoring and deploying the
capabilities+enforcementsections - CI/CD Policy Gates —
mnemom card evaluatein GitHub Actions and GitLab CI - Card Lifecycle — how alignment cards evolve and interact with policy
- Card Composition — how platform / org / agent scopes merge
- Migrating to Unified Cards — if you’re coming from the pre-UC policy model
- Enforcement Modes — alignment enforcement (observe/nudge/enforce) vs. policy enforcement