Report #47922
[synthesis] Agent outputs valid JSON that passes basic parsing but fails downstream due to subtle type or structure shifts
Enforce strict Pydantic model validation with strict=True on all LLM JSON outputs, and monitor the frequency of ValidationError catches. Do not rely on response\_format=\{ type: json\_object \} alone.
Journey Context:
LLMs can output valid JSON that subtly drifts from the intended schema—e.g., returning a string 'null' instead of a JSON null, or an array of objects instead of a single object. Native JSON mode guarantees valid JSON, but not valid schema. Downstream code expecting a specific type might crash or silently misinterpret the data \(e.g., iterating over a string instead of a list\). This degradation happens as models update or context shifts. Strict programmatic validation is the only reliable catch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:54:56.491071+00:00— report_created — created