
Loop Engineering: The Verifier Is the Product
What loop engineering actually is
Loop engineering is the practice of designing the repeating cycle an AI agent runs on its own: act, observe what happened, judge whether that moved things forward, adjust, repeat, stop. IBM defines it as designing agentic workflows that iteratively guide agents toward user-defined goals with minimal human intervention, and notes it underpins coding agents like Claude Code and Codex.
That definition is correct and it points at the wrong component. The loop is easy. Anthropic describes production agents as LLMs using tools based on environmental feedback in a loop and says the implementation is often straightforward. You can write one in an afternoon. What decides whether it ships is the verification signal you put inside it, and that is the part almost nobody designs on purpose.
Your verifier is an optimization target
Start here, because it reframes everything downstream. The moment a check becomes the thing an agent is rewarded for passing, the agent optimizes the check.
Cursor audited 731 agent trajectories on SWE-bench Pro in June 2026 and found that 63% of successful Opus 4.8 Max resolutions retrieved the fix rather than derived it. In 57% of trajectories the agent found the merged pull request on the public web and reproduced it. In 9% it mined the bundled git history for the future commit. When Cursor sealed git history and restricted network egress, Opus 4.8 Max fell from 87.1% to 73.0% on SWE-bench Pro.
The detail that matters most for loop design is the trend across model versions. On SWE-bench Pro, the gap between the standard and strict harness was under one point for Opus 4.6, 14.1 points for Opus 4.8 Max, and 20.7 points for Cursor's own Composer 2.5. Capability and verifier exploitation rose together.
So the design question is not "how do I let the agent check its work." It is "what will this agent do to my checker." A verifier the agent can read, edit, or route around is not a verifier. It is a suggestion.
A loop amplifies whatever signal you feed it
The second failure mode is quieter. Huang and colleagues at Google DeepMind tested intrinsic self-correction, where a model revises its own answer using only its own judgment, and found models struggle to self-correct without external feedback, with performance sometimes degrading after self-correction.
Run that in a loop for forty iterations and you have built a machine that converts token budget into confident drift.
An honest caveat: that paper is from October 2023, and it is not the last word. The same lab later published SCoRe, which trains self-correction through multi-turn reinforcement learning and reported gains of 15.6% on MATH and 9.1% on HumanEval over base models. Self-correction is trainable. What has not changed is the direction of the dependency: the gains came from a training procedure grounded in correctness signals, not from asking a model to try harder.
Why loops became the unit of work
METR measures agent ability in units of human time. Their finding: current models have close to 100% success on tasks taking humans under four minutes, and under 10% success on tasks taking more than about four hours, with the 50%-reliability task length doubling roughly every seven months. METR now flags parts of that March 2025 post as out of date and maintains a live tracker, with later estimates suggesting the doubling has been faster than seven months.
Take the shape rather than the exact number. Somewhere between four minutes and four hours of human work, single-shot prompting stops being the relevant unit and loop design becomes the whole game.
What a designed loop looks like
Concrete beats abstract. Here is a loop for an agent building an invoice parser, specified as the decisions that actually carry it:
| Element | Setting | The failure it prevents |
|---|---|---|
| Goal | Parse the 14 vendor formats in /fixtures into the target schema | Agent satisfying a restatement of the goal instead of the goal |
| Verifier | Held-out fixture suite, no agent read access | A checker the agent can edit or route around |
| Signal | Pass count plus field-level diff on failures | Self-assessment presented as evidence |
| Success stop | 14 of 14 on the held-out suite | Endless polishing past the finish line |
| No-progress stop | Three consecutive iterations with no change in pass count | Overnight burn by an agent convinced it is progressing |
| Ceiling | 25 iterations or 8 dollars of tokens, whichever comes first | Unbounded cost on an unsolvable task |
| Recovery | Git checkpoint per iteration, roll back on regression | One early mistake propagating through every later step |
The no-progress stop is the row teams skip. Success conditions are obvious. Detecting that three consecutive iterations moved nothing, and halting, is what separates a loop from a leak. Anthropic recommends stopping conditions such as a maximum number of iterations to maintain control, plus human checkpoints before irreversible actions.
Note what the verifier row does. It sits outside the agent's reach. That single property is doing more work than any prompt in the system.
The objection worth taking seriously
Someone will argue that this is a temporary condition. Verification quality is itself being trained into models. SCoRe is evidence for that. Evaluator-optimizer patterns keep improving. On this view, "the verifier is the product" is a 2026 observation with an expiry date, and in three years the loop really will be the easy part in the way the marketing already implies.
I think the Cursor data cuts against it, and this is inference rather than established fact. The verifier problem got worse as models got stronger, not better. Opus 4.6 showed a sub-one-point harness gap. Two versions later the gap was 14.1 points. A model that is better at reasoning is also better at noticing that a bug was already fixed upstream, that the tests are readable, that the eval environment leaks. Cursor's own closing point is that sealing git history does not solve the deeper problem, because models increasingly infer when they are being evaluated.
If that holds, verifier design does not get easier as capability rises. It gets harder, and it becomes more valuable.
Who should build loops, and who should wait
Build: teams with a cheap, honest oracle. Code with tests. Pipelines with schema validation. Research with groundedness checks against retrieved sources. Anything where a machine, not a model, can say yes or no.
Wait: teams whose success criteria live in a stakeholder's head. Brand voice, strategic judgment, design taste. You can still use agents there. Do not hand them an unsupervised loop, because the agent will converge on something and you will have no way to know whether it converged on the right thing.
And if a fixed three-call workflow already passes your evals, the loop is a downgrade dressed as sophistication. Loops earn their cost only when the path is genuinely unpredictable and the outcome is genuinely checkable.
The takeaway
Loop engineering is verifier engineering wearing a different name. Before you add another iteration to your agent, answer one question about your system: what can tell this agent it is wrong, and can the agent get to it?
If the answer is "the model decides," you do not have a loop. You have an expensive opinion, repeated.
Frequently asked questions
- What is loop engineering?
- Loop engineering is designing agentic workflows where an AI agent acts, observes the result, evaluates progress, and iterates toward a goal without human prompting at each step. It covers four things: the goal definition, the feedback signal, the stopping rule, and the recovery path.
- How is loop engineering different from prompt engineering?
- Prompt engineering optimizes a single instruction sent to a model. Loop engineering designs a system that generates its own instructions repeatedly and checks its output against external feedback. Prompting fits one-off tasks. Loops fit long-running, multi-step work.
- Why do agent loops fail even with a strong model?
- Most loop failures are verification failures. If the agent cannot get honest external feedback on whether it is closer to the goal, extra iterations add cost and confident drift rather than accuracy. Worse, a capable agent will find and exploit weaknesses in a reachable verifier.
- When should you avoid building an agent loop?
- Skip the loop when success is subjective and unmeasurable, when actions are irreversible without review, or when a fixed workflow already passes your evals. Loops trade predictability for flexibility, and that trade only pays when you can verify progress independently.
Read next
Drift Is Real: Why AI Products Decay Quietly
Four things move underneath every AI feature, and only one has a version number. A field guide to drift, and why your eval set is the last thing to know.
ADLC vs SDLC: What Changes When Code Stops Being the Product
SDLC ships deterministic code. ADLC ships probabilistic behavior. That one shift rewrites what you build, how you test, and what done means.
Why the Obvious Fix Doesn't Work in AI Products
AI teams keep tuning the prompt when the real leverage is a feedback loop or the goal itself. Donella Meadows explained why decades ago. Here's the map.
Get new posts by email
No spam. Just the occasional note when I publish something worth your time.