Every agent loop needs hard limits:
- Max iterations. 8–12 for most workflows. Abort and fail loudly past that.
- Max tokens. Sum input + output across the loop. Stop at $X budget per request.
- Max wall time. A 10-minute agent is almost always broken.
- Repetition detection. If the agent calls the same tool with the same args 3+ times in a row, abort.