llm_output_validator
Validate an LLM response against QA criteria: format checks (JSON, code, markdown), content rules (must-include, must-not-include), length constraints, language detection, and safety patterns. Essential for QA testing LLM-powered features.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | The LLM output text to validate | |
| max_length | No | Maximum character length for the output | |
| min_length | No | Minimum character length for the output | |
| check_safety | No | Check for PII patterns (emails, phones, SSN), profanity signals, and prompt leakage | |
| must_include | No | Comma-separated strings that MUST appear in the output | |
| expected_format | No | Expected output format | |
| must_not_include | No | Comma-separated strings that must NOT appear (e.g. "TODO, FIXME, undefined, NaN") | |
| check_json_schema | No | If expected_format is JSON, provide required keys as comma-separated list to validate the structure | |
| expected_language | No | Expected language of the output (en, fr, es, de…). Checks for common words. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | No | ||
| checks | No | ||
| failed | No | ||
| passed | No | ||
| verdict | No |