Guardrails Validation
Definition
Guardrails Validation is a set of software checks applied to LLM output before it is returned to the user. Validation ensures that the response conforms to the expected format, lacks prohibited content, and is factually correct.
Levels of Validation
| Level | Check | Tools |
|---|---|---|
| Format | JSON schema, data types | Structured Output |
| Content | Toxicity, PII, prohibited topics | Classifiers |
| Facts | Verification against sources | Source Attribution |
| Business Rules | Limits, policies | Custom Rules |
Validation Pipeline
graph LR
A[LLM Output] --> B{Format}
B -- Error --> C[Re-generation]
B -- OK --> D{Content}
D -- Error --> E[Filtering]
D -- OK --> F{Facts}
F -- OK --> G[Response to user]