What is loop engineering? A practical guide for AI teams
Loop engineering is the practice of designing the system that prompts, checks, and improves an agent in a loop. Here is where it fits and what to build first.

TL;DR
Loop engineering means designing the system that finds work, prompts the agent, checks the result, stores state, and decides what happens next. It sits above one-off prompting and helps teams turn agent demos into repeatable workflows.
If you keep hearing the phrase "loop engineering" and it sounds half useful and half vague, the cleanest definition is this: loop engineering is the practice of designing the system that prompts, checks, and improves an agent over repeated runs.
In other words, you stop acting like the person manually driving every turn. Instead, you design the workflow that finds work, gives the agent context, evaluates what came back, stores state outside the conversation, and decides what happens next.
That is why the phrase matters. It points at a real shift in how serious teams are starting to work with agents. The bottleneck is moving away from writing one clever prompt and toward building a repeatable loop around the model.
The label is new, but the operating model is not. Anthropic's official guide to building effective agents defines agents as systems that use tools in a loop and calls out evaluator-optimizer workflows directly. OpenAI's practical guide to building agents says the concept of a run is typically implemented as a loop, and its May 12, 2026 agent improvement loop notebook shows traces, feedback, evals, and Codex handoffs turning into concrete harness changes.
That is the core answer. Loop engineering is not mystical. It is operational.
What loop engineering actually is
A good loop has a few simple jobs.
It has to find or receive work. It has to decide what context the agent gets. It has to let the agent act. It has to check whether the output was good enough. It has to keep durable state somewhere outside the single chat. Then it has to either stop, escalate, or run again.
That sounds obvious, but it is a different job from classic prompt engineering.
Prompt engineering mostly asks: how do I get a better answer from this model right now?
Loop engineering asks: how do I build a system that keeps getting useful answers over time without me manually steering every step?
That is why Addy Osmani's June 2026 essay on loop engineering resonated so fast. It gave people a simple phrase for a change they were already starting to feel in coding-agent workflows: the work is shifting from typing better prompts toward designing better loops.
Why this is showing up now
Three things changed at once.
1. Agents got good enough to justify real operating systems
Once an agent can reason, use tools, and recover from small failures, the next problem is no longer whether it can do something impressive once.
The next problem is whether it can do the job repeatedly without becoming noisy, expensive, or untrustworthy.
That is a loop problem.
It is the same reason I wrote that agent debt is already here. When you add more memory, tools, approvals, and automations, the system gets harder to trust unless the loop around it is deliberate.
2. Official guidance is converging on loops, evals, and feedback
The current public conversation makes the term feel new, but the serious platforms have been moving this way for a while.
Anthropic's agent guide frames agents as tools operating in a loop and calls evaluator-optimizer patterns a first-class workflow. OpenAI's guide says a single-agent run is usually implemented as a loop until an exit condition is reached, and it explicitly recommends using evals to establish the performance baseline. The OpenAI improvement-loop notebook goes one step further and shows a real flywheel: traces show what happened, feedback explains what mattered, evals preserve the lesson, and Codex can implement the next harness change.
That is not surface-level prompt advice. It is a system design story.
3. The market finally found sharper language for the same bottleneck
Between June 22 and June 24, X started repeating a tighter version of the same idea. The sharpest phrasing was that the winners will not have the smartest model, they will have the best loop around it. That matters because market language often becomes search language a few weeks later.
So even if the phrase is still early, the intent behind it is already real.
Loop engineering vs prompt engineering vs harness engineering
These terms overlap, but they are not identical.
Prompt engineering is about shaping a better instruction or interaction.
Harness engineering is about the environment around one agent: permissions, tools, context handling, memory boundaries, approvals, verification, and observability. I wrote more about that in Harness engineering is becoming the real moat in agent systems.
Loop engineering sits one layer above the one-off prompt and slightly above the single-agent harness.
It is the repeated operating cycle.
It covers questions like:
- how work enters the system
- how the agent decides the next step
- what gets stored between runs
- which evaluator or reviewer checks the output
- when the system loops again versus hands off to a human
- how the team turns failures into the next improvement
That is also why loop engineering connects naturally to If your AI team ships without evals, you are still demoing. Evals are often the release gate inside the loop, not the whole loop itself.
What a good loop includes
If I were reviewing a real loop this week, I would look for six things.
1. A clear trigger
What starts the run?
A scheduled automation, an inbound ticket, a user action, a CI event, or a manual kickoff are all fine. What matters is that the trigger is explicit.
2. Tight context boundaries
A lot of weak loops fail because they throw too much context at the agent and call that flexibility.
Good loops are pickier. They decide what the agent needs right now, what belongs in durable memory, and what should expire after the run.
3. A verifier that is separate from the generator
This is one of the highest-leverage moves in agent systems.
The same agent that generated the output should not be the only thing grading it. Anthropic's evaluator-optimizer workflow and OpenAI's improvement-loop notebook both point in this direction. The generator makes the artifact. A separate evaluator, test, or human gate decides whether it is good enough.
4. State that lives outside the chat
The loop has to remember something on disk, in a board, in a repo file, or in a durable system record.
Otherwise every run starts too cold and the workflow never really compounds.
This is also where my own operator workflows changed the most. In the systems I build for this site and for product work, the useful state is almost never the chat transcript alone. It is the repo, the task file, the spec, the eval history, and the persistent notes around the run.
5. Stop conditions
A loop without a stop condition is not automation maturity. It is a cost leak.
Define what done means. Define when the system should ask for help. Define how many attempts it gets before it stops.
6. A learning path from failure to improvement
This is the part a lot of teams skip.
If the loop fails, where does that lesson go? Does it become a better instruction, a better eval, a better routing rule, a better tool contract, or a better approval gate?
If the answer is nowhere, the loop is not compounding yet.
Interactive
Loop engineering review
Use this before you trust an agent workflow to run repeatedly on its own.
Completion
This is the gap between understanding the article and actually using it.
- Use this block as the practical summary, not just the article ending.
- If one item feels vague, the article probably needs sharper guidance.
- A short checklist beats a long recap when the reader needs to act.
Where teams usually get it wrong
The first mistake is treating loop engineering like a synonym for better prompting.
Better prompts help. They are just not the whole job.
The second mistake is building a loop with no independent check. That creates faster output, but not more trustworthy output.
The third mistake is storing too much fuzzy memory and too little structured state. The system gets more fluent while the workflow gets less legible.
The fourth mistake is skipping the boring operational questions around permissions, approvals, and cost ceilings. That is usually where the trust breaks.
And the fifth mistake is assuming protocol support alone solves the real workflow problem. MCP matters, but a callable interface is not the same thing as a good loop. That is one reason the protocol story in MCP is becoming the distribution layer for the agent economy only gets more valuable when the operating loop around it is well designed.
Where I think loop engineering matters most
Coding agents are the obvious example, but I do not think this stays a coding story.
It matters anywhere a workflow has repeated judgment, repeated state, and repeated verification.
That includes product research, QA, content operations, support triage, SEO audits, customer follow-up, and internal reporting.
I feel this directly in my own work. When I use Claude Code to build products as a PM, the leverage does not come from a single impressive turn. It comes from the loop around the turn: scoped work, durable notes, clear instructions, tool access, review gates, and a concrete next action when something fails.
That same pattern now shows up in editorial workflows too. The draft is not the full product. The signal collection, scoring, spec, materialization, publish gate, build, and deploy checks are the real loop.
That is why I think the phrase will stick even if the exact label evolves.
The more agents become normal operators inside teams, the more valuable the loop becomes.
My broader take
Loop engineering is useful because it gives teams a better unit of design.
Instead of obsessing over a single prompt or a single output, you design the repeated system that creates, checks, and improves outputs over time.
That is a healthier way to think about agents.
It pushes the conversation away from demos and toward operations. It forces teams to care about triggers, memory, evals, approvals, and stop conditions. And it gives product and engineering teams a cleaner mental model for what actually compounds.
If prompt engineering was the skill for getting a good turn, loop engineering is the skill for getting a good workflow.
FAQ
What is loop engineering in plain English?
Loop engineering is designing the repeated workflow around an agent so the system can find work, act, check itself, store state, and improve without a human manually steering every turn.
How is loop engineering different from prompt engineering?
Prompt engineering focuses on a better instruction for one interaction. Loop engineering focuses on the full repeated cycle around the interaction, including triggers, memory, evaluation, and stopping rules.
Is loop engineering the same thing as harness engineering?
Not exactly. Harness engineering is the environment around one agent. Loop engineering is the repeated operating cycle that uses that harness and decides what happens across runs.
Why is loop engineering suddenly showing up now?
Because coding-agent workflows made the pattern visible, and because official Anthropic and OpenAI guidance already describes agents, runs, and evaluation patterns in loop-shaped terms.
What is the first thing a team should build?
Start with one narrow workflow, one explicit trigger, one evaluator or gate, one durable state file or system record, and one clear stop condition. Then turn repeated failures into better evals or harness rules.