An agent is designed to keep calling tools and reasoning until it decides the task is complete. What safeguard should be included to prevent it from running forever due to a bug or a confusing tool result?
- aRemove the ability to call any tool more than once per conversation.
- bLet the loop run indefinitely with no cap at all, since a well-written prompt reliably guarantees the model will eventually decide to stop calling tools on its own.
- cA maximum number of iterations or a time/cost budget, so the loop is forcibly stopped and a fallback response is returned at the limit.✓
- dIncrease the model's temperature so it produces more varied actions and breaks out of repetitive patterns.
Explanation:A hard iteration or budget limit is the standard safeguard against runaway agent loops; once reached, the application stops the loop and returns a fallback rather than relying on the model to self-terminate. A prompt alone cannot guarantee termination, and raising temperature does not address the underlying loop-control problem.