Skip to main content
Your chatbot or virtual assistant generates replies with an LLM and sends them to customers. Check every reply against regulations and your policies, then fix or block it, before it leaves your server.

Prerequisites

  • An API key (Quickstart, Step 1).
  • Optional: rule packs activated in Policy. Note their ids from GET /api/rulepacks/ if you want to narrow validation_scope.

The pattern

One call per reply, in the response path, after generation and before delivery. Build on the Act on Each Verdict handler. Omit document_category. The public API has no support-chat scenario today, so requests use the default scenario_email_general.

Code

To poll instead of returning the fallback when sync falls back to async, use the flow in Long-Form Content.

What the customer sees

Gotchas

  • Sync can fall back to async. Check mode in 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 under result. 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.