Don't be scared by the “loop” part. That's the easy bit.
Once you grasp it, it's engineering all the way down.
You have a test. You write code and run the test. If the test fails, you change the code and run it again. When it passes, you're done.
That's the whole loop. Put an agent inside it, and the agent does the going round.
Each time round, the agent gets a clear signal: still failing, and why. It fixes, re-runs and gets closer. It climbs to correctness.
This doesn't mean you have to write the tests. It means you must have correctness conditions the agent can run to make sure its code doesn't ruin the codebase:
Putting the correctness conditions in the local loop means the agent can iterate on its own machine, fast and cheap. Once they pass, the work moves out to CI, a longer loop with further guards. After it merges, integration and acceptance testing run. Users are the last loop of all.
Say a defect slips through the local loop, CI, and integration and acceptance testing, and turns up in a user's bug report.
Of course you fix the defect. But an engineer also examines the engineering of the loops: how could we detect this class of bug as early as possible, in the tightest loop?
Could this class of defect be made impossible by changing the type system? This is the fun part. It's engineering.
Loop engineering is designing these loops so they give you confidence in the implementation.
A failing check feeds back into the same loop: change the code, run it again. Agents do this, many times a minute.
Escaped defects, slow runs and wasted resources feed back into the design of the loops. Engineers do this: better types, better checks, a better place for each check.
You could try, but you'll hit diminishing returns. If the inner loop catches everything but is slow and expensive to run, and 20% of it catches 80% of the issues, maybe the other 80% belongs later, in exchange for velocity.
Illustrative numbers. The checks in purple still run, just later (in CI or after merge), where an escape costs more to fix.
Faster loops that use fewer resources mean more of them can run at once, and each one finishes sooner. With many agents working in parallel, that multiplies.
Teams have switched to faster-compiling languages to speed up the inner loop, and to languages with more expressive type systems to get stronger guarantees.
Designing the conditions. Placing each check in the right loop. Pushing detection inward. Making loops faster and cheaper. Trading time and resources for confidence. Agents go round the loops; engineers design them.