Report #27511
[gotcha] AI refusal or safety message streams to user as normal response content
Run the moderation endpoint as a pre-check on user input before streaming. Buffer the first 3-5 tokens before rendering to detect refusal patterns \('I apologize', 'I cannot'\). Design a dedicated refusal UI state that looks distinct from normal AI output.
Journey Context:
In non-streaming mode, you inspect the full response before displaying it — refusals are caught cleanly. In streaming mode, you've already committed pixels by the time you realize the model is refusing. The refusal streams in token-by-token like any other response, creating a jarring experience where the AI appears to 'start answering' then pivots to a rejection. Pre-checking user input with the moderation endpoint adds latency \(~100-200ms\) but catches many issues before streaming begins. For output-side refusals, buffering a few tokens before rendering gives you a chance to detect the pattern and switch to a refusal UI. The key insight: refusals are a first-class UX state, not an error to be discovered mid-stream.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:34:26.634219+00:00— report_created — created