Loop Engineering: Three Loops That Make AI Agents Autonomous Software Builders
Andrew Ng breaks down Loop Engineering into three nested loops—Agentic Coding Loop (minutes), Developer Feedback Loop (hours), and External Feedback Loop (days)—showing how AI agents can now write, test, and iterate code autonomously while humans shift from QA to product direction and context injection.
First Loop: Agentic Coding Loop – AI Writes, Tests, and Fixes Itself
Andrew Ng describes the first loop as the Agentic coding loop . You give the AI agent a product specification and, optionally, a set of evals (datasets that measure performance). The agent then:
Writes code;
Tests its own work;
Iterates based on test results;
Continues until the code has no obvious bugs and meets the specification.
This closed-loop approach began accelerating in late 2023 and has become a game-changer that lets coding agents work for long periods without frequent human intervention. Ng illustrates with a personal example: over a weekend he built a typing-practice app for his daughter. The coding agent ran for about an hour, repeatedly checking the built result in a browser and reporting back, without any input from him.
This marks a watershed where AI programming moves from "code completion tool" to "engineering collaborator." The agent doesn't just generate snippets; it enters a continuous engineering loop: build, verify, fix, rebuild.
This Loop Runs Fast: A New Version Every Few Minutes
Ng emphasizes the speed: every few minutes the coding agent can build and test a new software version. He notes that developers are actively inventing more effective engineering loops, so this remains a highly active area of innovation.
For Chinese developers the implication is clear: future competitiveness isn't just "can you use AI to write code" but "can you design a high-quality loop that lets the agent make stable, meaningful progress." Key design questions include:
Is the specification clear enough?
Do tests cover critical paths?
Do evals measure what actually matters?
When the agent hits a problem, does it have a clear repair direction?
As AI gets stronger, engineering value shifts from writing code to designing loops and defining standards.
Second Loop: Developer Feedback Loop – Humans Graduate from QA to Product Judges
The Developer feedback loop is where the developer reviews the current product and steers the coding agent toward improvements. Ng observes that last year many developers (himself included) acted as QA for the agent—manually finding bugs and asking the agent to fix them. As agents become better at self-testing, human time spent on QA has dropped sharply.
This frees developers for higher-level product decisions such as:
Which key features to provide;
Which UI areas need improvement;
Whether user flows are logical;
Whether the product experience matches expectations.
This loop runs slower—typically tens of minutes to a few hours. The developer checks the product periodically and gives feedback. In the typing-app example, Ng continuously refined his own ideas: visual design, which cat costumes his daughter could unlock (she likes cats), and the login/guidance flow for parents.
An important insight: AI can implement quickly, but "what we want" often becomes clear only after seeing the implementation. Many products don't start with a perfect spec; they take shape through repeated viewing and judgment.
Human Value Is Not Just "Taste" but Context Advantage
Ng makes a crucial distinction. Many call the human contribution "taste," but he prefers context advantage : in most products he's involved with, humans know the users, scenarios, and operating environment better than the AI. The AI can summarize materials, analyze data, and suggest ideas, but it doesn't inherently possess the full context.
This explains why this loop cannot be fully automated: as long as humans hold information the AI lacks, a human-in-the-loop is needed to inject that knowledge. "Human-AI collaboration" isn't humans pressing buttons; it's humans continuously feeding user understanding, business constraints, aesthetic preferences, and scenario details into the system. The more AI can execute, the more humans must own direction.
Third Loop: External Feedback Loop – Bringing Real Users In
The External feedback loop includes methods such as:
Asking a few friends to try and give feedback;
Releasing to alpha testers;
Launching to production for A/B testing.
These methods are slow—rarely less than a few hours, often days or weeks. Yet they are critical because external feedback reshapes the product vision; the vision sharpens the detailed specification; the specification drives the coding agent to execute.
The three loops are not isolated. External feedback corrects direction, developer feedback turns direction into clearer specs, and the engineering loop lets AI implement specs rapidly. Chasing only the first loop risks building unwanted features fast; waiting only for external feedback forfeits AI's iteration speed. Real capability lies in synchronizing all three loops at their natural cadences.
AI Lets Engineers Take On Product Management Roles
Ng concludes that as coding agents accelerate development, more engineers are performing part of the product manager role. For engineers growing into this role, the hardest part isn't making AI write code—it's shaping product vision and balancing "keep building" with "get user feedback." Both are essential.
This, Ng argues, is where the article's greatest value lies. AI programming tools don't just boost engineer efficiency; they reshape team division of labor. When implementation cost drops, the scarce resources become:
Understanding of users;
Judgment of problems;
Trade-offs in product direction;
Ability to turn fuzzy vision into executable specs;
Ability to design effective feedback loops.
Takeaway for Teams: Don't Just Learn Tools, Learn to Design Loops
AI-era software development isn't about throwing requirements at a model once; it's about designing a set of loops that keep getting better.
For individual developers, start with a small project and deliberately practice three things:
Write clear specs so AI can independently build and test;
Regularly review versions, elevating feedback from "fix bugs" to "improve experience, adjust direction";
Get real users or friends trying it early—don't just iterate locally with AI.
For teams, ask: Does our AI agent have a testing closed loop? Does developer feedback crystallize into specs? Does real-user feedback promptly enter the next round of product judgment?
Loop Engineering matters not because it's a new buzzword, but because it reminds us: as AI gets better at execution, what truly determines outcomes is how humans organize iteration.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
