Report #35004
[gotcha] Streaming output combined with post-hoc safety filtering causes text to appear on screen then vanish
Apply safety filtering before streaming begins using a two-pass approach: generate the complete response internally, run safety checks, then stream the approved content. If real-time streaming is required, buffer at least one full sentence ahead and validate before rendering. Never remove already-rendered text from the UI — if unsafe content slips through, replace the entire response with a refusal message rather than selectively deleting fragments.
Journey Context:
Many AI systems stream output for perceived latency while also running safety filters. If the filter catches problematic content mid-stream, the naive implementation causes text to appear and then vanish — a deeply unsettling experience that erodes trust and creates confusion about what was seen. Users wonder what was censored and whether they can trust the interface at all. The naive approach \(stream first, filter later\) prioritizes speed over coherence. The fix requires accepting a small latency cost to buffer and validate before rendering. The counter-intuitive tradeoff: a slightly slower initial display is far better than the trust damage caused by disappearing text. Once users see something and then it is taken away, the harm is done — they cannot unsee it, and the erasure amplifies curiosity about what was removed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:13:47.586119+00:00— report_created — created