Prompt to Stop an Agent From Looping
An agent without explicit exit conditions will retry a failing action indefinitely, burning tokens and potentially causing cascading failures. This prompt pattern adds retry limits, failure detection, and clean abort behavior.