/v1/outbound/validateOutbound Validation
Check LLM outputs against cited clinical safety rules and stop unsafe answers before they reach patients.
<50ms latency
Deterministic, cited rules
Description
This endpoint checks LLM-generated clinical text in two deterministic stages. The same input always gives the same result, and every flag names its cause.
- Risk classifier: pattern detectors tag doses, diagnostic statements, contraindications, drug names and clinical recommendations, and assign a risk tier (low, medium or high).
- Clinical rules engine: the drugs and doses found are checked against a versioned rulebook of cited safety rules (dose limits, drug interactions, high-risk medicines). Each rule returns pass, flag or block.
The verdict and tier map to a fixed confidence_score: 0.94 (low risk), 0.82 (medium), 0.64 (high risk or flagged rule), 0.40 (blocked rule). If the score is below 0.8, the API returns a flagged status with a route_to_human action. Your application decides how to route the case to a clinician.
Critical Safety Note
When action is route_to_human, your application must not display the LLM output to the patient. Route to a qualified clinician for manual review.
Request body
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
llm_output | string | Required | The raw text output from OpenAI/Anthropic that needs clinical validation. |
clinical_threshold | float | Optional | Confidence threshold for flagging. Defaults to 0.8. |
Response
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
status | string | Required | Either "passed" or "flagged". Flagged responses should not be shown to patients. |
confidence_score | number | Required | Fixed score from the verdict and risk tier: 0.94, 0.82, 0.64 or 0.40. Scores below the threshold are flagged. |
action | string | Required | Recommended action: "none" for passed, "route_to_human" for flagged. |
reason | string | Required | Why it was flagged: the fired rule ID (for example dose.paracetamol.daily.adult) or the risk signal (for example DOSAGE). "none" when passed. |
curl -X POST \
https://api.enorai.com/v1/outbound/validate \
-H "Authorization: Bearer $ENORAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"llm_output": "Recommend 500mg Amoxicillin TID for 14 days.",
"clinical_threshold": 0.8
}'{
"status": "flagged",
"confidence_score": 0.64,
"action": "route_to_human",
"reason": "DOSAGE"
}{
"status": "passed",
"confidence_score": 0.94,
"action": "none",
"reason": "none"
}