*** ONE REQUEST AT A TIME *** THE LOOP, ZOOMED IN ***

The home page gave you the loop in four lines. Here's the same loop again, but this time we linger on each step and ask what's actually being sent over the wire.


Step 1 — the system prompt sets the stage

Before a single word from the user arrives, the harness sends a system prompt: who the agent is, what it's allowed to do, and a list of tool definitions — each one a name, a description, and a schema for its arguments. The model never "has" tools the way a person has a screwdriver; it only ever sees a list of tools it's allowed to ask for.

Step 2 — the user's prompt, and a response

The user's message is appended to the conversation, and the whole thing — system prompt, every prior turn, and the new message — is sent to the model in one API request. The model reads all of it fresh, every single time: there is no persistent memory between requests, only whatever is written down in the conversation so far.

The model's reply is either plain text, or a request to call one of the tools it was told about earlier.

Step 3 — the harness is the model's hands

A model can't read a file or run a command on its own — it can only emit a structured request to do so. The harness is the program that actually calls the tool (reads the file, runs the command, hits the API), and hands the result back. That result doesn't go to the user: it gets appended to the conversation as a new message, and the entire conversation, tool result included, goes back to the model as another new API request. From the model's point of view, this looks identical to the very first request — just longer.

Step 4 — the loop pauses, it doesn't stop

This is why it's a loop and not a pipeline: steps 2 and 3 repeat, request after request, for as long as the model keeps asking for tools. The loop only pauses when a model response comes back with no tool call in it — plain text, handed to the user, and the harness waits for the next prompt.

💾 SAVE OFTEN Every extra turn re-sends the whole history. That's why long sessions get slower and pricier — the "loop" is also a growing pile of text the model has to re-read from scratch each time.

Still fuzzy on a word? The Glossary defines each one plainly. Or head back Home.