{"slug": "ai-loop-engineering-in-2026-how-to-build-a-gauntlet-loop", "title": "AI Loop Engineering in 2026: How to Build a Gauntlet Loop", "summary": "AI loop engineering, the practice of designing systems where AI agents act, observe, evaluate, and iterate until a success condition or boundary is met, has become a mainstream focus in 2026, according to a guide that outlines the three core elements of objective, metric, and boundary. The guide contrasts prompt engineering with loop engineering, noting that the latter involves a continuing process with multiple attempts, feedback from tests and tools, and durable state. It also highlights the Gauntlet Loop, a builder-versus-critic pattern popularized by Matt Shumer, as a specialized approach within this field.", "body_md": "## The Short Answer\n\n**AI loop engineering is the practice of designing a system in which an AI acts, observes the result, evaluates it against a defined standard, improves the work, and repeats until a success condition, safety boundary, budget, or escalation rule stops it.** You define the objective, metric, and boundary; the loop replaces your manual chain of follow-up prompts.\n\n## On this page\n\n## What Is an AI Loop?\n\nAn AI loop is a repeating feedback cycle. The agent does not merely produce an answer and wait for you. It takes an action, examines what actually happened, compares the result with a target, changes its approach, and tries again.\n\nFor code, that may mean edit, run tests, read the failure, revise, and rerun. For a website, it may mean render, inspect screenshots at several screen sizes, compare them with reference sites, fix the largest visual gap, and render again. For a book, it could mean draft a chapter, check it against the outline and style examples, ask a fresh editor to find the weakest passage, revise, and continue.\n\nThe action-feedback pattern is not brand new. Research systems such as [ReAct](https://arxiv.org/abs/2210.03629) formalised cycles of reasoning and action years ago. What changed in 2026 is that mainstream agent tools made long-running goals, subagents, scheduled work, durable skills, and tool use much easier to combine. That pushed the conversation from writing a better individual prompt to designing the system that keeps prompting, checking, and continuing.\n\n## The Three Core Elements: Objective, Metric, Boundary\n\nUse **objective, metric, and boundary** as the smallest useful design card for a loop. It is simple enough to remember and strict enough to expose vague thinking before an expensive run begins.\n\n| Element | Question it answers | Weak version | Useful version |\n|---|---|---|---|\nObjective |\nWhat must become true? | “Make the site better.” | “Rebuild the pricing page so a first-time visitor can compare all plans and complete checkout on mobile.” |\nMetric |\nWhat evidence proves an attempt improved or passed? | “It looks professional.” | “No accessibility violations, no horizontal overflow at 360px, all checkout tests pass, and a fresh critic prefers our hierarchy to the approved reference.” |\nBoundary |\nWhat may it change, and when must it stop? | “Keep going until perfect.” | “Do not deploy or alter billing. Stop after four hours, £25 of model usage, three failed approaches, or any blocker requiring credentials.” |\n\nThese three elements are the minimum, not the complete machinery. Serious loops also need tools, observable feedback, durable state, error recovery, permissions, and an escalation path. Without those, the loop may repeat, but it cannot reliably learn from the last attempt.\n\n## Prompt Engineering vs Loop Engineering\n\nPrompt engineering asks, *“What should I tell the model right now?”* Loop engineering asks, *“What system should decide what the model does next, how the result is checked, what it remembers, and when control returns to me?”*\n\n| Prompt engineering | Loop engineering | |\n|---|---|---|\n| Unit of work | One request and response. | A continuing process with multiple attempts. |\n| Who supplies the next step? | Usually the human. | The loop chooses the next action from evidence. |\n| Feedback | Often your written follow-up. | Tests, screenshots, benchmarks, tool results, critics, or approval gates. |\n| Memory | The current conversation. | Conversation plus files, logs, issue trackers, plans, or other durable state. |\n| Stopping | You stop prompting. | A success, failure, budget, safety, or escalation condition fires. |\n\nThis is not the death of prompting. Every stage of a loop still needs clear instructions. The loop supplies the architecture; prompts tell the planner, builder, critic, and verifier how to perform their part.\n\n## What Is the Gauntlet Loop?\n\n[ Matt Shumer](https://x.com/mattshumer_) calls his specialised builder-versus-critic pattern the\n\n**Gauntlet Loop**. He popularised it through the\n\n[Claude of Duty](https://github.com/mshumer/Claude-of-Duty)experiment: one short orchestration prompt started a many-hour run that produced a technically ambitious browser-based first-person shooter in Three.js.\n\nThe pattern is simple:\n\n- Give a lead agent an ambitious goal and a concrete example of what great looks like.\n- Let it split the artifact into the smallest parts that can be improved and judged independently.\n- Assign each important part to a builder.\n- Give the actual output to a separate critic with fresh context.\n- Have that critic compare the output directly with the reference, ideally as a blind A/B test.\n- If your output loses, identify the largest meaningful gap and send it back for another round.\n- Repeat until the result reaches the bar, improvements stop being worth the cost, a boundary fires, or you stop the run.\n\n### Credit and scope\n\nCredit Matt Shumer for the *Gauntlet Loop* name and this specific method. AI feedback loops and loop engineering are broader ideas with earlier research and practices behind them. The Gauntlet is one powerful pattern inside that larger field.\n\n## The Original “Claude of Duty” Prompt\n\nShumer published the complete prompt with the project. Its strength is not architectural detail. It gives the agent a destination, an external quality bar, permission to decompose the work, independent critics, and permission to continue.\n\n```\nI want you to build a first-person shooter at the level of the most recent\nCall of Duty games. It should be utterly perfect, visually beautiful, with\nevery single thing done at AAA quality—from textures to physics to anything\nyou could think of.\n\nFan out sub-agents and have sub-agents tackle each one individually so that\nthe game is utterly perfect. You should /loop on each item and have a separate\nsub-agent check it visually to ensure it looks triple A. That separate\nsub-agent should be a really harsh critic, and if it doesn't look triple A,\nit should keep going.\n\nDon't stop until each sub-agent is utterly wowed with the quality when compared\nwith the actual Call of Duty game. It should literally compare them side by\nside blind and say which one looks better. Do this in ThreeJS. /loop until\nit's utterly perfect. Fan out sub-agents and ultracode.\n```\n\n### The quality bar was a compass, not the final score\n\nThe prompt asked for Call of Duty quality, but the public project does not prove that a browser prototype reached AAA parity. Shumer’s own honest assessment says every blind comparison still preferred the real Call of Duty frame. The useful result is the process: the demanding reference kept a long-running agent improving instead of stopping at “good for AI.”\n\n## Why This Prompt Works\n\n### 1. It specifies the destination, not the route\n\nThe agent is told what success should resemble, then allowed to choose the architecture and work breakdown. That leaves room for a capable model to discover systems the user may not know to request.\n\n### 2. It uses a real, inspectable bar\n\n“Make it amazing” is impossible to grade. Actual reference screenshots can be placed beside the rendered game. Code can use a test suite, performance budget, security checklist, or reference implementation. Writing can use an approved outline, fact sheet, and samples that demonstrate the desired clarity without asking the model to copy another author’s voice.\n\n### 3. It decomposes the artifact\n\n“Improve the whole game” is too large for useful feedback. “Compare these weapon hands with the reference and fix the largest anatomical gap” is small enough to attack repeatedly. Decomposition also makes genuinely independent work parallelisable.\n\n### 4. The builder does not grade its own homework\n\nA builder remembers every compromise and can explain why its choices are reasonable. A fresh critic receives the goal, rules, reference, and real artifact without the builder’s justifications. That separation reduces self-approval, although it does not make an AI judge infallible.\n\n### 5. The critic inspects the artifact, not a summary\n\nFor visual work, inspect pixels. For software, run the product and tests. For research, open the sources and trace each claim. For prose, read the finished draft. A polished progress report is not evidence that the underlying work is good.\n\n### 6. It does not impose an arbitrary final round\n\nThe loop continues while meaningful gaps remain. In production, pair that persistence with explicit time, token, money, permission, and diminishing-return boundaries. “Until perfect” is motivating language; it is not a safe stop condition by itself.\n\n### 7. It can finish with an integration pass\n\nWhen many builders improve separate pieces, local quality can rise while the complete artifact becomes inconsistent. A final fresh agent should inspect the whole result, resolve conflicts, and smooth the seams without redesigning everything.\n\n## Two Approaches, Kept Separate\n\nThe phrase “AI loop” is currently used for several related workflows. The clearest way to avoid confusion is to separate the immediate prompting pattern from the wider engineering discipline.\n\n| Prompt-led Gauntlet Loop | Engineered recurring loop | |\n|---|---|---|\n| What it is | One orchestration prompt starts a split, build, criticise, and revise run. | A reusable operating system around one or more agents. |\n| Setup | No bespoke loop code if the harness already has tools, long-running goals, and subagents. | Usually needs triggers, state, connectors, permissions, verification, and recovery design. |\n| Best for | One ambitious, inspectable artifact: a game, site, design, chapter, report, or campaign. | Recurring work: issue triage, CI investigation, nightly tests, monitoring, migrations, and repeated reports. |\n| Quality signal | Fresh critics compare the real artifact with a concrete reference bar. | Automated tests, operational metrics, policies, logs, reviewers, and human approvals. |\n| State | May live mainly in the active project and run. | Must persist outside one conversation in files, databases, issue trackers, or queues. |\n| Stopping | The output wins, the user stops it, or a practical boundary fires. | Explicit success, failure, retry, budget, risk, and escalation rules. |\n\nThere is also a useful middle ground: a native persistent **goal**, where supported, keeps a completion condition alive across turns. A scheduled **loop**, where supported, runs a task on a cadence. Product commands change, so treat them as implementation shortcuts rather than the definition of loop engineering.\n\n## How to Run a Gauntlet Loop Without Building a Framework\n\n### Step 1: Use an actual agent\n\nDo not paste the prompt into a normal chatbot and expect the full result. Use an agentic environment such as Claude Code or Codex that can inspect and edit files, run code or tests, render outputs, use tools, maintain project state, and create separate agents where supported.\n\n### Step 2: Supply the goal and the bar\n\nName the outcome and attach or link to references the critic can actually inspect. If you do not know the best benchmark, make finding a defensible benchmark part of the task.\n\n### Step 3: Declare boundaries before the run\n\nState what the agent may change, what is forbidden, how long or how much it may spend, and which actions require your approval. For software, keep production deployment, destructive database changes, credentials, customer messages, and paid services behind explicit gates.\n\n### Step 4: Let the lead agent choose the decomposition\n\nAsk it to divide the work into independently judgeable parts. Do not parallelise tightly coupled systems merely because more agents are available. The Claude of Duty repository notes that broad fan-out performed worse than sequential ownership for coupled visual systems.\n\n### Step 5: Require fresh-context criticism\n\nThe critic gets the specification, benchmark, and artifact—not the builder’s chain of decisions. It should name the largest remaining gap, provide evidence, and return a concrete correction target.\n\n### Step 6: Record progress and failed approaches\n\nKeep a compact progress file or live workbench containing the current target, completed parts, failed approaches, evidence, next action, and remaining boundaries. Long chat histories rot; the project should remember even when an individual agent does not.\n\n### Step 7: Stop deliberately\n\nStop when the success criteria pass, improvement becomes too small to justify another round, the budget is exhausted, the same failure recurs without a new strategy, risk rises, or human judgment is required. Then run the integration pass and review the final artifact yourself.\n\n## Copy-Paste Gauntlet Loop Templates\n\n### Template 1: Minimal, transferable Gauntlet prompt\n\nThis keeps the spirit of Shumer’s original: a high bar, minimal prescription, agent-chosen decomposition, and independent critics.\n\n```\nI want you to create <DELIVERABLE> that achieves <OBJECTIVE> at the quality\nlevel of <CONCRETE REFERENCE OR MEASURABLE BENCHMARK>.\n\nChoose the approach. Break the work into the smallest important parts that can\nbe improved and judged independently. Fan out builders only where the work is\ngenuinely independent. Give every important part a separate, harsh critic with\nfresh context.\n\nEach critic must inspect the real output—not the builder's summary—and compare\nit directly with the reference or metric, using a blind A/B comparison where\npossible. If our result loses, identify the largest meaningful gap, return it\nto the builder, and run another round.\n\nKeep looping until the output meets <SUCCESS CONDITION>, improvements no longer\njustify another round, or one of these boundaries fires: <TIME / COST / ATTEMPT /\nPERMISSION / SAFETY BOUNDARIES>. Escalate blockers that require human judgment.\n\nFinish with one fresh integration critic that checks the complete artifact for\nconsistency, correctness, and fit with the original objective.\n\nFor coding, use <PROGRAMMING LANGUAGE / FRAMEWORK>. Do not deploy, spend money,\nuse credentials, contact people, or make irreversible changes without explicit\napproval.\n```\n\n### Template 2: Objective, metric, boundary loop card\n\nUse this version when reliability and cost matter more than dramatic language.\n\n```\nOBJECTIVE\n<Write the exact outcome that should become true.>\n\nINPUTS AND STATE\nUse: <files, sources, tools, project, previous progress file>.\nRecord after every round: what changed, evidence, score, failed approach,\nnext action, and remaining budget.\n\nMETRIC / VERIFIER\nSuccess requires all of the following:\n- <objective test, benchmark, or factual check>\n- <quality rubric or reference comparison>\n- <integration, accessibility, safety, or editorial check>\n\nPROCESS\n1. Inspect the current state.\n2. Choose the highest-impact unmet criterion.\n3. Make one coherent improvement.\n4. Run the real verifier.\n5. If it fails, feed the evidence into a changed strategy and repeat.\n6. If it passes, run a fresh independent final review.\n\nBOUNDARIES\nAllowed actions: <read, draft, edit, test, render>.\nForbidden without approval: <deploy, delete, purchase, publish, message, secrets>.\nStop and report when: success passes; <N> attempts finish; <TIME/COST> is\nreached; the same blocker repeats; or uncertainty exceeds <THRESHOLD>.\n```\n\n## Three Examples Beyond the Original Game\n\n### 1. Write and edit a book\n\n**Objective:** Produce a complete 45,000-word practical guide that fulfils an approved chapter outline.**Metric:** Every claim traces to the supplied research; every chapter passes the outline, continuity, repetition, clarity, and target-reader rubrics; a fresh editor identifies no blocking issue.**Boundary:** Maximum five critic rounds per chapter, no invented sources, no copying the style of a living author, and human approval before the manuscript is called final.**Gauntlet split:** Research coverage, argument, chapter structure, examples, prose, fact-checking, and final continuity can have distinct reviewers.\n\n### 2. Build a high-converting website\n\n**Objective:** Build a responsive product page that explains the offer and completes the existing signup journey.**Metric:** Compare screenshots with approved reference sites; pass accessibility and interaction checks; meet the performance budget; show no overflow at agreed viewports; keep all existing form behavior working.**Boundary:** Work locally, preserve analytics and legal copy, use the approved stack, do not deploy, and stop after the agreed budget or two rounds with no measurable gain.**Gauntlet split:** Information hierarchy, visual system, responsive behavior, copy, accessibility, performance, and end-to-end signup each receive the right kind of critic.\n\n### 3. Complete a software feature\n\n**Objective:** Implement the scoped feature in`<LANGUAGE / FRAMEWORK>`\n\nwithout changing unrelated behavior.**Metric:** Acceptance tests, unit tests, lint, static analysis, security checks, and an independent review against the issue all pass.**Boundary:** No production changes, schema deletion, new paid dependency, or unrelated refactor; stop on missing requirements or exhausted time and report the evidence.**Gauntlet split:** Exploration, implementation, tests, security, usability, and final spec verification can be separated—but tightly coupled code should keep a coherent owner.\n\n## Where AI Loops Fail\n\n**The goal is subjective.**“Perfect” creates motion without a dependable finish line. Add inspectable evidence.** The builder is the only judge.**Self-critique tends to defend earlier decisions. Use a fresh verifier.** The metric is gameable.**Passing one narrow score may damage the real objective. Use several guardrails.** There is no budget boundary.**Unreachable bars can burn tokens, time, and tool costs indefinitely.** The loop repeats instead of adapts.**The same failed action with the same evidence is spinning, not learning.** Context rots.**Preserve compact state and prune stale history instead of carrying every token forward.** Agents collide.**Use isolated workspaces for independent changes and coherent ownership for coupled systems.** Progress is self-reported.**Require tests, screenshots, logs, diffs, citations, or another observable receipt.** Permissions are too broad.**Start read-only or reversible; gate deployment, deletion, spending, and communication.** Humans surrender judgment.**Autonomy increases the need for review, understanding, and accountability.\n\n### When not to use a loop\n\nDo the task manually first when you cannot yet describe success. Avoid broad autonomy when mistakes are expensive or irreversible, the agent cannot observe the true result, sensitive data or permissions would be exposed, or one careful human pass is cheaper than building and reviewing the loop.\n\n## AI Loop Engineering Checklist\n\n- Write the outcome as a state that can become true.\n- Select evidence the agent can inspect directly.\n- Define success and failure separately.\n- Cap time, attempts, cost, permissions, and risk.\n- Give the loop the tools needed to observe real results.\n- Persist state outside the current conversation.\n- Separate builders from verifiers where the second opinion matters.\n- Parallelise only independent work.\n- Require a changed strategy after repeated failure.\n- Keep a human approval gate for consequential actions.\n\n## Sources Used\n\nThis guide separates Shumer’s specific Gauntlet pattern from the wider loop-engineering discussion and uses the public repository for the case-study claims:\n\n[Matt Shumer — How to Run a Gauntlet Loop](https://somethingbig.ai/gauntlet-loop)[Claude of Duty — original prompt](https://github.com/mshumer/Claude-of-Duty/blob/main/prompt.md)[Claude of Duty — public repository and honest assessment](https://github.com/mshumer/Claude-of-Duty)[Addy Osmani — Loop Engineering](https://addyosmani.com/blog/loop-engineering/)[MindStudio — What Is Loop Engineering?](https://www.mindstudio.ai/blog/what-is-loop-engineering-ai-coding-agents)[The Pragmatic Engineer — What is “loop engineering?”](https://newsletter.pragmaticengineer.com/p/what-is-loop-engineering)[freeCodeCamp — Prompt Engineering vs Loop Engineering](https://www.freecodecamp.org/news/prompt-vs-loop-engineering-a-guide-for-developers/)[ReAct — Synergizing Reasoning and Acting in Language Models](https://arxiv.org/abs/2210.03629)\n\n## Frequently Asked Questions\n\n### What is AI loop engineering?\n\nAI loop engineering is the practice of designing a persistent cycle in which an AI agent acts, observes the real result, evaluates it against a defined metric, revises its work, records useful state, and repeats until a success condition, safety boundary, budget, or escalation rule stops the run.\n\n### What are the three core elements of an AI loop?\n\nEvery useful AI loop needs an **objective** that defines the desired outcome, a **metric** or verifier that decides whether each attempt is good enough, and a **boundary** that limits time, cost, attempts, permissions, or risk and tells the loop when to stop or escalate.\n\n### What is a Gauntlet Loop?\n\nThe Gauntlet Loop is Matt Shumer’s prompting method for high-quality agent work. A lead agent decomposes a goal into independently judgeable parts. Separate builders create each part, fresh-context critics compare the real output with a concrete reference bar, and failed parts return for another round.\n\n### Does a Gauntlet Loop require coding or setup?\n\nYou do not need to build custom loop software if your agent harness already supports the necessary capabilities. You do need an agentic environment such as Claude Code or Codex that can use tools, inspect the actual artifact, and delegate to separate agents. A normal chat window cannot reproduce the complete workflow.\n\n### What is the difference between a Gauntlet Loop and loop engineering?\n\nA Gauntlet Loop is a specific quality-improvement pattern that can begin with one prompt: split, build, judge independently, and repeat. Loop engineering is the broader system discipline around recurring agent work, including triggers, tools, isolated workspaces, memory, permissions, verification, budgets, recovery, and human escalation.\n\n### When should you not use an AI loop?\n\nDo not give an AI loop broad autonomy when success is subjective and no reliable reviewer exists, mistakes are costly or irreversible, required data or permissions are unsafe to expose, or the work is faster to do once manually. Start with read-only or easily reversible tasks.", "url": "https://wpnews.pro/news/ai-loop-engineering-in-2026-how-to-build-a-gauntlet-loop", "canonical_source": "https://www.thepromptindex.com/ai-loop-engineering-gauntlet-loop-guide.html", "published_at": "2026-08-11 17:25:55+00:00", "updated_at": "2026-08-11 17:42:58.051737+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "ai-tools", "ai-research"], "entities": ["Matt Shumer", "ReAct"], "alternates": {"html": "https://wpnews.pro/news/ai-loop-engineering-in-2026-how-to-build-a-gauntlet-loop", "markdown": "https://wpnews.pro/news/ai-loop-engineering-in-2026-how-to-build-a-gauntlet-loop.md", "text": "https://wpnews.pro/news/ai-loop-engineering-in-2026-how-to-build-a-gauntlet-loop.txt", "jsonld": "https://wpnews.pro/news/ai-loop-engineering-in-2026-how-to-build-a-gauntlet-loop.jsonld"}}