Token loop
Sample, append, check stop
AI loops stack from token generation to full operating systems. Each layer repeats something different, keeps different state, and needs a different exit condition.
Layered framework
Read from the smallest cycle to the broadest system. Each layer aligns around its own exit condition.
Sample, append, check stop
User intent to assistant response
Read, search, browse, run, write
Check, repair, recheck
Plan, act, verify, continue
Wake, inspect, act, report
Sense, decide, delegate, review
The AI Loop Stack is a seven-layer model for understanding an AI loop: token loops, turn loops, tool loops, verification loops, goal loops, scheduled loops, and operating loops.
The point is not taxonomy theater. The point is control. Every layer needs a trigger, state, verifier, budget, and stop condition appropriate to what it repeats.
| Layer | What repeats | State | Exit condition | Risk if unbounded |
|---|---|---|---|---|
| Token loop | Sample, append, check stop | Context window | Stop token or max tokens | Runaway text without useful work |
| Turn loop | User intent to assistant response | Conversation | Human feedback or task acceptance | Polished answers with no execution |
| Tool loop | Read, search, browse, run, write | Files, browser, APIs, logs | Tool result or observed state | Side effects without proof |
| Verification loop | Check, repair, recheck | Tests, sources, diffs, screenshots | Evidence passes | Self-congratulation masquerading as QA |
| Goal loop | Plan, act, verify, continue | Task file, PR, issue, acceptance criteria | Goal condition met | Thrashing when the goal is vague |
| Scheduled loop | Wake, inspect, act, report | Cron, queue, memory, dashboard | Cadence run completed | Silent recurring drift |
| Operating loop | Sense, decide, delegate, review | Strategy, budget, approvals, open loops | Owner judgment plus evidence | Autonomy beyond authority |
| Question | Use the stack to decide |
|---|---|
| Is the agent just answering, or acting? | Turn loop vs tool loop. |
| Can success be proven? | Verification loop and evidence source. |
| Should it keep trying? | Goal loop with budget and no-progress stop. |
| Should it run later without you? | Scheduled loop with reporting and escalation. |
| Does it affect people, accounts, money, reputation, or production? | Operating loop with human approval boundary. |
The AI Loop Stack is a way to separate the layers of repeated AI work: token, turn, tool, verification, goal, scheduled, and operating loops.
Each layer repeats a different thing, stores different state, uses a different verifier, and needs a different stop condition.
For practical agent work, the verification loop and goal loop usually matter most because they decide whether the agent is converging or just staying busy.