An agent loop is the repeated cycle an AI agent follows while working toward a goal. A simple loop is: understand the task, take a step, check what happened, and decide whether to continue or stop.

For example, an agent asked to fix a spelling error might inspect the file, make the change, run a check, and report the result. If the check finds another issue, it may take another step.

The loop needs a clear stopping point and reasonable limits. Without them, an agent might repeat work or take actions that were never needed.