Documentation Index
Fetch the complete documentation index at: https://docs.truthlocks.com/llms.txt
Use this file to discover all available pages before exploring further.
Evaluate MAIP Policy
POST /v1/maip/policies/evaluate
Evaluates all active MAIP policies for the authenticated tenant against a specific agent and requested scope. Returns whether the action is allowed, denied, or requires human approval. This is the runtime enforcement checkpoint that agents call before performing sensitive operations.
Policy evaluation uses a deny-overrides model: if any active policy with a
matching
deny rule triggers, the action is blocked regardless of any allow
rules. The requires_approval flag is additive — it can be set even when the
action is allowed.Authentication
RequiresX-API-Key header or Bearer JWT token. Tenant-scoped via cookie or JWT claim.
Request Body
MAIP-compliant agent identifier (e.g.,
"maip:t1234567:01HYX3KPZQ7RJGBN0WFMV8SDEH"). The agent must exist and belong
to the authenticated tenant.The permission scope being requested (e.g.,
"data:write", "tool:execute",
"model:train"). Uses the resource:action format defined in
Scopes.The specific action being performed. Provides additional context for policy
rules beyond what the scope communicates.
The specific resource being accessed. Provides additional context for audit
logging and fine-grained policy conditions.
Evaluation Logic
The evaluation performs three sequential checks:- Agent Status Check — The agent must have
status: "active". Suspended or revoked agents are always denied. - Scope Access Check — The requested scope must be present in the agent’s granted scopes. Explicitly denied scopes (prefixed with
!) always block access. - Policy Rules Check — All active tenant policies are evaluated in priority order. Each rule’s conditions are AND-ed. If any
denyrule matches, the action is blocked.
Response
true if the action is permitted, false if denied by any check.Names of the policies that denied the action. Empty array if allowed.
Human-readable reason for denial. One of: -
"agent is not active" — Agent
is suspended or revoked - "scope not granted to agent" — Scope not in
agent’s granted scopes - "denied by policy" — One or more policies blocked
the actiontrue if any matching policy rule has requires_approval: true, even if the
action is otherwise allowed. The caller should present a human approval
workflow before proceeding.
