Personal data is information that can identify, or be used to identify, an individual. In production LLM systems, detect it in incoming prompts and sanitize it before processing. section 13.3.1
Implement personal-data protection as an input guard:
- Configure a Guardrails AI guard with the GuardrailsPII validator. section 13.3.1
- Check entities such as email addresses, credit-card numbers, and Social Security numbers. section 13.3.1
- Fix detected values by redacting them, or reject invalid input and log the validation failure. section 13.3.1
Sanitizing an LLM prompt
A validation function runs input_guard.validate(user_input) before the prompt reaches the LLM, then returns validated_output. Detected email addresses can be replaced with a placeholder. section 13.3.1
Figure 13.9 PII detection example showing email address being automatically redacted to the placeholder
Shows an email address automatically redacted during PII detection. section 13.3.1








