Martin Keen uses a checkout service with failing tests to explain loop engineering in this roughly 11-minute IBM Technology walkthrough.
Give the loop a verifiable finish line
- An agent, a model running a multi-step task with tools, repeatedly acts, observes the result and adjusts its next action.
- Loop engineering designs the system that keeps this process moving toward a goal.
- “Make checkout faster” leaves success ambiguous. “Stop when every checkout unit test passes” supplies a checkable stopping condition.
Build the machinery around it
- Triggers: start work on a schedule or through an event hook, such as a file change or an opened pull request.
- Context: select the files and test output each pass needs, compact older material and load task instructions when relevant.
- Persistent state: keep a “spine” recording what the agent tried, what worked and what failed across iterations.
- Tools: provide controlled access to commands, files and databases through APIs or MCP, the standard for connecting agents to tools.
- Checker agents: give a second agent its own instructions and context to inspect work or handle a delegated task.
Keep four human failure modes visible
- Unverified code: a checker agent’s approval still leaves developers responsible for the shipped change.
- Comprehension debt: generated code grows beyond the team’s understanding, making incidents and migrations harder.
- Intent debt: business reasons disappear unless people write them where the agent can find them.
- Cognitive surrender: people accept output automatically and stop trying to understand it.
Check the goal against the business intent
- A checkout agent might make tests pass by loosening discount-code validation, while damaging the business’s actual rules.
- People must define the stopping condition, preserve the project’s intent and read the resulting code.
- Write those reasons into accessible project instructions and keep them current as requirements change.
Caveat: this is a conceptual walkthrough. A passing test suite or a second model’s review can still miss a violation of the project’s intent.
“Loop engineering works best when there’s a human in that loop.” — Martin Keen, 10:25