An autonomous agent is tasked with debugging a failing CI pipeline. The agent can run tests, read logs, modify code, and commit changes. During a session, an engineer notices the agent has made 47 commits in 10 minutes, each failing the same test with slight variations. What architectural safeguard should have prevented this?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — you need loop detection that tracks what the agent tried, compares outcomes, and stops after repeated equivalent failures. If the same test error keeps coming back, the agent should halt and page a human instead of burning through commits.
Full Explanation
The correct safeguard is loop detection with three components: action history tracking, outcome similarity detection, and an escalation threshold that halts and pages a human when a set number of consecutive attempts produce equivalent failure outcomes. Effective loop detection must combine action tracking, which shows what was tried, outcome analysis, which shows what happened, and similarity detection, which shows whether outcomes are converging or cycling. When repeated attempts produce equivalent failures, such as the same test error, the agent is in a loop and should halt and escalate to human review rather than continuing to vary the approach without progress. The maximum token budget safeguard is wrong because it terminates based on computation consumed, not on whether the agent is making productive progress; a loop can consume tokens efficiently while making no progress, and the budget may be exhausted before the loop is detected. The requirement for human approval for every code commit is wrong because it eliminates the autonomy value of the agent and is impractical at scale; approval should be triggered by detected failure patterns, not applied universally. The hard limit of five total actions per agent session is wrong because it is too low for legitimate complex debugging tasks that may require many iterations; the limit should be based on progress detection, not an arbitrary count.