惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
美团技术团队
NISL@THU
NISL@THU
C
Cisco Blogs
SecWiki News
SecWiki News
N
Netflix TechBlog - Medium
Forbes - Security
Forbes - Security
Cloudbric
Cloudbric
雷峰网
雷峰网
T
Tailwind CSS Blog
博客园 - 司徒正美
The Register - Security
The Register - Security
L
LangChain Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Threat Research - Cisco Blogs
I
InfoQ
S
Schneier on Security
L
Lohrmann on Cybersecurity
量子位
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
Schneier on Security
Schneier on Security
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
K
Kaspersky official blog
Google DeepMind News
Google DeepMind News
Cisco Talos Blog
Cisco Talos Blog
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
D
Docker
N
News | PayPal Newsroom
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Hacker News: Front Page
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
Webroot Blog
Webroot Blog
MongoDB | Blog
MongoDB | Blog

Towards AI

Building AI Agents in Rust — part 4 | Towards AI The Verified Identity Agent Bridge | Towards AI You Can’t Prompt Your Away Your LLM Problems | Towards AI The Free Agent Trap | Towards AI Your Agentic Loop Will Drift. Here Is the KL Divergence Equation That Measures How Far It Has Wandered From Its Original Instruction. | Towards AI Beyond Chat: Processing Images, PDFs, and Documents with the OpenAI Adapter in Oracle Integration Cloud | Towards AI Building AI Agents in Rust — part 3 | Towards AI Self-Hosting Airflow at Home: Automating Stock Price Data Collection | Towards AI The 76-Hour Frontier: How the Takedown of Claude Fable 5 Birthed the Military-Industrial-AI Complex | Towards AI I Trained a Markdown File to Boost GPT-5.5 by 23 Points — It Shouldn't Work | Towards AI We Replaced ChatGPT With a Local AI Server. Six Months of Honest Data. | Towards AI What Really Makes Cars Pollute? A Data Science Deep Dive into CO₂ Emissions | Towards AI Training GPT-2 From Scratch on a GTX1050 | Towards AI Principal Component Analysis (PCA): Theory, Mathematics, and Applications Build a Zero-Cost Web Automation Pipeline With OpenRouter, OpenClaw, and MediaUse I Gave Qwen3.7-Plus a Screenshot and It Found the Exact Pixel to Click for $0.40 Beyond the Prompt: Why Autonomous AI Agents Are Replacing the Chatbot Moonshot Cracked Claude Code’s Playbook with an MIT Terminal Agent and a $0.60 Model Connections, Roles, and Warehouses: Getting CoCo Desktop Production-Ready from Day One My First $5,000 Month Writing About AI Engineering on Medium Google Shrank Gemma 4 by 72% and Unsloth Fixed the 4-Bit Bug Nobody Else Caught on One 4090, and 4-Bit Shouldn’t Be This Good LangChain Explained: Understanding Models, Prompts, Chains, Memory, Indexes, and Agents TOON: Beyond JSON for LLMs Claude Code Casual, Pro, Elite: The Three Working Personas of Claude Code Mastery MiniMax M3 Decodes 1M Tokens 15x Faster — and It Shouldn’t Be This Cheap Using Amazon SQS for AI Agent Orchestration I Ran a 1.5B-Active Model on My Laptop That Embarrassed a 26B by 46 Points How to Build a Self-Improving Company with AI Part 3 — Implementation/Engine-Level: Choosing the Runtime That Gives You These for Free Part 2 — Serve-Level Speed: System Design That Stabilizes P95/P99 3-Part Series: LLM Latency in Production (Part 1) Claude Code: The AI Coding Partner Changing How Developers Build Software Claude Code Pitfalls: Claude Code Won’t Do What You Told It: A Troubleshooting Catalog Full-Stack Data Scientists for the Agentic Coding World Building Production-Grade AI Skills with Snowflake Cortex AI Function Studio I Tried 10 AI Agent Frameworks in 2026 — Here’s the Honest Guide I Wish I Had Earlier How One Spring Boot Optimization Saved Our Startup $30,000 a Year Inside Palantir AIP: How the World’s Most Controversial AI Platform Actually Works What Is a Reverse Proxy? (And Why Every Backend Developer Should Care) What Claude Opus 4.8 Actually Changes If You’re Building Agents QWEN 3.7 Max Worked For 35 Hrs Straight And The Results Were Mind-blowing When LLMs Meet Knowledge Graphs on the Battlefield Fine-Tuning is Dead: Why Context Orchestration Won in 2026 5 Things Broke When I Shipped a RAG + MCP Agent to Production. Google Co-Scientist: Hyper Scaling Research and Discovery Microsoft Just Embarrassed Browser Web Agents — 1,000 Lines Made GPT-5.4 Beat Opus 4.6 on 200 Web Tasks The Modern Data Stack Is Broken — Here’s How to Fix It With AI, Governance, and Real Architecture Building Production MCP Servers: What the Spec Won’t Tell You When Should an Agent Stop? The Anatomy of Termination Harness Engineering: The Layer That Matters More Than the Model AI Engineers Who Can’t Debug Are Getting Fired (Here’s How I Debug with Claude Code) Claude Code Memory: Why You Keep Explaining the Same Thing to Claude (and the Five Layers That Fix It) Claude Code Subagents: The Claude Code Feature You Skip Every Day (And Why It Quietly Wrecks Your Sessions) Agentic AI and the SMB Banking Advantage Claude Code: Spec-Driven Development — Why Your AI Coding Sessions Fall Apart at Hour Three The Real Cost of Agentic AI Nobody Budgets For SVM : 40 must visit Interview Questions (Part 2) Your AI Agent Works Perfectly in the Demo. Here Are the 6 Ways It Dies in Production. Unleashing the Power of ONNX for Speedier SBERT Inference Terraform vs CI/CD for Serverless Deployments Merve Noyan Stopped Writing Training Scripts — Her Agent Just Fine-Tuned 18 Models Solo for $11.40 Why Your Sales Forecast Is Always 20% Wrong (And How To Make It 12% Wrong) Genetic Cubic n{C/A} Ratios For Elementary Robotics Design Top 20 AdaBoost Interview Questions & Answers (Part 2 of 2) Agentic AI Vs AI Agents — What Are the Key Differences? LAI #127: The Infrastructure Layer of AI Is Becoming the Product Anthropic Caught Its Own AI Planning to Blackmail Engineers RNNs Cannot Think What Transformers Think Cheaply. ICLR 2026 Proved the Gap Is Exponential. Time Series Made So Easy My Aunt Got It on the Second Read Claude Cowork 101 | Towards AI Is 3-Bit KV Cache the Holy Grail? A Reality Check on Google’s TurboQuant LangGraph Multi-Agent Architecture: Building a Self-Critiquing AI Debate System AutoML on Autopilot | Towards AI I Ran This Open-Source AI Tool on a Messy Codebase and Got 71x Fewer Tokens — Here Is Exactly What Happened Month in 4 Papers (April 2026) AI Kept Forgetting My Notes. Fixing That Taught Me How It Actually Works. How ChatGPT Makes You Addicted Crack ML Interviews with Confidence: K-Nearest Neighbors (KNN 20 Q&A) The Event-Driven Blueprint: How I Scaled a Spring Boot System to 10 Million Kafka Messages/Day Building Vector Search? Why FAISS Alone Isn’t Enough TAI #202: GPT-5.5 Moves Codex Into Real Work Machine Learning System Design -The Model Serving Triangle, With One Forward Pass Flowing Through Every Trade-off (Part3) AI Orchestration in Action: How MuleSoft and LLMs Fuel the Future of Enterprise AI GPT-4 Has 1.8 Trillion Parameters. It Uses 2% of Them Per Token. Part 20: Data Manipulation in Multi-Dimensional Aggregation A Fundamental Introduction to Genetic Algorithm -Part Two TAI #200: Anthropic’s Mythos Capability Step Change and Gated Release From Notebook to Production: Running ML in the Real World (Part 4) Sqribble’s Template‑Driven Document Automation Anthropic Just Shipped the Layer That’s Already Going to Zero Long-Term vs Short-Term Memory for AI Agents: A Practical Guide Without the Hype The L1 Loss Gradient, Explained From Scratch Your Postcode Is Deciding Your Care. I Built a Pipeline to Prove It. I Directed AI Agents to Build a Tool That Stress-Tests Incentive Designs. Here’s What It Found. Your System Prompt Is the Product — Not the Feature The LLM Wiki Trend Has a Retention Problem Nobody Mentions Top 20 Data Preparation Interview Questions and Answers (Part 2 of 2) LAI #122: Word Embeddings Started in 1948, Not With Word2Vec Top 15 Computer Vision Datasets [2026] 40 Generative AI Interview Questions That Actually Get Asked in 2026 (With Answers)
Loop Engineering: The Missing Governance Layer for Reliable AI Agents | Towards AI
Mike Oller · 2026-06-22 · via Towards AI

Author(s): Mike Oller

Originally published on Towards AI.

Loop Engineering: The Missing Governance Layer for Reliable AI Agents
credit Author: generated by GPT Image 2.0

By Mike Oller | AI Tool insider

I’ve spent the last year building AI agents that do real work — not just answer questions, but write code, generate reports, schedule tasks, and interact with production systems. And I’ve learned an uncomfortable lesson:

The smarter the model gets, the more damage it can do before you realize something went wrong.

A GPT-generated poem with a hallucinated fact is harmless. A GPT-generated API call that deletes a production database is not. And the difference isn’t the model — it’s the architecture around it.

This is the problem Loop Engineering sets out to solve.

The Problem with Today’s Agent Architectures

Most AI agent systems today follow one of two patterns:

Pattern 1: The One-Shot Wonder. Feed the model a prompt, get an output. Fast, cheap, and surprisingly capable — until the task needs more than one step. Then it drifts, forgets context, and produces outputs that look right but aren’t.

Pattern 2: The ReAct Loop. Reason, act, observe, repeat. This is the foundation of most modern agent frameworks (LangGraph, AutoGen, the Microsoft Agent Framework). It’s more powerful, but it’s also ungoverned — there’s no explicit mechanism for deciding when to stop, when to change course, or when to escalate to a human.

Both patterns share a fundamental blind spot: they treat reliability as a property of the model, not of the system.

credit Author: Generated by GPT Image 2.0

What Loop Engineering Proposes

Loop engineering re-frames the problem. Instead of asking “how do we make the model smarter?” it asks “how do we build a governance architecture that wraps around the model?”

Drawing on control theory (Wiener’s cybernetics), state machines, workflow orchestration, and reinforcement learning, the paper synthesizes six components that every reliable agent needs:

1. Goal Representation

Not just “write a blog post” but a structured definition: the task, the constraints (budget, time, safety rules), the success criteria, and the stop conditions. Without this, the agent has no fixed reference point. It’s a ship without a destination.

2. State Model

Five differentiated layers of state:

  • Static state: The goal, constraints, and configuration
  • Dynamic state: Current outputs, intermediate results
  • Tool state: Which tools are available, their status
  • Reflective state: Lessons learned from previous iterations
  • Governance state: Risk budget, cost budget, remaining iterations

Most agent systems collapse all of this into a single context window. Loop engineering explicitly separates them so the agent can distinguish between “what I’m trying to do,” “what I’ve done,” and “what I’ve learned.”

3. Action Executor

A controlled boundary around tool use. Every action passes through a risk check before execution. This is the difference between an agent that can call any API it wants and one that must ask permission before spending money or modifying files.

4. Observation Collector

The observation collector captures what actually happened — not what the agent intended to happen. This distinction matters because LLMs are famously bad at self-assessment. An agent might believe it successfully saved a file when the file system returned a permissions error.

5. Evaluator

Assesses four dimensions on every iteration:

  • Confidence: How sure is the agent about its next step?
  • Progress: Is it getting closer to the goal or spinning its wheels?
  • Drift: Has the agent wandered away from the original task?
  • Risk: Could the next action cause harm or exceed budget?

6. Controller

The controller is the decision-maker. Given the evaluator’s assessment, it decides one of:

  • Continue — execute the next action
  • Revise — change the plan
  • Rollback — undo the last action
  • Escalate — ask a human
  • Stop — terminate execution

This is the component most agent systems lack entirely. They have a model that decides what to do, but no mechanism for deciding whether to keep going.

Five Loop Types

Not every task needs the same loop structure. The paper identifies five:

credit Author: Generated by Typecraft AI created by Author inside Google Opal

These loops compose. A single task might cycle through planning, execution, and verification loops, all wrapped in a governance loop that keeps risk in check.

Where Current Architectures Fall Short

The paper offers a comparative analysis that’s worth laying out in full:

One-shot agents are fast and cheap but have no recovery mechanism. If the first output is wrong, you start over.

Unguided ReAct loops (the default in most frameworks) are flexible but have no formal termination condition. They keep spending tokens until the context window fills up or a human intervenes.

Workflow-orchestrated agents (e.g., Prefect, Airflow, AWS Step Functions) provide excellent traceability and governance — for the failure modes the author anticipated. The moment the task departs from the predefined graph, the system is brittle.

Loop-engineered agents are designed for the case where the plan emerges at runtime. The governance isn’t baked into a static graph; it’s baked into a dynamic policy set that applies on every iteration.

The Counterargument That Matters

The paper is unusually honest about its strongest objection:

“Mature workflow orchestration tools already provide state tracking, retries, human-approval gates, and audit logs. Isn’t loop engineering just relabeling existing capability?”

The response is worth quoting directly:

“Governance checks must run every iteration rather than only at exception points, because there is no design-time map of which iterations might fail.”

In a workflow-orchestrated system, you define the entire graph upfront. You know where the risky steps are because you placed them there. In a loop-engineered system, the plan is generated by the model at runtime. You don’t know which step 27 might be the one that tries to call an expensive API or delete a critical file. So you check at every step.

This is the core insight: when you can’t predict where the failure will happen, you need a governance layer that’s present everywhere.

When NOT to Use Loop Engineering

Refreshingly, the paper doesn’t claim universality. It explicitly identifies three cases where loop engineering is the wrong tool:

  1. Event-driven and reactive systems (responding to support tickets, infrastructure alerts) — the overhead of a continuous evaluation loop adds cost without adding value
  2. Deterministic ETL pipelines — if the task graph is fully known, workflow orchestration is the simpler and better choice
  3. One-shot tasks — if a single model call reliably produces acceptable output, building loop infrastructure isn’t justified

This matters because it’s rare to see a framework paper draw its own boundaries so clearly. It makes the stronger claim more credible: loop engineering isn’t everything, but for the class of problems it addresses, it’s the right tool.

The Governance Theater Risk

The paper also flags a trap I’ve seen firsthand:

“A controller that logs a risk classification on every action but never withholds approval is not governing; it is narrating.”

It’s possible to implement loop engineering superficially — to produce loop traces that look rigorous while the underlying thresholds are never calibrated to actually block unsafe actions. The paper’s evaluation rubric is partly a response to this: by scoring governance independently of task outcome, it makes superficial implementation visible to an external reviewer.

But the rubric can’t fully prevent a system designed to score well rather than behave well. That’s a problem for the community, not just the paper.

The Operationalized Evaluation Framework

One of the paper’s most practical contributions is its evaluation rubric. Rather than leaving assessment as a list of hand-wavy questions, it operationalizes each dimension with:

  • Strong-evidence anchors (what good looks like)
  • Weak-evidence anchors (what’s clearly insufficient)
  • Recommended data sources (the loop trace, final artifact)
  • Scoring procedure (strong / adequate / weak / absent)

Eight dimensions are scored: goal fidelity, state continuity, recovery, termination, governance, traceability, cost awareness, and human escalation.

Two scoring rules are particularly notable:

  1. Governance and human escalation should be scored independently of task outcome. An agent that completes a task by skipping an approval step should score weak on governance, even if the final output was correct.
  2. Termination should be scored using defined entropy and progress policies as the reference standard. This lets different implementations be compared on the same terms.

What This Means for Practitioners

If you’re building AI agents in production today, here’s what I’d take away from this paper:

First, audit your agent’s termination logic. Does it have explicit criteria for when to stop? Or does it rely on the model’s own judgment? If it’s the latter, you have a cost exposure you haven’t measured yet.

Second, separate your state layers. Don’t cram everything into one context. Keep your goal, your current progress, your lessons learned, and your budget in explicitly separate structures.

Third, implement risk-checked action boundaries. Every tool call should pass through a gate that asks: does this action exceed our risk budget? Our cost budget? Does it require human approval?

Fourth, log loop traces. Not for the logs’ sake — because if you can’t reconstruct why an agent took a particular action, you can’t debug it, audit it, or trust it.

The Bottom Line

Loop engineering is not a universal theory of AI agents. It is a useful framework for the class of agents that must execute complex, open-ended tasks under uncertainty, where the authority to halt, revise, or escalate is treated as a first-class design object rather than an implementation detail left to the model’s own judgment.

As AI agents move from chatbots to autonomous workers — from “could you help me draft this email” to “go manage my cloud infrastructure for the next hour” — the question shifts from can they think to can they be trusted.

Loop engineering is one serious answer to that question.

Mike Oller is the founder of AI Tool Insider, where he researches and builds AI agent systems. The full Loop Engineering paper, including the evaluation rubric, comparative analysis, and controller pseudocode, is available upon request.

*If you found this valuable:

  • Share it with someone building AI agents
  • Follow me for more on agent architecture, reliability, and production AI
  • Read the paper if you want the full framework with appendices and references*

Published via Towards AI