Decisions & Escalations
Decisions & Escalations¶
Query the immutable decision log and manage the human review queue.
GET /v1/enforce/decisions
List decisions with pagination and filtering by action_type or decision.
GET /v1/enforce/decisions/{decision_id}
Get a single decision with full details.
GET /v1/enforce/escalations
List pending escalations (actions awaiting human review).
POST /v1/enforce/escalations/{id}/resolve
Approve or reject an escalated action. Body: {"resolution": "approved"|"rejected"}. Immediately unblocks any SDK call polling this escalation.
GET /v1/enforce/escalations/{id}/status
Poll the resolution status of a pending escalation. Returns {"ok": true, "status": "pending"|"approved"|"rejected"}. Called automatically by the SDK's wait_for_escalation() method every escalation_poll_interval seconds.
Query Decisions¶
# Get all blocked decisions
blocked = requests.get(
"https://www.xybern.com/api/v1/enforce/decisions",
headers={"X-API-Key": API_KEY},
params={"decision": "block", "per_page": 20}
).json()
for d in blocked["decisions"]:
print(f"{d['decision_id']}: {d['action_type']} → {d['decision']} "
f"(trust: {d['trust_score']}, {d['latency_ms']}ms)")
# Resolve an escalation
requests.post(
f"https://www.xybern.com/api/v1/enforce/escalations/{esc_id}/resolve",
headers={"X-API-Key": API_KEY},
json={"resolution": "approved", "reason": "Reviewed and safe to proceed"}
)
Stats Endpoint¶
GET /v1/enforce/stats
Aggregate enforcement statistics: decisions, block rate, avg latency, agent counts.