Skip to main content
This document is the normative schema definition for Mnemom Policy YAML files. A policy file declares what an agent is allowed to do, what is forbidden, when to escalate, and how to handle unmapped tools. The policy engine evaluates every tool call against the active policy before execution.

Schema version

The current schema version is 1.0.
Schema versions follow semantic versioning for backward compatibility. All 1.x schemas are backward-compatible with 1.0 — new optional fields may be added, but no existing field will change meaning or become required. A major version bump (e.g., 2.0) indicates a breaking change and will be accompanied by a migration guide.
The schema_version field is required in every policy file. The policy engine rejects files with an unrecognized schema version.

Complete schema definition

A valid policy YAML file contains five top-level keys: meta, capability_mappings, forbidden, escalation_triggers, and defaults.

meta (required)

Identifies the policy and controls merge behavior.
Use scope: "org" for organization-wide security baselines that apply to all agents. Use scope: "agent" for per-agent customizations that layer on top of the org policy.

capability_mappings (required)

A map of capability names to their definitions. Each capability groups related tools under a semantic name that corresponds to bounded actions in the agent’s alignment card.

Tool pattern syntax

Tool patterns use glob syntax for matching:
Each tool call is matched against patterns in declaration order — the first matching capability wins. If a tool matches multiple capabilities, only the first match is used for policy evaluation. Order your capability mappings from most specific to least specific.
The card_actions array must reference entries defined in the agent’s alignment card under autonomy.bounded_actions (unified) / autonomy_envelope.bounded_actions (AAP protocol). A mismatch between policy card_actions and the alignment card produces a validation warning.
Policy as a card section. In the unified card model, what this specification describes as a standalone Policy YAML is now embedded in the alignment card under capabilities + enforcement. The DSL grammar below still describes the evaluator’s internal representation and is the source of truth for anyone implementing a policy-engine client or writing CI checks against the DSL directly. But if you are authoring a card for Mnemom, you edit the card’s YAML sections, not a separate policy file.

forbidden (required, can be empty array)

An array of rules that unconditionally block specific tools. Forbidden rules are evaluated before capability mappings.

Severity enforcement behavior

Severity determines how the policy engine handles a match:
Even in enforce mode, medium and low severity forbidden rules produce warnings rather than hard blocks. This allows you to track usage of discouraged tools without disrupting agent operation. Use critical or high for tools that must never be called.
If forbidden has no rules, pass an empty array:

escalation_triggers (optional, defaults to empty)

An array of conditional rules that flag tool calls for human review, add warnings, or deny access based on pattern expressions.

Action behavior

Condition expressions

The condition field currently supports one expression type:
The glob pattern inside tool_matches() uses the same syntax as tool patterns in capability_mappings and forbidden. Future schema versions may add additional expression types (e.g., session_count_exceeds(n), time_since_last_escalation()). If escalation_triggers is omitted, it defaults to an empty array.

defaults (required)

Controls fallback behavior for tools that do not match any capability mapping or forbidden rule.
Setting fail_open: true means that if the policy engine encounters an internal error, all tool calls will be permitted. This maximizes availability but reduces safety guarantees. For high-risk agents, set fail_open: false to ensure errors fail safely.

Validation rules

The policy engine validates every policy file on load. A policy that fails validation is rejected entirely — partial policies are never applied.
  • meta.schema_version must be present, a string, and a recognized version (currently "1.0")
  • meta.name must be present and non-empty
  • meta.scope must be exactly "org" or "agent"
  • meta.description, if present, must be a string
  • Must be a mapping (YAML object), not an array or scalar
  • Each entry key (capability name) must be a non-empty string
  • Each entry must have a tools array with at least one element
  • Each element in tools must be a non-empty string (valid glob pattern)
  • Each entry must have a card_actions array with at least one element
  • Each element in card_actions must be a non-empty string
  • description, if present, must be a string
  • Duplicate capability names are rejected
  • Must be an array (can be empty)
  • Each element must have pattern (non-empty string), reason (non-empty string), and severity
  • severity must be one of: "critical", "high", "medium", "low"
  • Overlapping patterns are permitted (all matching rules fire)
  • If present, must be an array
  • Each element must have condition (non-empty string), action, and reason (non-empty string)
  • action must be one of: "escalate", "warn", "deny"
  • condition must be a valid expression (currently only tool_matches('...') is supported)
  • Invalid condition expressions produce a validation error
  • unmapped_tool_action must be present and one of: "allow", "deny", "warn"
  • unmapped_severity must be present and one of: "critical", "high", "medium", "low"
  • fail_open must be present and a boolean
  • enforcement_mode, if present, must be one of: "warn", "enforce", "off"
  • grace_period_hours, if present, must be a non-negative number

Full annotated example

The following is a complete, realistic policy for a customer support agent. It maps browser and filesystem tools to alignment card actions, forbids dangerous operations, sets up escalation triggers for sensitive patterns, and uses warn mode with a 24-hour grace period.

Walkthrough

  1. meta — The policy is scoped to a single agent (scope: "agent"), meaning it layers on top of an org-level baseline via the merge rules described below.
  2. capability_mappings — Four capabilities are defined. web_browsing uses a catch-all glob (mcp__browser__*) as its last pattern, ensuring any browser tool not explicitly listed still maps to this capability. knowledge_base_read and knowledge_base_write separate read and write filesystem operations.
  3. forbidden — Six rules block destructive operations. The critical and high severity rules will be hard-blocked in enforce mode. The medium severity rule for mcp__browser__execute_script produces a warning even in enforce mode, since it is discouraged but not categorically dangerous.
  4. escalation_triggers — Ticket updates require human approval during ramp-up. File writes and external navigation are permitted but logged.
  5. defaults — Unmapped tools produce a medium warning (not blocked). fail_open: false ensures that policy engine errors are treated as denials. The 24-hour grace period means a newly deployed policy runs in warn mode for the first day, even if enforcement_mode is later changed to enforce.

Merge semantics

When an agent has both an org-scoped policy and an agent-scoped policy, the policy engine merges them into a single effective policy. The merge follows deterministic rules designed so that org policies set a security floor and agent policies can only strengthen (never weaken) it.

capability_mappings: Union

The effective capability mappings are the union of org and agent mappings.
  • If the same capability name appears in both, the agent definition replaces the org definition entirely (not a deep merge).
  • Capabilities defined only in org or only in agent are included as-is.
In transaction guardrails (multi-agent coordination), capability mappings use intersection instead of union. A tool call is only permitted if it is mapped in both the initiating agent’s and the counterparty’s effective policies. This prevents one agent from granting capabilities the other has not approved.

Merge summary table


Evaluation order

When a tool call is evaluated against the effective policy, the engine follows this order:
  1. Forbidden rules — If any forbidden rule matches, the tool call is flagged as a violation with the corresponding severity. Evaluation continues (all matching forbidden rules are collected).
  2. Escalation triggers — All matching triggers fire. Actions (escalate, warn, deny) are collected.
  3. Capability mappings — The tool is matched against capability patterns in declaration order. The first matching capability is used. If matched, the tool call is permitted (subject to any forbidden or escalation results from steps 1-2).
  4. Defaults — If no capability mapping matched and no forbidden rule matched, the unmapped_tool_action is applied.
  5. Decision — The engine aggregates all violations, warnings, and escalations to produce a final decision: allow, warn, deny, or escalate.

See also