Skip to content

POST /v1/enforce/intercept

POST /v1/enforce/intercept

Intercept an AI action before execution. This is the primary endpoint, every action must pass through here.

POST /v1/enforce/intercept Pre-execution interception with policy evaluation, trust scoring, and vault recording.

Request Body

Field Type Required Description
action_type string Yes Action name: execute_trade, send_email, query_database, etc.
action_content string No Content being actioned (e.g. email body, SQL query)
metadata object No Arbitrary metadata (amount, recipient, etc.)
agent_id string No Registered agent performing the action
chain_id string No Multi-step chain identifier
chain_step integer No Step number within the chain
parent_decision_id string No Previous decision in this chain

Example

import requests

API_KEY = "xb_your_api_key"

# Before executing a trade, intercept it
result = requests.post(
    "https://www.xybern.com/api/v1/enforce/intercept",
    headers={"X-API-Key": API_KEY},
    json={
        "action_type": "execute_trade",
        "action_content": "Buy 1000 shares of AAPL at market price",
        "metadata": {"symbol": "AAPL", "quantity": 1000, "side": "buy"},
        "agent_id": "agent_abc123"
    }
).json()

if result["decision"] == "allow":
    execute_trade()  # proceed
elif result["decision"] == "block":
    log_blocked(result["reasoning"])
elif result["decision"] == "escalate":
    notify_human(result["decision_id"])

Response

{
  "ok": true,
  "decision": "allow",
  "decision_id": "enf_7c8f8c26e62c",
  "decision_path": "fast",
  "trust_score": 85,
  "risk_verdict": {
    "dimensions": {
      "intent_alignment":       {"score": 82, "label": "aligned",   "available": true, "evidence": ["..."]},
      "behavioral_conformance": {"score": 88, "label": "typical",   "available": true, "p_value": 0.81, "evidence": ["..."]},
      "blast_radius":           {"score": 100, "label": "contained", "available": true, "evidence": ["Read-only action class (-0)"]},
      "provenance_confidence":  {"score": 90, "label": "strong",    "available": true, "evidence": ["..."]}
    },
    "aggregate": {"trust_score": 85, "blended_score": 88, "renormalized": false, "source": "verdict"},
    "recommendation": "allow",
    "rationale": "...",
    "signature": {"algorithm": "hmac-sha256", "value": "9f2c…", "key_scope": "workspace"}
  },
  "reasoning": "No policies triggered - default allow",
  "policies_evaluated": ["policy_123", "policy_456"],
  "policies_triggered": [],
  "vault_entry_id": "ve_abc123",
  "latency_ms": 5,
  "created_at": "2026-03-13T21:48:54Z"
}

The risk_verdict is the signed multi-dimensional decision record — see Risk Verdict for the full schema, the conformal-calibration guarantee, signature verification, and the verdict policy type. trust_score remains the backwards-compatible scalar.