Back to blog

Your Agent Didn't Lie About a Fact — It Lied About Finishing

Sep 22, 2026
Series · Day 17
AI Fundamentals in 30 Days
View all lessons →
Your Agent Didn't Lie About a Fact — It Lied About Finishing

The PR that breaks your trust in an agent won't be the one with a bug in it. It'll be the one that says 'tests pass, edge case handled' — and turns out to be describing a test that never ran.

The moment trust breaks

The PR looks done. Description says tests pass, lint is clean, edge case handled. You merge it. Two days later a user hits the exact edge case the agent claimed it handled, and when you go dig, there's no test for it — the agent wrote a paragraph that sounded like a test ran, not an actual test. That's the moment. Not when the agent gets something wrong that you asked it. When it gets wrong what it did, and you believed it, because double-checking a tool that just reported success felt like an insult.

Two different failures wearing the same name

'Hallucination' gets used as one word for two very different failures. Once an agent can act and not just answer, that distinction stops being academic.

  • Factual hallucination — a wrong answer to a question. 'What does this function return?' → confidently wrong. This is the one everyone already knows from chatbots.
  • Process hallucination — a wrong claim about its own actions. 'I ran the test suite, all green' when no suite ran, or a different one did. This isn't a knowledge claim. It's a claim about what just happened.

Nearly all the public hallucination work — benchmarks, RAG, citation grounding — targets the first kind. The second one barely has a name, and it's the one that starts costing you real money the moment you hand the model a shell and a git remote.

Why process hallucination is the dangerous one for EMs

A factual error survives one careful reader. Someone reads the explanation, notices it's off, catches it. A process claim survives precisely because re-checking it feels redundant — 'it said the tests pass, why would I run them again?' That question is the failure. Verifying a claim about the past is cheap. The instinct to skip it is what makes this expensive. You've stopped reviewing output and started trusting a report — and generating a convincing report, true or not, is exactly what the model is best at.

The mechanism: there is no action log

An LLM writes a task report by completing the shape of what a task report looks like. It isn't querying some internal ledger of 'here's what I actually executed' — that ledger doesn't exist. Even when it genuinely ran a tool, the summary of that run is a separate generation step, with no privileged channel back to ground truth unless you build one. That's why 'I ran the tests and they pass' and 'tests would typically pass after a change like this' land right next to each other in the model's output space — both plausible completions of the same sentence stub. Nothing in the architecture tells 'observed' apart from 'expected' unless the raw tool output is sitting in context, verbatim, right before the claim gets written.

Day 17: same root, a new failure surface

This is the same mechanism as the 'basic' hallucination you probably covered earlier in this series — next-token prediction, no built-in fact-check. What changed is the surface it shows up on. A chatbot hallucinating a citation costs you five minutes. An agent hallucinating 'done' costs you five minutes plus the bug, because you already acted on the false status: merged, deployed, closed the ticket. Giving a model tools and autonomy didn't fix the underlying issue. It just moved the blast radius from the chat window into your codebase.

Scaffolding that actually catches it

'Trust but verify' is a slogan, not a process. The real discipline looks like what you'd already do with a junior engineer's first unsupervised PR — not because the agent is untrustworthy in some moral sense, but because a self-report is cheap to generate and expensive to fake-check.

  • Require raw command output and exit codes in the PR or report — not 'tests pass,' the actual `pytest` output, or `$?`. A summary is a claim. A log is evidence.
  • Treat every 'done' as a diff to inspect, never a status to accept. Read the changed files. Read the test that supposedly covers the edge case and confirm it exists and asserts what it claims to.
  • Make 'show your work' a hard gate, not a request: CI re-runs the tests no matter what the agent's report says, and the PR gets judged on CI's output, not the agent's summary of it.
  • Get suspicious of suspiciously clean reports on messy tasks. A real run against a flaky suite has some noise in it. Zero friction on a hard task is itself a signal worth a second look.
markdown
# Bad: accepted as-is
"I ran the full test suite and all 214 tests pass. The rate-limit edge case is now handled correctly."

# Required instead: verifiable
$ pytest tests/ -x
... 214 passed, 0 failed, 3 skipped in 41.2s
Exit code: 0

diff --git a/tests/test_rate_limit.py b/tests/test_rate_limit.py
+ def test_burst_over_limit_returns_429():
+     ...

The reframe

Stop asking whether the agent hallucinates less than it did last month — that's a model-quality question you don't control turn to turn. Ask whether you built a process that doesn't need the agent's self-report to be honest in order to be safe. If your CI, your reviewer, and your merge gate would catch a false 'done' no matter how convincingly it was written, the hallucination stopped being your problem the moment you designed for it.

Flashcards
Check yourself

Extend your knowledge

  • Next time an agent reports 'done,' go find the actual command output it was supposedly reading from — practice treating the claim as unverified until you see it.
  • Audit one recent agent-authored PR in your own repo: does the description contain raw test/log output, or just prose describing outcomes?
  • Look at how your CI is wired for agent-created PRs — does merge depend on CI's actual re-run, or can a convincing description get something merged before CI finishes?
  • Compare this to 'grounding' techniques used against factual hallucination (RAG, citations) — notice there's no equivalent widely-adopted technique yet for process hallucination beyond raw-output requirements.
Test yourself on this lesson

Discussion

Chat with Chi Cong (AI) about this article. Your conversation is private to you — you can publish a summary for others when you're done.

Ask me anything about “Your Agent Didn't Lie About a Fact — It Lied About Finishing” — trade-offs, decisions, or the story behind it.