Token loop
Sample, append, check stop
Loop stack
AI loops stack from token generation to full operating systems. Each layer repeats something different, keeps different state, and needs a different exit condition.
Animated framework
This control-column view shows work moving upward through the stack while each layer keeps its own exit gate.
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 repeated AI work: 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. |