POST /policy/evaluate
Evaluate an action against workspace policies.
POST
/policy/evaluatePolicy evaluationAuthentication
Bearer API key. Optional X-KorClaw-Agent-Key.
Request body
json
{
"input": {
"action": "export",
"resource": "customer-pii.csv",
"agent": "data-agent",
"environment": "production"
},
"approval_id": "optional-uuid"
}Response 200
json
{
"data": {
"allowed": false,
"action": "block",
"matched": true,
"policy": "Block PII Export",
"severity": "high",
"message": "PII exports are blocked.",
"result": "blocked",
"approval_id": null,
"execution_proxy_required": false
}
}Errors
- 400 invalid_request, agent_context_required, environment_context_required, agent_identity_mismatch, environment_mismatch, evaluation_failed
- 401 unauthorized, agent_key_required, invalid_agent_key
- 403 agent_not_found, agent_inactive, execution_proxy_required
- 503 audit_persist_failed
curl
curl -X POST https://app.korclaw.com/api/v1/policy/evaluate \
-H "Authorization: Bearer kc_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"input":{"action":"export","agent":"data-agent"}}'