The max_tokens case bites hardest on long line-item arrays, since the cut-off lands mid-array and a lenient JSON repair step will happily close the brackets and hand you half an invoice. Checking that the line items sum to the stated total catches that one and the hallucinated-amount case in the same pass.
'LLM output is still user input' is the line I'd pin above every schema file. Anyone who has handled form submissions knows the same rule: a submission that matches every field type can still be junk, so the check that matters runs against your own data. The stop_reason point surprised me most, since a refusal returning 200 looks like success in most logs. Do you track refusals separately so they show up in the drift chart too?
a schema-valid employee id that doesn't actually exist is exactly the bug that bit us. do you check against the db right after parsing?
The max_tokens case bites hardest on long line-item arrays, since the cut-off lands mid-array and a lenient JSON repair step will happily close the brackets and hand you half an invoice. Checking that the line items sum to the stated total catches that one and the hallucinated-amount case in the same pass.
'LLM output is still user input' is the line I'd pin above every schema file. Anyone who has handled form submissions knows the same rule: a submission that matches every field type can still be junk, so the check that matters runs against your own data. The stop_reason point surprised me most, since a refusal returning 200 looks like success in most logs. Do you track refusals separately so they show up in the drift chart too?