Why is my agent's output failing the schema it declared?

Most schema failures aren’t garbled output, they’re output that reads fine but doesn’t match the shape you asked for: a field left out, a number returned as a string, an extra key nobody asked for, or the whole object wrapped in a sentence of prose instead of returned raw. That kind of drift is far more common than output that fails to parse at all.

The rest usually comes from length and formatting pressure: a response truncated mid-object, a trailing comma, or markdown fences left around what should be raw JSON. None of it breaks the underlying reasoning, it breaks the contract between what came back and what your code expects to receive.

That gap, between an answer that’s fine and an answer that matches the schema, is exactly what a deterministic validation check is built to catch: not whether the response is good, only whether it matches the shape you declared.

keep reading

More on this.

Send us the traces you already emit.