Agent Loops And Why They Are Risky
An agent loop is when an agent does the same thing over and over because it did not realize the task was done.
Famous case: an agent that was supposed to send 'one' email sent 1,000 because each retry felt like a 'first try' to it.
Three ways to prevent loops
- Hard limit on retries (max 3)
- Rate limits per minute
- Human approval required if same action retried
The big idea: Agent loops can blow through your budget fast. Always set retry limits.
End-of-lesson check
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-builders-agentic-agent-loops
Which sentence best captures the main idea of 'Agent Loops And Why They Are Risky'?
- Agents and chatbots are the same thing in every way
- Tools and goals are unnecessary for agent design
- Agents should always run without limits or oversight
- An agent loop is when an agent does the same thing over and over because it did not realize the task was done..
Which of the following is part of 'How loops happen'?
- Never log what the agent did
- Always run with no oversight
- Agent does action. Result is unclear. Agent assumes it failed. Tries again. Result still unclear. Tries again. Repeat 1,000 times.
- Use the most expensive model regardless of fit
Which of the following is part of 'Three ways to prevent loops'?
- Avoid taking any actions in the world
- Always run with no oversight
- Hard limit on retries (max 3)
- Use the most expensive model regardless of fit
Which of the following is part of 'Review date'?
- Reviewed in 2026. Treat fast-changing product names, prices, availability, and policy details as examples to verify before use.
- Never log what the agent did
- Use the most expensive model regardless of fit
- Disable safety checks for speed
What is 'runaway' in this context?
- A way to disable the agent's tools
- A core concept covered in Agent Loops And Why They Are Risky
- A trick to bypass approvals
- A reason to skip all logging
What is 'rate limit' in this context?
- A trick to bypass approvals
- A core concept covered in Agent Loops And Why They Are Risky
- A way to disable the agent's tools
- A reason to skip all logging
What is 'retry' in this context?
- A way to disable the agent's tools
- A core concept covered in Agent Loops And Why They Are Risky
- A trick to bypass approvals
- A reason to skip all logging
Why is the 'loop' in 'agent loop' the source of both power and danger?
- Loops are illegal in most countries
- Loops have no impact on cost
- The loop lets the agent iterate toward a goal but can also run forever without bounds
- Loops only matter for music agents
An agent that costs $0.04 per task on average will run 10,000 times this month. Roughly what should you budget?
- About $400
- About $40
- About $4,000
- About $4
Which is the clearest sign an 'agent' is really just a chatbot in disguise?
- It can remember last week's conversation
- It uses a system prompt
- It can call a search tool
- It only produces text and never takes actions
Why is it dangerous to give an agent access to your email and calendar without scoped permissions?
- Broad access means a single misstep can send the wrong message or wipe events
- Scoped permissions slow the model down
- It will refuse to work
- Scopes only matter for paid accounts
What is the best response when an agent suggests an action you do not understand?
- Run it twice to be sure
- Ask the agent to explain the action and its expected effect before approving
- Approve it to keep things moving
- Reject everything and stop using the agent
Which signal best tells you an agent is stuck in a runaway loop?
- It asks one clarifying question
- It finishes the task in one step
- It keeps repeating the same tool call with no new progress
- It returns a short summary and stops
An agent quietly retries a failed payment 50 times overnight. What design principle was missing?
- A bigger context window
- A larger model
- More creative prompting
- Bounded retries with human notification on repeated failure
What is the difference between an agent's memory and its context window?
- Context is what the model sees right now; memory persists across runs
- Memory is faster but less accurate than context
- Context lasts forever; memory is cleared every minute
- Nothing — they are the same thing