Skip to content

PATTERN Cited by 1 source

Harness holds structure, agent holds reasoning

Pattern

In a production AI agent system, explicitly separate responsibilities between the harness (deterministic infrastructure) and the agent (LLM reasoning loop):

  • Harness owns: persistence, output structure, evidence discipline, tool catalog composition, session continuity, team-profile resolution
  • Agent owns: choosing what to look at, weighing evidence, deciding when to fan out vs. stop, formulating explanations

The harness provides reliability guarantees that must hold across thousands of executions. The agent provides adaptive reasoning that can follow unexpected evidence paths.

Why this separation

Instacart initially used a "more workflow-shaped agent hierarchy, which was predictable but made it hard for the system to choose what to do next when an alert did not match the expected path." Moving to a dynamic agent loop with harness-level constraints preserved reliability while gaining flexibility.

"The model is best at choosing what to look at, weighing evidence, and deciding when an investigation is done. The harness is best at the parts that have to stay stable across thousands of diagnostic passes like capturing reasoning, keeping output predictable, and enforcing the discipline that makes the synthesis trustworthy." (Source: sources/2026-07-14-instacart-blueberry-on-call-reasoning-harness)

Anti-pattern

Putting structural constraints inside the agent prompt (e.g., "always output in this format") — these degrade under prompt pressure and are unenforceable at scale. Better to enforce at the harness level with deterministic post-processing.

Seen in

Last updated · 585 distilled / 1,765 read