technical-term · Harness & runtime · practitioner · Reviewed

Loop engineering

The practice of improving the complete perceive–decide–act–observe cycle around a model rather than optimizing prompts in isolation.

Definition

Loop engineering designs context construction, tool contracts, state, environment feedback, validations, retries, memory updates, budgets, and terminal dispositions as one measurable runtime system. It is a useful practitioner label for a subset of harness engineering centered on the repeated decision cycle.

The underlying runtime practices are established; “loop engineering” remains an emerging practitioner label.

Why it matters

A stronger model increases leverage on the loop it inhabits; it does not repair a weak environment, ambiguous state, or missing feedback by itself.

Changes should be evaluated at the outcome and trajectory level.

System anatomy

Context cycle
Select the right evidence for each step.
Action cycle
Propose, validate, execute, and observe tools.
Learning cycle
Turn failures and corrections into evals or governed memory.
Termination cycle
Finish, correct, hold, escalate, or stop.

Important distinctions

Prompt engineering
Prompt engineering shapes one model interaction; loop engineering shapes repeated interactions and their environment.
Harness engineering
Loop engineering focuses on the runtime cycle; harness engineering also covers repository, workspace, delivery, and organizational feedback surfaces.

Implementation signals

  • Improve the bottleneck exposed by traces and evals
  • Require state change or new evidence before retries
  • Keep terminal decisions finite and inspectable

Failure modes

  • The loop produces more tokens without better outcomes
  • Self-critique is mistaken for independent acceptance

Sources and further study

  1. Peter Yang — 5 Rules for Building AI Agents That Work in Production | Nan Yu & Jacob Shumway

    A Linear engineering discussion of production agents, tool design, context loading, feedback, evaluation, and simple model-in-a-loop explanations.

    Use in this library: Practitioner perspective. The five rules and “LLM in a loop plus tools” shorthand reflect one product team’s experience; they are not a standard or a complete enterprise-agent definition.

    video · video · Published 2026-08-09
  2. AI Engineer — Harness Engineering: How to Build Software When Humans Steer, Agents Execute — Ryan Lopopolo, OpenAI

    A conference presentation about engineering repositories, feedback loops, tools, and constraints around coding agents.

    Use in this library: Practitioner perspective. The talk reports a first-party approach and should be paired with the cited OpenAI engineering article; it is not a universal method or independent assurance evidence.

    video · video · Published 2026-04-16
  3. OpenAI — Harness engineering: leveraging Codex in an agent-first world

    A production case study in designing repositories, tools, feedback loops, and environments for agent-first delivery.

    Use in this library: First-party case study. This first-party account documents one organization, product, or implementation context and should not be generalized without local evidence.

    engineering · engineering · Published 2026-02-11
  4. Anthropic — Harness design for long-running application development

    A planner, generator, and evaluator architecture for multi-hour autonomous application development.

    Use in this library: First-party case study. This first-party account documents one organization, product, or implementation context and should not be generalized without local evidence.

    engineering · engineering · Published 2026-03-24