Large language models write answers word by word and stream them to users as they are produced. A check that runs only after the answer is finished cannot stop harmful text already shown; a separate checker adds cost and delay.
PGuard instead reads signals inside the generating model. A small add-on learns which internal layers carry safety clues and combines them, judging each point alone or tracking risk across a response. It plugs into serving software without changing output.
Across safety tests it approached dedicated external checkers and beat earlier built-in ones, flagging risk before generation ended. On one model it reached average F1 of 0.836, a combined score balancing misses and false alarms, with small added serving cost.
