Gary Bernhardt's observation that developers are too fixated on LLM models rather than the control layer above them is used as a springboard to outline four engineering patterns for production-grade AI agents: (1) deterministic state machines that constrain the model to bounded tasks, (2) placing the model behind a typed Protocol boundary to make it swappable and testable, (3) a generator-evaluator split with guardrails between model output and user output, and (4) structured generation using Pydantic to enforce typed outputs. The core argument is that the control layer — routing, validation, state management, audit trails — is where the real product engineering happens, not in model selection.

6m read timeFrom belderbos.dev
Post cover image
Table of contents
Why "agent" and "harness" sell it shortPattern 1: deterministic state machines, not unconstrained agentsPattern 2: the model behind a typed boundaryPattern 3: evaluators and guardrailsPattern 4: structured generation
435 Impressions