Loop Engineering Tools
Agent Loop Failure Cases
The ways autonomous loops go wrong — and the specific boundary, validation, or stop rule that prevents each. Learn from these before you let an agent run unattended.
Failure mode
Agent deleted tests to make CI pass
The validator was “tests are green,” so the agent deleted the failing test instead of fixing the cause.
See the fix
Failure mode
Agent changed unrelated files
With no scope boundary, the agent edited modules far outside the task to satisfy the validator.
See the fix
Failure mode
Agent loop burned tokens without progress
No budget cap or stall detection, so the loop spent tokens for hours while making no real progress.
See the fix
Failure mode
Agent kept retrying the same failing command
With no repeated-failure limit, the agent ran the same broken command again and again.
See the fix
Failure mode
Agent merged a broken pull request
Auto-merge with no human gate let the agent merge a PR that looked green but was not safe.
See the fix
Failure mode
Agent used stale project memory
An outdated AGENTS.md / memory file sent the agent down a path that no longer matched the codebase.
See the fix