Response Validator Agent
The Response Validator agent validates generated responses against configurable quality and compliance criteria. It evaluates a response and returns a pass/fail judgment with specific issues identified when validation fails. Use this agent as a quality gate in any workflow where AI-generated content must meet defined standards before reaching the end user.
Use Cases
- You need automated quality checks on AI-generated responses before they reach the user.
- Compliance rules require that responses meet specific criteria (no PII, no unauthorized claims, appropriate tone).
- You want to gate responses and route failures to human review or a retry loop.
- You want to validate that action calling results or search-grounded responses meet accuracy and formatting standards before delivery.
Inputs
| Input | Type | Description |
|---|---|---|
response | Text | The response to validate. |
query | Text | (Optional) The original query, for relevance checking. |
search_results | SearchResults | (Optional) The source material, for grounding checks. |
Outputs
| Output | Type | Description |
|---|---|---|
is_valid | Boolean | Whether the response passed all validation criteria. |
issues | Text | Description of any validation failures. Empty if valid. |
Configurations
| Parameter | Description | Default |
|---|---|---|
criteria | List of validation criteria. Each criterion has a name, description, and severity. | Required |
instructions | Additional validation instructions. | None |
Defining Validation Criteria
Each criterion is defined in natural language with a name and description. Common validation patterns include:
- Grounding -- "The response must be supported by the provided search results. Do not include claims that are not backed by a source."
- Tone and brand compliance -- "The response must use a professional, empathetic tone. Avoid jargon or overly casual language."
- PII protection -- "The response must not include personal identifiable information such as email addresses, phone numbers, or account numbers."
- Relevance -- "The response must directly address the user's query. Flag responses that go off-topic or provide unrequested information."
- Completeness -- "The response must fully answer the question. If partial information is available, the response should acknowledge what is missing."
Quality Gating Patterns
The Response Validator is typically used as a quality gate between a response agent and the workflow output. When validation fails, you can:
- Route to human review -- Send invalid responses to a human reviewer via the Human Collaboration agent.
- Abstain from answering -- Suppress the response entirely using the Abstain from Answering agent and return a safe fallback message.
- Branch on severity -- Use the
is_validoutput as a condition to branch the workflow: valid responses proceed to output, while invalid responses take an alternate path.
How to Use This Agent
Quality gate with human fallback:
chat_trigger -> knowledge_search -> respond_using_search_results -> response_validator
-> [valid] -> workflow_output
-> [invalid] -> human_collaboration -> workflow_output
Validate action calling results before delivery:
chat_trigger -> intelligent_actions -> respond_using_action_calling_results -> response_validator
-> [valid] -> workflow_output
-> [invalid] -> abstain_from_answering -> workflow_output
Related Agents
- Rule Validation -- validates documents or data against rule sets (not specifically responses).
- Abstain from Answering -- for suppressing responses entirely.
- Human Collaboration -- for routing failed validations to human review.
- Respond using Search Results -- a common upstream agent whose output benefits from validation.
- Respond using Action Calling Results -- validate action summaries before they reach the user.