An agent loop may run without end. What is a basic safeguard?
Why B is the answer
A maximum step count
Step and budget limits stop loops.
In detail
- A step limit stops an endless loop.
- Pair it with a budget limit.
Use case
An illustrative scenario, not a real incident.
An agent stuck in a loop stops at 20 steps, and it reports back.
See it in different ways
stateDiagram-v2 [*] --> Reason Reason --> Act Act --> Observe Observe --> Reason: not done Observe --> [*]: done
sequenceDiagram participant U as Users participant L as Rate and budget limits participant A as Agent replicas participant S as External state participant M as GPU inference U->>L: Requests L->>A: Within limits A->>S: Reads and saves state A->>M: Model calls, in parallel if independent
flowchart TD
Q{"Has it reached the maximum?"}
Q -->|"No"| A0["Continue"]
Q -->|"Yes"| A1["Stop"]Key point: Step limits stop loops.
Why the other options are wrong
- A. A longer system prompt
- A prompt does not stop loops.
- C. A higher top-k value
- Sampling does not stop loops.
- D. A larger embedding size
- Embeddings do not stop loops.

