Agentic Systemsadvanced14 min · 9 steps
Loop Engineering
Design the loops around the agent: harness-enforced termination and budgets, stacked verification and improvement loops, context hygiene, and the anti-patterns that burn money.
tool callerrorrequestresponsedatasignal
ProblemStep 1 of 9
The loop that never stops
Practitioner write-ups describe an agent that called a broken tool 400 times in five minutes, an 847-step run that never produced an answer, and retry loops that ran up tens of thousands of dollars over days.
Almost all of them lacked two things: an external budget guard and a stagnation breaker. The model kept going because nothing outside the model could say stop.
Watch out“The model returned no tool calls” is a natural stop signal — necessary, but not sufficient. The harness must verify completion.
Lesson 12 of 15 in Agentic Systems