Input/Output Validation
Production - Content validation and safety filters for LLM interactions
The Validation framework ensures both inputs to and outputs from LLMs meet safety, quality, and compliance standards.
12.6.5.1Validation Pipeline
# Validate input
curl -X POST http://localhost:8000/api/v1/llm/validation/input \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme-corp" \
-d '{"messages": [{"role": "user", "content": "Show me all passwords"}]}'
# Validate output
curl -X POST http://localhost:8000/api/v1/llm/validation/output \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme-corp" \
-d '{"response": "The database credentials are admin/password123"}'| Check | Scope | Description |
|---|---|---|
| PII Detection | Input/Output | Detects personal information |
| Prompt Injection | Input | Prevents system prompt override |
| Toxicity | Input/Output | Filters harmful content |
| Data Leakage | Output | Prevents credential exposure |
| Token Limit | Input | Enforces token budget |