Input sanitization
Also called Input Sanitization
Cleaning and checking whatever comes into the model before it gets to act on it.
Think of it like
Airport security screening bags before they ever reach the plane.
Example
Before user text is fed to an agent, the system strips hidden instructions embedded in a pasted web page to blunt a prompt-injection attempt.
How it actually works
Sanitization covers stripping or escaping dangerous content, redacting PII, and screening for policy violations at the front door. For LLMs the hard part is that natural language has no clean parser, so "malicious input" is fuzzy and injection can hide in ordinary-looking text. It is one necessary layer, never the whole defense.
For product teams
The front-door check — cheap, essential, and never sufficient on its own.
For engineers
Filter, escape, and redact untrusted input pre-inference; note that unlike SQL there is no reliable grammar to sanitize against injection.
Related
- Output sanitization — The output-side counterpart is output sanitization.
- Prompt injection — A primary line against prompt injection.
- PII detection — Often includes PII detection.
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