policy_decisions
Audit and understand recent policy evaluation decisions (allow/deny/escalate) for workspace oversight and compliance verification.
Instructions
View recent policy evaluation decisions (allow/deny/escalate) for this workspace. Useful for auditing and understanding what the policy engine has been doing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max decisions to return (default 10) | |
| decision | No | Filter by decision type |
Implementation Reference
- openterms_mcp_server.py:345-365 (handler)The handler implementation for the 'policy_decisions' tool, which fetches recent policy decisions from the /v1/policy/decisions endpoint.
elif name == "policy_decisions": params = {"limit": min(arguments.get("limit", 10), 50)} if arguments.get("decision"): params["decision"] = arguments["decision"] resp = client.get("/v1/policy/decisions", params=params, headers=_headers()) if resp.status_code == 200: data = resp.json() decisions = data.get("decisions", []) if not decisions: return "No policy decisions recorded yet." lines = [f"Recent policy decisions ({len(decisions)}):"] for d in decisions: icon = {"allow": "β ", "deny": "π«", "escalate": "βΈοΈ"}.get(d.get("decision"), "β") reasons = d.get("reasons", []) reason_str = f" β {reasons[0]}" if reasons else "" lines.append( f" {icon} {d.get('decision', '?').upper()} v{d.get('profile_version', '?')} " f"receipt={d.get('receipt_id', 'n/a')[:12]}...{reason_str} ({d.get('evaluated_at', '?')})" ) return "\n".join(lines) return _format_error(resp) - openterms_mcp_server.py:106-118 (schema)The MCP tool schema definition for 'policy_decisions', including the input schema for limit and decision filter.
"name": "policy_decisions", "description": ( "View recent policy evaluation decisions (allow/deny/escalate) for this workspace. " "Useful for auditing and understanding what the policy engine has been doing." ), "inputSchema": { "type": "object", "properties": { "limit": {"type": "integer", "description": "Max decisions to return (default 10)"}, "decision": {"type": "string", "enum": ["allow", "deny", "escalate"], "description": "Filter by decision type"}, }, }, },