A validator evaluates content against defined criteria before or after LLM processing. In production safety guardrails, it can reject unsafe input, redact sensitive data, remove prohibited output, or allow compliant content. section 13.3.1
Production validators commonly handle:
- Input screening for malicious content, PII, and policy violations before expensive LLM processing. section 13.3.1
- Output checking for prohibited competitor mentions, with a fix action that removes flagged sentences. section 13.3.1
- Failure strategies selected by violation type, including exceptions for blocked input and fixes for detectable PII. section 13.3.1
Guardrails input validation
A Guardrails AI input guard combines a competitor check configured with an exception action and a PII validator configured to fix email addresses, credit cards, and SSNs. Calling validate returns sanitized output when successful; failures are logged and raised for handling.

