Output validation
Also known as: response validation, AI output checking, post-generation validation
Because LLMs are non-deterministic and can hallucinate, a naive pipeline that takes model output at face value and passes it directly to users or downstream systems is a reliability risk. Output validation is the set of checks that sit between model and action.
Deterministic checks cover structure: is this valid JSON, does it include required fields, is the length within range? These are fast and cheap. Semantic checks cover quality and appropriateness: is the answer factually grounded, does it stay on topic, is the tone correct? These typically use an LLM-as-judge approach or a fine-tuned classifier.
For agentic systems, where the model's output might trigger tool calls, API requests, or code execution, output validation becomes a safety layer. A malformed tool call or a confidently wrong intermediate result can cascade into hard-to-debug failures. Building validation into the agent loop, not just at the final output stage, is a practice increasingly common in production deployments.