agent-structured-output
Covers how to get reliable machine-readable output from AI agents — separate the thinking turn from the formatting turn, keep schemas flat and bounded, offload substantive content to files and return a small manifest, inject orchestrator-owned fields after parsing, and validate the manifest and the referenced files at the boundary. Includes schema design do/don't lists, prompting rules, the failure model, layered extraction, and one bounded repair turn. Use when an agent's JSON response drives workflow state, when designing a response schema or JSON Schema/Zod contract for an agent, when structured output keeps failing validation, or when deciding what belongs in JSON versus in a generated file.
Pinned to revision 2b717166afc3, so it is the text this page describes rather than whatever the author pushed since.
Files
Every link opens the file at its source, pinned to the revision this page describes.