---
title: "Evaluate an agent's derived policy against tools"
method: POST
path: "/policies/evaluate"
tags: ["Policy"]
---

# Evaluate an agent's derived policy against tools

`POST /policies/evaluate`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/policies/evaluate`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`

Evaluate a list of tools against the policy DERIVED from the agent's published canonical alignment card (capabilities + enforcement + escalation triggers). Returns a verdict with detailed violations, warnings, card coverage gaps, and overall coverage percentage. Requires a published canonical card for the agent (PUT /v1/agents/{id}/alignment-card first, else 404). No standalone policy document is accepted — the card is the source of truth (UC-8). `agent_id` must be a string naming an agent the caller may read (`cards:read`); an agent outside the caller's org gets the same 404 as an unknown agent.

## Request body

- object
  - `agent_id` string, required: Agent whose canonical alignment card the policy is derived from. Must have a published canonical card, and the caller must be a member of the agent's org (else 404, the same answer as an agent that does not exist).
  - `tools` object[], required: Non-empty list of tools to evaluate against the agent's derived policy.
    - `name` string, required: Tool identifier to evaluate (e.g. "fs_write").
  - `context` string: Evaluation surface/context (default "cicd").
  - `dry_run` boolean: When true, the evaluation result is not persisted to policy_evaluations.

## Response `200`

Policy evaluation result

- PolicyEvaluationResult: Result of evaluating a CLPI policy against a set of tools or traces.
  - `verdict` 'pass' | 'warn' | 'fail': Overall evaluation verdict
  - `violations` PolicyViolation[]: List of policy violations detected
    - `type` 'forbidden' | 'unmapped' | 'escalation' | 'capability_mismatch': Type of policy violation
    - `tool` string: Tool identifier that triggered the violation
    - `capability` string, nullable: Capability the tool was mapped to, if any
    - `rule` string, nullable: The specific rule or pattern that was matched
    - `reason` string: Human-readable explanation of the violation
    - `severity` 'low' | 'medium' | 'high' | 'critical': Severity level of the violation
  - `warnings` object[]: Non-blocking warnings about potential issues
    - `tool` string
    - `message` string
  - `card_gaps` object[]: Gaps between the policy and the alignment card
    - `capability` string
    - `missing_card_field` string
    - `suggestion` string
  - `coverage` number: Fraction of tools covered by the policy (0.0 to 1.0)

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
