Skip to main content
You have a verdict and need code that decides what the user sees. This is the reference handler every other guide builds on.

The four outcomes

Read overall_status from the nested result object on a completed job (the OpenAPI flattened fields are the same names). Poll until status is completed or done. Current Anchor responses use violations[] with quote, fix.suggested_text, and string confidence (high / medium / low). Treat high as auto-fix; escalate medium and low. If a response includes violations_by_line[].best_fix with a numeric confidence, compare it to 0.85. Tune from Activity: if humans approve almost every escalated fix, auto-apply medium as well; if they change auto-fixes often, require review even on high.

Handler

Call Enforce Content with mode: "sync". If the response reports mode: "async", poll Get Verdict until the job is terminal (see Long-Form Content).

Showing a reviewer why

Each violation includes a rule id (rule_id / signal_name) and the quoted text. Line-grouped responses add rules_violated[].rule_ref (for example FINRA 2210(d)(1)(B)). Surface the id, quote, severity, and confidence in your review UI.

Do not

  • Do not deliver the original text on Fix. The fix is the compliant version.
  • Do not retry a Block with the same content. Block means no compliant version exists.
  • Do not strip the disclosure a fix added to make the message shorter.
  • Do not fail open silently. If the API is unreachable, log it and apply your fail-open or fail-closed policy on purpose.
  • Do not poll only for done. Live jobs complete as completed.

Next

Enforce a Chatbot

Apply this handler on every chatbot reply before delivery.

Agent-to-Agent Traffic

Enforce each hop in a multi-agent workflow.

Export Activity

Tune your threshold from real verdicts.