Output sanitization
Also called Output Sanitization
Checking and cleaning what the model produces before it reaches a user or another system.
Think of it like
A copy editor who reads every page before it goes to print, catching anything that should not ship.
Example
A model’s reply is scanned and stripped of a leaked API key it accidentally regurgitated before the response is shown.
How it actually works
Outputs get screened for policy violations, injected markup or scripts, leaked secrets, and PII before they hit the user or a downstream tool. It matters doubly when model output is executed or rendered, since that is where an injection turns into real code execution. Pairs with input sanitization to guard both ends.
For product teams
The last checkpoint before a bad answer becomes a real-world action.
For engineers
Validate and escape model output before rendering or execution; treat generated text as untrusted, especially when it feeds tools or a browser.
Related
- Input sanitization — The input-side counterpart is input sanitization.
- Prompt injection — Critical for containing prompt injection consequences.
Read anything AI without the jargon
Look up any term in plain English, or save terms as you read with the free Chrome extension.
Open DecoderAdd to Chrome