Jeyanthi Thangiah

Build Loops That Compound

Verification is what separates a loop that compounds from one that merely repeats — Sonar's case for verified agent loops, a control-theory recipe for loop design, and how to bound loops that spin out.

Jeyanthi Thangiah4 min read

A loop that repeats is not the same as a loop that compounds. Verification is the difference between the two.

This is a deeper look at the agent-loop theme in my AI Engineer World’s Fair 2026 overview. It brings together the conference sessions on verification and loop design to explore how an agent can learn from feedback without getting stuck repeating the same mistakes.

The short version

  • Sonar's case that verification is what makes loops compound rather than merely repeat, and the practices it proposes
  • A control-theory recipe for loop design — set point, sensor, controller, actuator, disturbances — and the 7-step build pattern
  • The failure modes of unbounded loops (Ralph Wiggum loops, context spin-out) and how to bound them with human steering and flow control

The Verification Loop: Loops Without Verification Are Just Automation

"In the land of AI agents, the verifiers are king." — Tariq Shaukat, Sonar

Sonar’s presentation reported benefits from several verification practices. The percentages previously listed here lacked the study populations, denominators, and comparison setups needed to interpret them, so this revision retains the practices without those figures:

  • Repo-aware, project-specific context: evaluate whether better repository context reduces work on your tasks
  • Preemptive verification: test changes before release; using different models may diversify checks but does not guarantee independent errors
  • Verified code maintenance: investigate whether cleaner repositories improve outcomes and total cost, including maintenance effort
  • The proposed feedback loop: generate PRs → agent review → evals → quality gates; measure defects that escape it

Sonar packages this as ACDC — the Agent-Centric Development Cycle (sonar.com/acdc): a code maintenance loop (SonarQube in CI), an agentic loop with in-loop verification as the agent works (SonarVertex, SonarSweep), and a continuous improvement verification loop gated by quality checks. The tagline from their blog is the takeaway: "Loop engineering without verification is just automation." Verification is what makes loops compound rather than merely repeat.

Loop Design: A Control-Theory Recipe

Dex Horthy's loop-engineering session borrowed its vocabulary from control theory — treat the codebase as a dynamic system: a set point (desired end state), a sensor (measures the gap), a controller (decides the next small low-risk change — a skill), an actuator (the coding agent that applies it and opens a PR), and disturbances (teammates, dependencies, generated code). The central warning: a scheduled loop without steering drifts — human steering is what keeps it on track. Use cases: eradicating bad patterns, incremental framework adoption, maintaining a fork against upstream, mirroring a project into another language, keeping integrations current (example: react-doctor, which catches React slop and surfaces the top 3 fixes).

The 7-step build pattern:

  1. Build your sensor — define the problem
  2. Controller — pick iteration count, write a skill with resolution instructions
  3. Build your actuator — an agent, sized to complexity
  4. Specify the desired end state
  5. Build the loop in CI/CD via GitHub Actions
  6. Put a human in the loop — give the agent a feedback file loaded into context every run, handle /comment and /iterate PR feedback
  7. Add flow control — limit work-in-progress to one open PR per loop and wait for human review before stacking more

The reusable 4-component pattern: skill (judgment) + workflow (invocation) + agent-memory file (standing feedback) + PR bounding (WIP limit). Install: npx skills add humanlayer/skills --skill design-control-loop · docs.humanlayer.com.

Kyle Mistele's companion talk mapped the maturity progression — Loops → Swarms → Blind Ralph Loops — where the "Ralph Wiggum" loop (VentureBeat coverage, awesomeclaude.ai/ralph-wiggum, demo) is a loop that tries things, fails, and keeps going without noticing — named after the Simpsons character. The prescription for making even blind loops safe: build loops, treat output as write-only code, and invest in verification — which is exactly where Sonar's numbers come in. Production examples of loop-driven systems cited: DevGuild and OpenClaw.

Ralph Wiggum loops and context spin-out

  • A "Ralph Wiggum" loop tries things, fails, and keeps going without noticing — a blind loop with no verification
  • The standard "give the agent a goal and tools, loop until done" pattern can fail in production: agents lose coherence as context windows grow and spin out, repeating the same broken approach without noticing
  • A scheduled loop without steering drifts — human steering is what keeps it on track

HumanLayer's caution about unbounded loops applies to every rung of that ladder: the standard "give the agent a goal and tools, loop until done" pattern can fail in production because agents lose coherence as context windows grow and spin out — repeating the same broken approach without noticing. Most shipping "AI agent" products are actually deterministic code with LLM steps sprinkled in, per the 12-factor-agents manifesto (23k+ GitHub stars). For the highest-stakes tool calls, HumanLayer's Agent Control Plane moves approval out of application logic entirely: human approval is modeled as Kubernetes CRDs (ContactChannel, ToolCall), with a ToolCallPhase state machine (Pending → Running → AwaitingHumanApproval → ReadyToExecuteApprovedTool → Succeeded, with ToolCallRejected, AwaitingHumanInput, and AwaitingSubAgent branches) — making human oversight observable at the platform layer via kubectl, the same way you observe pod state, rather than buried in app code.

Try this next

  • Build your first control loop against one concrete problem (e.g. eradicating a bad pattern or keeping integrations current) using the 7-step pattern, running the actuator agent in CI/CD or on AgentCore Runtime
  • Bound every loop with flow control — one open PR per loop, human review before stacking more — and a standing agent-memory feedback file loaded each run
  • Put verification inside the loop, not just at the end: use a different model to verify output than the one generating it, and gate merges on quality checks

Continue in

AI Engineer World's Fair 2026

Agentic AI

AI Engineer World's Fair 2026

Four days, 300 speakers, 39 tracks. Five themes carried across all of it: harness engineering and software factories, agent loops, evals and observability, the unsettled argument about agent memory, and the shift from burning tokens to proving value.

Read post
AI Innovation

Evals Done Right

Improving an agent is a data-mining problem: collect traces, curate them, and let agents read the traces for you. Plus what it takes to survive the eval rollercoaster.

Read post