Loop stack

The AI 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

Seven loop layers, seven different ways to stop.

This control-column view shows work moving upward through the stack while each layer keeps its own exit gate.

triggerstateverifierbudgetapproval
01

Token loop

Sample, append, check stop

exitStop token or max tokens
02

Turn loop

User intent to assistant response

exitHuman feedback or task acceptance
03

Tool loop

Read, search, browse, run, write

exitTool result or observed state
04

Verification loop

Check, repair, recheck

exitEvidence passes
05

Goal loop

Plan, act, verify, continue

exitGoal condition met
06

Scheduled loop

Wake, inspect, act, report

exitCadence run completed
07

Operating loop

Sense, decide, delegate, review

exitOwner judgment plus evidence

Answer-first definition

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.

Details

Layer-by-layer map

LayerWhat repeatsStateExit conditionRisk if unbounded
Token loopSample, append, check stopContext windowStop token or max tokensRunaway text without useful work
Turn loopUser intent to assistant responseConversationHuman feedback or task acceptancePolished answers with no execution
Tool loopRead, search, browse, run, writeFiles, browser, APIs, logsTool result or observed stateSide effects without proof
Verification loopCheck, repair, recheckTests, sources, diffs, screenshotsEvidence passesSelf-congratulation masquerading as QA
Goal loopPlan, act, verify, continueTask file, PR, issue, acceptance criteriaGoal condition metThrashing when the goal is vague
Scheduled loopWake, inspect, act, reportCron, queue, memory, dashboardCadence run completedSilent recurring drift
Operating loopSense, decide, delegate, reviewStrategy, budget, approvals, open loopsOwner judgment plus evidenceAutonomy beyond authority

How to use the stack

QuestionUse 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.

Related patterns

Read loop engineering Study stop conditions