Skip to content
← Back to Glossary

Agent Loop

ai-engineering agent-design

The cycle where a model produces a response, the harness executes tool calls, results feed back as context, and the loop repeats until no tool calls remain.

↑ Contents

Definition

The agent loop is the core execution pattern of every agentic harness. The model receives context and produces a response. If the response contains tool calls, the harness executes them and appends the results to the context. The model sees the updated context and responds again. This continues until the model produces a response with no tool calls, which the harness treats as the final answer. The loop is the same regardless of the agent or task. What varies is the context fed in, the tools available, and the policies that gate execution.

↑ Contents

Source

↑ Contents