Skip to main content
POST
/
policies
/
evaluate
/
historical
Evaluate policy against historical traces
curl --request POST \
  --url https://api.mnemom.ai/v1/policies/evaluate/historical \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "policy": {
    "meta": {
      "schema_version": "<string>",
      "name": "<string>",
      "description": "<string>",
      "scope": "agent"
    },
    "capability_mappings": {},
    "forbidden": [
      {
        "pattern": "<string>",
        "reason": "<string>",
        "severity": "high"
      }
    ],
    "escalation_triggers": [
      {
        "condition": "<string>",
        "action": "notify",
        "reason": "<string>"
      }
    ],
    "defaults": {
      "unmapped_tool_action": "warn",
      "unmapped_severity": "medium",
      "fail_open": false,
      "enforcement_mode": "observe",
      "grace_period_hours": 0
    }
  },
  "agent_id": "<string>",
  "from": "2023-11-07T05:31:56Z",
  "to": "2023-11-07T05:31:56Z",
  "limit": 100
}
'
{
  "evaluation": {
    "verdict": "pass",
    "violations": [
      {
        "type": "forbidden",
        "tool": "<string>",
        "capability": "<string>",
        "rule": "<string>",
        "reason": "<string>",
        "severity": "low"
      }
    ],
    "warnings": [
      {
        "tool": "<string>",
        "message": "<string>"
      }
    ],
    "card_gaps": [
      {
        "capability": "<string>",
        "missing_card_field": "<string>",
        "suggestion": "<string>"
      }
    ],
    "coverage": 0.5
  },
  "traces_evaluated": 123,
  "time_range": {
    "from": "2023-11-07T05:31:56Z",
    "to": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Supabase JWT token in Authorization: Bearer header

Body

application/json
policy
object
required

A complete CLPI policy document defining capability mappings, forbidden tools, escalation triggers, and enforcement defaults.

agent_id
string
required

Agent whose historical traces will be evaluated

from
string<date-time>

Start of time range for historical traces

to
string<date-time>

End of time range for historical traces

limit
integer
default:100

Maximum number of traces to evaluate

Response

Historical evaluation result

evaluation
object

Result of evaluating a CLPI policy against a set of tools or traces.

traces_evaluated
integer
time_range
object