# Teaching AI Agents to Forget Bad Lessons and Grade Blind

*Published: December 1, 2026 | Topics: AI Orchestration, Multi-Agent Systems, Context Engineering, Verification Systems, Systems Architecture*

> **TL;DR:** Once deterministic runtime hooks stop an AI agent from breaking Git or mutating live platforms, the hardest failures shift from safety to judgment. Splitting planner and worker quota pools, handing risky diffs to a context-blinded read-only verifier, and consolidating mid-failure notes into real automated checks keeps a multi-agent workflow sharp without inflating prompt overhead.

Last week I finally stopped worrying about whether my coding agents would wipe out uncommitted work or push straight to `main`. Moving those boundaries out of prose and into [deterministic runtime hooks](/blog/why-prompt-rules-fail-deterministic-guards-ai-agents) fixed the loud, scary failure modes. Pushing to a working branch flows without nagging me, while any push to `main`, a merge, a force push, a destructive git reset, or a write to a live external platform stops cold and asks for my explicit yes. Reads pass silently.

Once those guardrails were in place and the cross-platform runtime quirks were ironed out, something more interesting happened. The system stopped breaking things loudly, which made it much easier to see where its judgment was quietly breaking down. Over the past few days of real project work, three unexpected cracks showed up: hidden model routing under an orchestrator, confirmation bias during final reviews, and a learning loop that was actively teaching my agents bad habits.

## What the Orchestrator Was Actually Spawning Under the Hood

I run the same orchestration setup across two different agentic coding environments, and I thought I understood how subagent model selection worked. In standalone sessions, asking a subagent to inherit the session model did exactly what you would expect: it spawned a worker on the same model tier I was already talking to.

Then I tested an orchestrator session and actually opened the raw runtime logs instead of trusting the UI label. Surprise: a subagent configured to inherit the session model was not inheriting the heavy planning model at all. Under the hood, the orchestrator silently routed it to a lightweight internal worker model. On small mechanical edits that barely mattered, which is why I missed it at first. On multi-file architecture work, the quality drop was obvious once I knew where to look.

Fixing that led to a much cleaner side effect around rate limits. Instead of letting one configuration guess what model gets spawned, I split the routing strategy cleanly. Standalone sessions spawn workers matching their own model, while orchestrated sessions explicitly pin dedicated worker models on a separate rolling five-hour quota window while the heavy planner draws from its own weekly pool. Planning and implementation stopped cannibalizing the same usage limit mid-afternoon.

## Why an Agent Should Never Grade Its Own Risky Work

The second crack came from watching how my lead coordinator agent handled final reviews. Even with strict diff checks and required test logs, one session was doing the planning, steering retries, reading the worker's justification, and deciding whether the change was ready to commit. Humans develop tunnel vision when they review their own pull requests after an hour of debugging. Models do the exact same thing, except faster and with more confidence.

After listening to a talk from an Anthropic engineer about long-running asynchronous agents, I borrowed one idea that solved this without adding bloat: a context-blinded independent verifier. I do not run it on routine tasks, because spawning a second reviewer for a copy tweak or a simple bug fix just burns quota for no reason. It only triggers on changes that actually hurt if they slip through: authentication or security logic, database schema updates, public API contracts, and one final pass before merging a large working branch.

The entire trick is what I deliberately withhold from it. The verifier starts as a fresh read-only agent with zero write permissions. It does not get the implementation plan. It does not get the programmer's summary report or excuses. It does not get my lead agent's opinion that everything looks fine. It receives only three things: what the change was supposed to achieve, the actual code diff, and the tail of the verification test log. Without the backstory of how hard the bug was to fix, it grades cold and flags concrete file and line defects instead of nodding along.

## Why Self-Improving Agents Learn Superstitions (And How "Dreaming" Fixes It)

The third flaw was my own fault, because I had built a post-failure learning loop that sounded smart on paper. Whenever a task failed verification, the agent recorded a one-line lesson in a compact summary file so it would not repeat the mistake on the next wave. In practice, writing permanent lessons in the middle of a broken build is a terrible time to decide what is true.

Mid-failure, an agent often misdiagnoses the first symptom it sees. It writes down a confident rule that only applied to a broken intermediate commit, or worse, a completely wrong theory about a library quirk. Two sessions later, that bad memory is still sitting in context, nudging the agent around ghosts that do not exist. At the same time, whenever I stepped in manually during a chat to correct the agent's approach, those human corrections were never captured systematically at all.

The second idea I adapted from that async-agent talk is what people call dreaming: a memory consolidation pass at the very end of the work, once the dust has settled and the real code is green. Now lessons are captured from both failed checks and my own mid-flight corrections, but they are treated as temporary scratch notes until the finish line. At the end, the lead agent audits every single note against the final code and commit history, deletes anything that turned out false or purely local, and sorts the survivors into three buckets for my approval:

1. Anything a machine can catch gets proposed as an automated test, a lint rule, or a verification command instead of another line of Markdown. If a rule was already written down and still got broken, it automatically belongs here. A test does not get tired; a prompt does.
1. At most three durable, project-specific lessons are proposed for the project's permanent memory, and nothing gets written until I explicitly say yes.
1. Lessons about my own orchestration harness itself are separated out and handed to me as ready-to-review notes. The agent is never allowed to silently edit its own core setup.

## The Features I Deliberately Refused to Add

What makes me happiest about this whole iteration is not what went in, because both the blinded verifier and the memory consolidation pass fit in under thirty lines and only load during structured multi-file workflows. Everyday chats pay zero extra tokens, and the always-on core rules stayed trimmed down to roughly 560 tokens.

The harder engineering discipline was saying no to popular multi-agent trends that look impressive in demo videos and fall apart in daily work. I refused to spin up parallel build and test subagents writing code and tests blindly at the same time; it doubles quota burn per task and requires heavy formal interface specs that slow down real iteration. I refused to hoard hundreds of community skills in global config. And I intentionally put off executing chained external API calls inside generated scripts until I can prove live that a script cannot slip past our write-protection hooks.

Every time I strip another clever idea out of my agent harness and replace it with a plain check, a smaller boundary, or a fresher pair of eyes, the whole system gets calmer and faster to trust. The loudest agent setups make great screenshots, but the quiet ones actually ship.

## Frequently Asked Questions

### Why does an AI agent struggle to accurately verify its own code changes?

When the same chat session plans a task, debugs failures, and reviews the final result, it carries all of its own rationalizations in context. A fresh read-only verifier that sees only the target outcome, final code diff, and test log avoids that confirmation bias.

### Why can self-improving AI agents get worse over time when they record lessons automatically?

Notes written in the middle of a failing build are often wrong, overly broad, or true only for one broken intermediate state. Without an end-of-run consolidation pass that checks lessons against the final working code, stale notes turn into superstitions that sabotage future tasks.

### When should a recurring AI agent mistake become a test instead of a Markdown rule?

Whenever a machine can detect the mistake automatically, and always whenever a written rule was already in memory and got broken anyway. Automated tests and lint checks never lose attention across long sessions.
