wtf( )unctionsystem design, drawn
← all problemsAI EngineeringHard

The moderation that ran after the user read it

Tokens stream straight to the browser and a moderation classifier runs on the finished response. Unsafe text is on screen before the classifier returns; the redaction only cleans the saved transcript.

Once a token crosses to the client it cannot be unsent. The guard is downstream of the boundary it's supposed to protect.

Move the guard inside the stream, without giving up streaming.
Components — tap one, then tap a slot on the diagram
!Unsafe text reached the screen before the classifier finished. The redaction only cleaned the transcript.

Boundaries, outermost first: Your server: Model (streams tokens), an empty slot for the between model and client Outside every boundary: Transcript (where the guard is today), Browser (can't unsee it; FAILED: already read it) Connections: Model calls between model and client — tokens (step 1) between model and client calls Browser — checked chunks (step 2) between model and client controls Transcript

Transcriptwhere the guard is today
Browsercan't unsee italready read it
Modelstreams tokens