What is loop engineering?
Loop engineering designs systems that launch AI agents in place of a person, with triggers, checks, spending limits, and points where a person steps in.
Loop engineering is the design of systems that start an AI agent in place of a person, check its result, and start it again over time. An AI agent is a system that uses a model and software tools to work toward a goal. Each agent run is already a cycle: it calls tools and acts on the results until a condition stops it, and the agent harness, the software layer that runs the agent, configures this inner cycle. Loop engineering works one level up: it sets what triggers each run (a schedule, or an event such as a failed build), which checks to run, what state to keep between runs, how many resources to spend, and when to ask a person to intervene. Within one session an agent can run tests and revise a change; a loop can start a new session whenever a build fails. Repetition does not guarantee success; it takes checks independent of the agent and limits scaled to the risk.
See also: Agent harnessAn agent harness is the software scaffolding around an LLM that makes it an agent: the execution loop, the tools, the context and the limits you give it.
What the research shows
An exploratory study of loop engineering finds that practitioner sources converge on loops triggered by events or schedules, with machine-checkable stop conditions, token budgets, and escalation points, where a person takes over. Of the 36,487 software repositories analyzed, the authors confirmed autonomous loops in 217 open-source GitHub repositories (0.59%), which heuristics and commit-history signals had flagged and the authors then verified. The figure holds for that sample and may depend on the method: it does not measure adoption across businesses generally. The authors find no systematic evidence for the benefits claimed in the literature they reviewed and propose an experiment to study them.
The ReAct pattern describes a separate, complementary concern: how a model interleaves reasoning and actions. The original paper shows how observations from the environment inform subsequent steps. ReAct governs the steps inside a single agent run; loop engineering decides when to start new runs, how to verify them, and when to stop the loop, and it works with or without ReAct.
An enterprise example
A team configures a loop that runs on any night the end-to-end tests of an internal application fail. The team first defines which files may be changed, which checks must run, the maximum number of attempts, and the budget per run. On each run, the agent proposes a fix; a separate check, not the agent itself, runs the tests, and a state file records what has already been tried. If the tests still fail at the limit, the loop stops and preserves the changes and results for human review; no change reaches the main branch without approval. Passing the tests is the agreed minimum, not proof that every requirement is met. To compare solutions, the team can use its own cases alongside public benchmarks: SWE-bench scores fixes for single real-world issues in Python repositories, not the behavior of a loop repeated over time, and does not replace testing against in-house systems.
Why it matters for decision makers
When buying or designing a system, ask which checks actually run, who can change them, and what happens when the budget runs out. For reversible, verifiable operations, a bounded automatic loop may suffice; sensitive changes need approval up front. Logging attempts, outcomes, and resource use lets you weigh the loop's cost against the review work it requires, without mistaking a claimed result for a verified one.
Frequently asked questions
Related terms
- Agent harnessAn agent harness is the software scaffolding around an LLM that makes it an agent: the execution loop, the tools, the context and the limits you give it.
- AI Agents (Agentic AI)An AI agent is a system that uses a model and external tools to select and perform actions toward a goal, within established boundaries and permissions.
- AI tokenomicsAI tokenomics examines the cost of tokens used by generative models and compares it with the results, quality, and operating costs of a business service.
- Ralph Wiggum LoopAn informal technique that runs a coding agent in a repeated loop until it succeeds, instead of stopping after a single failed attempt.
- ReAct patternThe ReAct pattern combines language model reasoning with actions, using observations returned by external tools to guide the next steps of the task at hand.