LLMs, GenAI, RAG, agents, evaluation · insight-0527
Validate business rules after the schema passes, because schemas only check shape
- Evidence type
- practitioner heuristic
- Difficulty
- easy
- Roles
- Applied AI, ML engineer
- Industries
- aviation, finance
Summary: situation, action, reason, boundary
Situation
A structured-output extractor for refund requests returns perfectly valid objects, and the team stops checking them.
Action
After schema parsing, run code-level checks for ranges, cross-field consistency, allow-listed codes and agreement with the source text; route failures to repair or human review and count them per field.
Reason
Schema enforcement guarantees types and required keys; some providers do not even enforce numeric or string-length constraints, so value-level rules must live in your own code.
Boundary
Any structured output that triggers money, bookings or customer communication.
Symptom or risk
Objects contain negative amounts, return dates before departure, airport codes that do not exist or a currency that contradicts the email, and they flow straight into the refund system.
Exceptions
Low-stakes internal tagging can tolerate sampling-based spot checks instead.
Trade-offs
Rules need maintenance as business policy changes.
Pitfalls
Encoding business rules only as schema keywords that the provider silently ignores or rejects.
Lessons and concepts
Claims and their sources
Anthropic's structured-outputs documentation lists numeric constraints such as minimum and maximum and string-length constraints among unsupported schema features.