Zod

tool · updated Jun 10, 2026

Zod is a TypeScript-first schema declaration and validation library used at runtime boundaries to parse and validate structured data.

Usage in agent engineering

In the context of building agentic software systems, Zod is referenced as a tool for enforcing type safety at the edges of a system — specifically where unstructured or external input enters a typed codebase. Ryan Lopopolo of OpenAI describes using it as part of a "parse don't validate" pattern at system boundaries, where types are derived from Zod schemas rather than maintained separately: "we parse don't validate at the edge and you certainly have a type here which was derived from zot" 25:02.

This approach — treating the Zod schema as the single source of truth from which TypeScript types are inferred — is particularly relevant in agent pipelines where LLM outputs, tool call results, and external API responses must be safely ingested and typed before being acted upon by downstream agent logic.