Sanitization
Sanitization is the process of checking, modifying, removing, or normalizing data to meet relevant safety, privacy, consistency, or domain requirements before use or sharing.
Machine Learning Platform Engineering
Input sanitation is the validation, filtering, and normalization of externally supplied data before it is processed by a system.
- How it is used
- Screens public-facing LLM and RAG queries before model calls as the first layer of production safety guardrails.
- How deep it goes
- Shows validator installation and configuration, then a composed Guardrails AI input guard with distinct repair and rejection actions.
- Examples
- Uses email redaction and competitor-mention rejection, with a Guardrails AI listing that validates queries and returns sanitized output.
- What you can do after
- Apply it via Guardrails AI to configure input validators that repair specified PII or reject disallowed mentions before processing.
Read how Machine Learning Platform Engineering explains sanitization →
Shipping Go: Develop, deliver, discuss, design, and go again
Input sanitation is the processing of incoming values to make them uniform and acceptable before further handling.
- How it is used
- Hardens service boundaries by normalizing incoming values before translation or other handling.
- How deep it goes
- Demonstrates lowercase conversion, whitespace trimming, edge-case tests, and service-level validation before deferring handler coverage.
- Examples
- Tests capitalization, trailing whitespace, unsupported words, and unsupported languages in a Go translation service.
- What you can do after
- Apply it by normalizing service arguments and testing variations before accepting their downstream behavior.
Read how Shipping Go: Develop, deliver, discuss, design, and go again explains sanitization →
Generative AI in Action
Sanitization is the transformation or removal of unsafe content from input or output before it is processed or rendered.
- How it is used
- Reduces prompt-injection and insecure-output risks where model inputs or outputs interact with application capabilities.
- How deep it goes
- Identifies risks and safeguards, but does not specify a sanitization procedure or guarantee prevention.
- Examples
- Uses an embedded script-tag input and a report request that could generate SQL to drop a database table.
- What you can do after
- Apply it by validating input and output, using prepared statements, limiting database permissions, and auditing frequently.
Related concepts
- SMILESuses · SMILES is a textual notation standard that encodes molecular atoms, bonds, and connectivity using defined symbols and grammar rules.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


