[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-output-validation::en":3,"gloss-cluster-output-validation::en":26,"gloss-next-output-validation::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"output-validation","prompt-eng","Output Validation","Output validation is the step that checks an LLM's response against explicit rules before your application acts on it — parsing the JSON, confirming required fields exist with the right types, enforcing enum and range constraints, and applying business rules — then retrying, repairing, or falling back when the check fails. Because models are non-deterministic and occasionally return malformed or invented data, treating raw output as trusted is a common source of production bugs. Validation is the safety net that turns \"usually works\" into \"safe to ship.\" For SaaS builders, the standard pattern is: generate with a schema, parse into a typed object (libraries like Zod, Pydantic, or JSON Schema validators), and on failure either re-prompt with the specific error (\"your last output was missing 'price'; return valid JSON\") or degrade gracefully. Validate meaning as well as shape — a syntactically valid but semantically wrong value (a negative price, an out-of-catalog SKU) should also be caught. Log validation failures; a rising rate is an early signal of prompt drift or a model change.","Output validation checks an LLM response against explicit rules — parse, required fields, types, ranges, business rules — before your app acts on it.",null,[11,14,17,20,23],{"slug":12,"name":13},"constrained-decoding","Constrained Decoding",{"slug":15,"name":16},"hallucination","Hallucination",{"slug":18,"name":19},"json-mode","JSON Mode",{"slug":21,"name":22},"schema-prompting","Schema Prompting",{"slug":24,"name":25},"structured-output","Structured Output",[27,31,34,37,41,44,47,48,51,54,57,60],{"slug":28,"category":5,"name":29,"updated_at":30},"analogical-prompting","Analogical Prompting","2026-08-24T02:46:37+00:00",{"slug":32,"category":5,"name":33,"updated_at":30},"automatic-prompt-optimization","Automatic Prompt Optimization",{"slug":35,"category":5,"name":36,"updated_at":30},"chain-of-density","Chain of Density (CoD)",{"slug":38,"category":5,"name":39,"updated_at":40},"chain-of-thought-prompting","Chain-of-Thought Prompting","2026-08-24T02:46:36+00:00",{"slug":42,"category":5,"name":43,"updated_at":30},"chain-of-verification","Chain-of-Verification",{"slug":45,"category":5,"name":46,"updated_at":40},"chunking","Chunking",{"slug":12,"category":5,"name":13,"updated_at":40},{"slug":49,"category":5,"name":50,"updated_at":40},"context-stuffing","Context Stuffing",{"slug":52,"category":5,"name":53,"updated_at":40},"delimiter","Delimiter",{"slug":55,"category":5,"name":56,"updated_at":30},"directional-stimulus-prompting","Directional Stimulus Prompting",{"slug":58,"category":5,"name":59,"updated_at":30},"emotion-prompting","Emotion Prompting",{"slug":61,"category":5,"name":62,"updated_at":40},"few-shot-prompting","Few-Shot Prompting"]