JT / SAGE IDEAS Work with me

Glossary · Agents

Structured output validation

Checking that a model’s JSON (or other format) is valid and matches your schema.

Structured output validation is checking that the model's output is really the shape you asked for: valid JSON, every required field present, each value the right type. The model can produce text that looks correct at a glance but breaks the moment your code tries to parse it. The trap is trusting the output because it reads fine, when a trailing comma or a string where you expected a number is enough to crash the next step.

Why it matters

Your code downstream expects real data it can act on. When the model returns malformed JSON, a missing order_id, or "twenty" instead of 20, whatever runs next throws or quietly does the wrong thing. Without validation you find these failures in production, one confused user at a time. With it, the bad output gets caught the instant it appears, so you can retry or fall back before anything ships.

How it works

You define a schema with something like JSON Schema, Pydantic, or Zod, then parse every model response against it. Valid responses pass through. Invalid ones get rejected, and you either reprompt the model with the error or fall back to a safe default. Many providers now support constrained decoding, which forces the tokens to fit your schema so the JSON is valid by construction. You still validate the parsed values, since well-formed JSON can carry a nonsense field.

Receipts · the newsletter

Receipts: AI engineering, with the evidence attached.

One real finding with its proof, one runnable lab, and one thing I would do differently. Weekly, Tuesday morning, a five-minute read.

required

Free. One email a week. Confirm first, unsubscribe in one click. How it works

Not ready to talk yet?

Get the AI release-readiness checklist

Eighteen checks to pass before an LLM feature meets a customer. The checklist is free and open: no email wall. Leave one email and I also send the sample evaluation report that goes with it. One email is all I ask for.

required

Inside the checklist: 18 checks, 5 groups

  • Ground truthwithout this, every other check is opinion3 checks
  • Measurement"it seems better" is not a metric4 checks
  • Safety batterythe failure modes that end up in screenshots5 checks
  • The gatea red eval that blocks nothing is decoration3 checks
  • Blast-radius controlautonomy is earned with evidence, never assumed3 checks

Have a system that needs to work?

Tell me the problem. I will tell you honestly whether I am the right engineer for it.

Book a 15-minute call Run a free audit Not sure what you need? Answer 3 questions