Loop Engineering for Enterprise Agents: The Free Verifier Problem

Loop engineering for enterprise agents breaks where code succeeds: the codebase ships a free verifier. Four things you buy when the work is not code.

Loop Engineering for Enterprise Agents: The Free Verifier Problem

Loop engineering for enterprise agents is being sold as the next step after prompt engineering, and the demos are real. The practice is straightforward: stop hand-prompting a coding agent and instead build the loop around it, so it runs on a schedule, works in an isolated branch, gets graded by a second agent, and writes its state to a file so the next run resumes where the last one stopped. Anthropic's Claude Code lead, Boris Cherny, put it as bluntly as it can be put: his job is to write loops. Google's Addy Osmani named the pattern. Both Claude Code and OpenAI Codex now ship the same six primitives as first-party features.

It works. It also works for a reason nobody selling it says out loud, and that reason does not travel.

Coding loops work because a codebase ships its own verifier. The compiler, the type checker and the test suite grade every run for free, instantly, at a cost of approximately zero per attempt. The maker/checker split that everyone correctly identifies as the trust mechanism in loop engineering is nearly free in software, because half of it was already sitting in the repo before any agent showed up.

Take that loop out of a codebase and put it on a claims workflow, a procurement approval, or a customer remediation, and the verifier does not come with it. You have to build it. Almost nobody budgets for that, which is the single best predictor I know of whether an agent program stalls at pilot.

Why does loop engineering work in code and stall everywhere else?

The honest answer is that the six loop primitives are not equally portable. Scheduled execution, connectors, skills and memory move to any domain without much friction. Two do not.

Isolation is the first. Per-session git worktrees are what let Spotify run dozens of concurrent agent sessions against one codebase without the agents corrupting each other's work. Their internal agentic development environment, Xirp, has logged more than 36,000 sessions across thousands of engineers, and the worktree is the primitive that makes the concurrency safe. There is no git worktree for your general ledger. Enterprise agents write into shared systems of record where two agents working the same entity at the same time is a data integrity incident, not a merge conflict.

The verifier is the second, and it is the expensive one. In code, "did this work" has an answer that a machine produces in seconds. In an enterprise workflow, "did this work" is a judgment that often is not knowable until a human looks, sometimes not until a month-end close, and occasionally not until a regulator asks. Claude Code uses a separate model to grade results precisely because self-grading is too generous. That is the right architecture. It is also the part that, outside code, you are building from scratch.

What does the production data say about where agents actually fail?

This is where the numbers stop being anecdotal.

Foundra telemetry across 6,259 deployed agents and roughly 4.5 million runs puts real-world task success at 56.6%, against a drop of about 37 points from benchmark performance to production performance. The reliability picture gets worse under repetition, which is what a loop does by definition: tau-bench agents scoring around 60% on a single attempt fall to roughly 25% when required to succeed eight times consecutively.

The funnel numbers line up. 46% of proofs of concept reach production, 14% scale org-wide, and about 5% show measurable P&L impact. Gartner projects that more than 40% of agentic AI projects will be canceled by the end of 2027.

The interesting part is not the attrition. It is where the failures cluster. They concentrate at what the analysis calls seams: handoffs between steps, messy inputs, and monitoring blind spots. Not raw model capability. Those three seams are exactly the places a compiler would have caught the problem in a coding loop, and exactly the places an enterprise loop has no automatic grader.

One more number, from LangChain's survey of more than 1,300 practitioners, and it is the one I would put on a slide: 89% of teams running agents have observability, but only 52% run offline evaluations and 37% run online evaluations.

Nearly everyone is watching. A third are grading. A loop that is watched but not graded does not self-correct. It just produces more of whatever it was already producing, faster, with a dashboard confirming that it is definitely running.

What does the codebase hand a loop for free?

Here is the framework I use when a team wants to take a loop out of the IDE and point it at a business process. Four things git and the compiler give away, and what each one costs when the work is not code.

1. The Oracle. Tests and the compiler answer pass or fail on every run, for free, in seconds. Outside code there is no oracle by default. You buy one by building a labeled evaluation set, and that means a human deciding what "correct" means for a few hundred real cases before the loop is allowed to run unattended. This is the line item that gets cut, and it is the one that determines whether the loop works.

2. Rollback. git revert makes a wrong action free to undo, which is what makes an autonomous coding agent tolerable. A sent email does not revert. A posted journal entry does not revert. A filed claim does not revert. When the cost of a wrong action is not zero, the loop needs a gate before the action, not a fix after it, and the position of that gate is an architecture decision.

3. Isolation. A worktree lets many agents touch one repository without collision. Systems of record have no equivalent, so isolation has to be engineered as scoped leases, per-entity locking, or a staging layer the agent writes to before anything reaches the system of record.

4. Provenance. Every code change is a diff, attributed, with history, reviewable months later by someone who was not there. Enterprise loops frequently write through a shared service account, which collapses the entire trail to "the integration did it." With EU AI Act enforcement live as of 2 August 2026, that collapse is not just an operational annoyance.

Call it the Free Verifier Problem: loop engineering's economics depend on four subsidies that only a codebase pays.

What is the Oracle Test?

One move, before any of the architecture work.

The Oracle Test: name the thing that will say "done," and name who pays for it. If you cannot answer both in one sentence, you are not building a loop. You are building a process that runs forever and calling it autonomy.

The answer is allowed to be a human. "A senior claims adjuster reviews a 30-case sample weekly" is a legitimate oracle with a real cost attached. "The agent checks its own work" is not an answer, and the reason Claude Code grades with a separate model is that the labs already learned this.

What I'd actually do

I work with Fortune-level enterprise clients architecting and building agentic frameworks, and this is the sequence that has held up.

Pick the one workflow you are closest to shipping. Before adding a single loop primitive, write the Oracle Test answer on one line. If it takes more than a sentence, the workflow is not ready and no amount of orchestration will make it ready.

Then check your evaluation coverage against that 89/37 split. If you have dashboards and no online evals, you do not have a loop, you have a cron job with a monitoring bill. Wire one grader into the release path for one workflow and let it block. A grader that cannot block is a report.

And treat the four subsidies as a budget line rather than a design detail. Every one of them that the codebase gave you free is real engineering when the work is not code, and pretending otherwise is most of the distance between the 46% who reach production and the 5% who show P&L impact.

The loop is not the hard part. The thing that says "done" is the hard part, and in code you never had to build it.


Primary source: Loop engineering: the Anthropic leader who built Claude Code says he ditched prompting, The New Stack, August 2026. Production data from Foundra telemetry and the LangChain practitioner survey via the 2026 agent production-gap analysis.

More on this: the multi-agent orchestration architecture pillar, model routing for multi-agent workflows, and evaluating AI agents in production.

Get the next one. I write one piece a week on the orchestration, decisioning and governance that make enterprise agents safe to ship. Subscribe at buildnextgen.ai.

Swipe the framework

The Free Verifier Problem, slide 1 of 8

The Free Verifier Problem, slide 2 of 8

The Free Verifier Problem, slide 3 of 8

The Free Verifier Problem, slide 4 of 8

The Free Verifier Problem, slide 5 of 8

The Free Verifier Problem, slide 6 of 8

The Free Verifier Problem, slide 7 of 8

The Free Verifier Problem, slide 8 of 8