OnFailAction controls how a Guardrails AI validator responds when content violates its criteria. Choose the response according to risk and whether the content can be safely corrected. section 13.3.1
Available strategies include:
- EXCEPTION or REFRAIN blocks processing for high-risk content. section 13.3.1
- FIX or FILTER sanitizes content and continues validation. section 13.3.1
- REASK or FIX_REASK requests regenerated content when improvement is possible. section 13.3.1
- NOOP logs the failure without intervening. section 13.3.1
Risk-based input validation
Configure CompetitorCheck with OnFailAction.EXCEPTION to stop competitor discussions, and GuardrailsPII with OnFailAction.FIX to redact email addresses, credit cards, or SSNs before processing continues.
