Agent loop
Also: agentic loop
The cycle an agent repeats: look, decide, act, check, until the task is done or it must stop.
- Open the folder of letters
- Read each letter and note its date
- Write the dates into a table
- Email the table to the client stop: needs your approval
A chatbot answers one message. An agent keeps going: it decides the next step, does it, looks at the result, and repeats. The important design question is which steps it may take alone and which must wait for you.
The fuller definition
An agent loop repeatedly chooses a next step, invokes an available action, observes its result, and decides whether to continue or stop.
Go deeper
- ObserveRead the task, the current state, and the last result.
- DecidePropose the next action: a search, a file read, a calculation.
- ActThe harness runs the action, if permitted.
- CheckStop condition met? If not, loop again.
The model proposes; the surrounding software executes and records. Where the loop may act, and when it must stop and ask, are decisions made outside the model.
A concrete example
An agent searches for an attachment, reads a candidate, and either records it or searches again.
The distinction that matters
A loop needs budgets and stop conditions; repeated activity is not necessarily progress.
Related terms
AI agent
An AI system that takes steps to do a task. It may choose tools, search, or work with files. Its access should have clear limits.
Agents & automationAgent harness
The code that runs an agent's tools. It can keep logs and limit what the agent may do.
Agents & automationStop condition
The rule that tells an agent when to stop.
Where it is taught
Prompts, skills, workflows, and agentsSource and further reading
Anthropic · Building effective agentsThe definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.