AI Glossary / Agents and automation / Intermediate

Agentic loop

Definition

An agentic loop is the repeating cycle at the heart of an AI agent: observe the current state, decide the next step, act, read the result, and repeat until the task is done or a stop rule fires.

What it means

A single prompt and answer is a transaction, not a loop. The agentic loop begins when the output of one step becomes the input of the next: the system reads an inbox, decides to look up an order, reads the order, decides to draft a reply, and so on.

The loop is what gives agentic systems their reach. Multi-step work, such as researching a question or processing a batch of invoices, is just the same cycle repeated with memory of what has already happened.

It is also where the risk concentrates. Each pass can compound an earlier mistake, because a wrong result in step two becomes a confident assumption in step five. Stop rules, step limits and human checkpoints exist to bound the loop.

Designers choose what ends the loop: a completion test, a maximum number of steps, a cost ceiling or a request for human approval. An unbounded loop is a fault, not a feature.

For a business reader, asking how the loop stops is one of the most useful questions to ask any agentic product.

How it works

A typical pass has four stages. The system assembles the current state, including the goal, the history so far and fresh observations. A model or rule set chooses the next action, often a tool call. The action executes and returns a result. The result is written back into the state, and the loop tests whether to continue.

Memory makes the loop coherent. Without a record of earlier steps, the system repeats itself or contradicts what it already found, so the state object is as important as the model.

Guardrails attach to the loop rather than to any single step: a counter that caps iterations, a budget that caps spend, and checks that route certain actions to a person before they run.

Observability closes the design. A trace of every pass, what was seen, chosen and done, is how teams debug loops that wander, stall or loop forever.

Three practical examples

  • Research: an assistant searches, reads a page, notes a gap, searches again, and stops when its questions are answered or its step limit is reached.
  • Operations: a billing agent drafts an invoice, validates it against the order, fixes a mismatch it detected, then queues it for approval.
  • Support: a bot replies, watches for the customer's response, and either resolves the thread or escalates after a set number of exchanges.

Think of it this way

Think of someone assembling furniture from instructions. Read a step, find the part, fit it, check the picture, move to the next step. The checking glance between steps is what keeps the chair from ending up with three legs.

The limit of the analogy is that a person notices when the instructions no longer match reality. A loop needs its stop rules and checks written in, or it will keep tightening the wrong screw.

Worked example

bounding a research loop

Suppose a manager asks an assistant to compare three suppliers. Without limits, the assistant might follow links for hours, spending budget on ever-weaker leads.

A bounded design sets three rules: at most twelve steps, sources must be cited for every claim, and the loop ends early if two passes find nothing new.

The assistant finishes in nine steps with a comparison and its source list. When a run does hit the step cap, the partial notes are delivered with a clear unfinished marker rather than a confident summary.

The teaching figures are invented, but the pattern is standard: caps, freshness tests and honest partial results are what make a loop safe to run unattended.

Illustrative case study

A fictional retailer lets a pricing assistant adjust listings overnight. The first version loops without a cap; one morning the team finds it has repriced the same category six times, chasing its own earlier changes.

The team adds three things: a maximum of two passes per night, a rule that the agent may not treat its own output as new information, and a morning report of every action.

The case is invented to show the classic loop failure: feedback into oneself. The loop did not need a better model, it needed boundaries.

Common misconceptions and mistakes

  • More passes means more care. Past a point, extra passes add cost and drift, not accuracy; good loops stop early.
  • The loop thinks. Each pass is a model call or rule evaluation; coherence comes from the state and stop rules, not from awareness.
  • A loop can be left unbounded if the task is important. Importance is the argument for stricter bounds, because important tasks are where runaway loops do damage.

Business use

Agentic loops suit open-ended but checkable work: research, reconciliation, monitoring and drafting with verification steps.

Before approving one, require three numbers: the step cap, the cost cap and the sampling rate for human review of the loop's trace. If a vendor cannot state them, the loop is not ready.

People also ask

Is an agentic loop the same as automation?

Automation can be a straight line of fixed steps; a loop re-decides the next step from the latest state.

What stops the loop?

Whatever the designer sets: a completion test, step limit, cost ceiling or human approval request. A good design uses several.

Why do loops go wrong?

Usually through compounding small errors or feeding the system its own output as if it were new evidence.

Check your understanding

An overnight agent repriced the same items six times, reacting to its own changes. Which two loop controls would have prevented this?

Answer: A step or pass cap, and a rule preventing the agent from treating its own prior output as new input, plus logging so the pattern is visible.

Related terms

  • Agent
  • Agentic workflow
  • AI agent
  • Orchestration
  • stop rule

Learn next

AI Agents and Automation for Small Business builds loops with human approvals, error alerts and cost controls: https://aiforbusinessandlife.com/academy/ai-agents-automation-small-business. [C4]

More in Agents and automation

  • Agent function - An agent function is the mathematical description of an agent's behavior: the complete mapping from everything the agent has perceived so far to the action...
  • Agent orchestration - Agent orchestration is the coordination of multiple AI agents or tool-using steps so they work together on a larger task: deciding which agent does what, in...
  • Agent program - An agent program is the actual running software that implements an agent: the code that takes the current percepts and produces the next action.
  • Automation - Automation is the use of technology to perform tasks with reduced human involvement, following defined rules or trained behavior.
  • Autonomous agent - An autonomous agent is an AI agent that can pursue a goal over many steps without a person directing each step, deciding its own sequence of actions within...
  • Batched automation - Batched automation is automation that processes work in grouped runs at scheduled times rather than handling each item the moment it arrives.

Sources

[S2] Google, Machine Learning Glossary. [S5] Anthropic, Building effective agents. Full URLs are in the source ledger. Verified 11 October 2026.

Previous: Agent verification Next: Agentic workflow

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer