WRITING / TECHNICAL

Zod In, Zod Out: Every Agent Step Is a Typed Capsule

Every agent step as a typed capsule: a Zod schema in, a Zod schema out, and a stated failure mode for when the model does not comply.

The unit of work in an agent pipeline is not JSON.parse(llmReply) —it is a typed capsule : a named step with a Zod schema on the way in, a Zod schema on the way out, and a documented failure mode when the model refuses to comply.

Published November 29, 2025. Reading time: 8 min read. Author: Morgan Wilson.

Next