Prerequisites
- An API key (Quickstart, Step 1).
- Optional: rule packs activated in Policy. Note their ids from
GET /api/rulepacks/if you want to narrowvalidation_scope.
The pattern
document_category. The public API has no support-chat scenario today, so requests use the default scenario_email_general.
Code
What the customer sees
Gotchas
- Sync can fall back to async. Check
modein every response. For long answers, use the async flow in Long-Form Content. - Fail open or fail closed. Set a client timeout. If ZeroDrift is unreachable, decide once whether your bot fails open (send the reply) or fails closed (send the fallback). Regulated deployments fail closed.
- Streaming. Enforce the complete reply, then stream it. Do not stream tokens to the customer before the verdict.
- Latency. ZeroDrift does not publish sync p50/p95 figures. Measure latency in your own environment for the reply lengths you serve.
- Completed envelope. Live jobs finish as
status: "completed"with the verdict underresult. See Act on Each Verdict.
Next
Act on Each Verdict
Thresholds, logging, and a human review queue.
Per-Tenant Rulepacks
Different rules per customer when one bot serves many tenants.

