Skip to content
PKResources
Course outline

Agentic Engineering: the hands-on course · Module 4: Verification loops

Catching the classic failure modes

Agents fail in a handful of recognizable ways. Learn the eight I see most, where each one shows up, and the cheap tripwires that catch them before they reach main.

Lesson 16 / 24 · ⏱ 9 min

After enough agent runs, the failures stop being surprising. The same eight patterns come back, across tools, languages and codebases.

Once you can name them, you can catch them early. Better still, you can set tripwires so they catch themselves.

The field guide

Your checksThe diffWatching the runInvented APIscalls that don’t existPremature “done”success claimed, not runGaming the checktests bent, skipped, silencedScope creepunasked refactorsSilent fallbackserrors swallowed, defaultsReinvented helpersduplicates what existsLoopingsame fix, again and againContext driftearly constraints forgotten
Eight classic failure modes, grouped by where you're most likely to spot them.

A few notes on the ones that cost me the most:

  • Gaming the check is the dangerous one, because everything looks green. It’s why lesson 4.1 locks tests before implementation.
  • Premature “done” is fixed by never taking the agent’s word for it. Run the check yourself, every time.
  • Context drift and looping are context problems, not intelligence problems. Reset from a handoff note (lesson 2.4) instead of pushing on.

Set tripwires, not reminders

Reading every diff for all eight patterns is tiring. Some of them leave traces a script can find, so let a script find them. Here’s what I’d put in a pre-merge check or a PR checklist.

Tripwires for agent branches
- Test files changed that the brief didn't mention  → flag for review
- New suppression comments (lint-disable, type escapes, skipped tests)
                                                    → fail
- Dependency manifest or lockfile changed           → flag for review
- CI, build or lint config changed                  → flag for review
- Diff larger than the size you agreed in the brief → flag for review
- New functions whose names closely match existing ones → flag for review

Diagnose the run

🧠 Which failure mode is this?

Score: 0 / 6

  1. 1. The agent says 'all tests pass'. You run them: two fail.

  2. 2. The suite is green, but one test now expects 0 where it used to expect 42.

  3. 3. Twenty minutes in, it's trying the same config tweak for the fourth time.

  4. 4. A new formatDate() helper appears. The repo already has one in utils.

  5. 5. Payment failures now return an empty list instead of an error.

  6. 6. Three hours in, it starts using the logging library you banned in your first message.

That closes the verification module. Next, in Module 5, we scale up: several agents at once, headless runs and guardrails, all of which rely on the checks you just built.

Before you move on

✅ Key takeaways

0 / 4 completed