I Gave Five AI Coding Agents a way to Fact-Check the Docs They Were handed. They Refused to Use it.
From the publisher’s feed, collected in the ZeroLabs newsroom.
A pre-registered benchmark of what stale docs do to coding agents: 3250 graded trials, 5 models, 3 providers, and $120 of my own API credits. The short version: stale docs are worse than no docs, and fresh docs beat both.Here is the single most uncomfortable number from a week-long study I funded with $120 of personal API credits.When I handed GPT-5.4 a confident piece of documentation that happened to be wrong, it got the task wrong 100% of the time, asserted the false claim 100% of the time, and stopped fact-checking completely. It verified the underlying code in 0% of trials, a check it ran 96% of the time when no doc was in front of it.And that is the part worth writing about: the model had a tool to check. It could read the real source file any time it wanted. Give it one authoritative-looking doc and it simply stopped looking. That pattern, an agent declining to verify a claim it could trivially have checked, held across every model I tested. This post is about why, and why I think it is a correctness problem rather than a hygiene one.The full pre-registered paper, raw per-call data, and harness are all open. Links are at the bottom.Why I ran this (the honest version)I’m building a small tool called Surface. It is a deterministic documentation-drift gate: it watches anchored claims in your docs against the code they point at, and tells you when a claim no longer matches its code. An operator flips from I believed this mattered for AI agents, but “I believe my own tool matters” is worth nothing. So I did the thing that makes a self-interested study trustworthy: I pre-registered it. I wrote down the hypotheses, conditions, metrics, and the entire analysis plan, then git-tagged them before running a single paid trial. A null or reversed result on any hypothesis was reportable, and I would have had to report it.That pre-registration is the reason you should keep reading a study whose author has an obvious conflict of interest. I will come back to the conflict at the end and be blunt about it.The setup, in one screenThe whole design is one controlled variable. Same code, same task, same model, same sampling. The only thing that changes is the documentation block in the prompt. Five conditions:C0 — code only, no doc (baseline)C1— code + a stale doc (it was true once; the code has since moved)C2— code + a fresh doc (matches the current code)C3 — code + the stale doc + Surface's drift report (which includes the corrected code)Cw— code + the stale doc + a generic “this may be outdated” warning (no correction)The headline scenarios are cascades: the agent works on something visible whose correctness depends on a hidden dependency, a file that exists in the sandbox but is withheld from the prompt, exactly like a transitive dependency you never open in a real repo. The dependency has drifted from what the stale doc claims, so the doc is the agent's only window onto the truth, unless it chooses to go read the hidden file.And critically, in the main study the agent can read it. It is a multi-turn loop with read-only tools (read_file, grep, list_dir). A diligent agent could always be right. So any harm a stale doc causes has to come from the agent deciding not to check.Grading is fully deterministic, with no LLM judge. Code tasks are scored by hidden unit tests that probe the real dependency; Q&A tasks by a fixed-format verdict rubric. The benchmark is built to the Agentic Benchmark Checklist (Zhu et al., NeurIPS 2025). Scale: 3250 graded completions, 0 errors.The findingA single stale doc was catastrophic, on every model.Cascade success collapses under a stale doc and is restored by fresh docs or the Surface report.Under a stale doc (C1), the rate at which the agent was actively misled, confidently asserting the false claim, ran from 68% to 100% across all five models. Task success collapsed to between 0% (GPT-5.4) and 32% (Opus). Swap in a fresh doc (C2) and success jumps back to 94–100%.Same code. Same task. The only thing that moved was whether the documentation was accurate.The doc, not the staleness, is what does the damageHere is where the hook pays off. Remember the agents could verify. Did a stale doc make them stop?With no doc every model reads the hidden file ~100% of the time; any doc suppresses that.With no doc, all five models opened the hidden dependency ~100% of the time. Hand them a stale doc and verification cratered: GPT to 0%, the Claude models to ~20–33%.But the result I did not predict was this. A fresh doc suppressed checking just as much. The drop from “no doc” to “fresh doc” was within a few points of the drop to “stale doc” on four of five models, and on Sonnet the fresh doc suppressed verification more.So the mechanism is not “stale docs are confusing.” It is blunter than that:Any authoritative doc in context switches off the agent's skepticism. The doc does not inform the agent; it replaces the agent's instinct to check. Staleness only decides whether the thing it stopped checking was true.That reframes the whole problem. You do not get to assume your agent will catch a bad doc because it is smart and has tools. It will not check, because you gave it a doc, so the doc had better be right.You might be tempted to read this as an argument for giving the agent no docs at all. It is not, and the cost section below shows why “no docs” is neither free nor safe. The real choice is which kind of doc you ship.Capability does not save you, and there are three distinct ways to failThe intuitive defence is “use a smarter model.” The data does not support it. Opus, the most capable model in the set, was still 68% misled when it could have just opened the file. And the model that collapsed hardest, GPT-5.4 (0% success, 100% misled, 0% verification), is not the weakest in the lineup. Resistance simply did not track capability.It tracked verification behaviour, which split into three genuinely different failure modes. These are model-level observations; I only ran one model per non-Anthropic provider, so do not read them as “OpenAI does X.”Blind obedience (GPT-5.4). A stale doc shut verification off entirely (0%). It committed to the wrong answer without ever opening a file it had read 96% of the time moments earlier.Suppressed but rescuable (Claude: Haiku, Sonnet, Opus). A stale doc suppressed checking, but the minority that did check were mostly right. Among Opus trials that verified, 95% were correct. Verification was a real antidote here; the agents just stopped reaching for it.Verify-then-defer (Gemini 3.5 Flash). The strangest one. Gemini barely suppressed: it still verified 85% of the time under a stale doc, and was still 77% misled. It opened the hidden file, saw the real code contradicting the doc, and followed the doc anyway. Only 20% of its verifiers got the answer right. Looking is not the same as believing what you see.That last mode is the one that should worry anyone betting on “just give the agent tools.” Tools are necessary but not sufficient. The agent has to weight code over confident documentation, and not all of them do.The part your finance team will care about: fresh docs are the cheapest optionI expected to argue that accuracy is worth paying for. The data made a stronger argument: accuracy is also cheaper.Fresh docs sit top-left: most accurate and, on 4 of 5 models, cheapest.Fresh docs (C2) dominated no-docs (C0): equal or better accuracy at 36–46% lower total cost on four of five models. That total already prices input and output tokens separately, so it accounts for input being the cheaper class. The driver is sheer volume. With no doc, the agent pays a rediscovery tax: it opens the hidden file ~100% of the time and re-reads it as the transcript grows, roughly doubling input tokens. Input tokens are cheap individually, but at that volume they still cost more than a fresh doc that simply states the fact and lets the agent skip the loop.So “no docs” is the most expensive way to be correct, and it is only this accurate because the sandbox happened to let the agent reach the hidden file. In a real codebase where that file is behind an interface or outside the context budget (my single-shot pilot), no-docs collapses to the floor right alongside stale docs.Which means the real-world choice is never no docs vs fresh docs. It is stale docs vs fresh docs, and that gap is the whole ballgame.So what actually fixes it?Two candidates. A generic “this may be outdated” warning (Cw), or Surface's actual drift report with the corrected code (C3).The correction won, decisively, on every model (+20 to +45 pp over the bare warning). Suspicion alone helped a little; the fix helped a lot. But even the correction was not magic, and this is the most honest, least flattering result in the paper: handed the corrected line of code, GPT-5.4 still produced the stale answer 46% of the time. It looked straight at the fix and discounted it, the same “looked and deferred” failure, now with the right answer literally in context.It is worth being precise about what Surface actually does here. The drift report (C3) is the fallback: it is what you reach for once a doc has already gone stale. Surface's real job is to stop the drift in the first place, which is what keeps you in the fresh-doc (C2) condition, the one that was both most accurate and cheapest. The report rescues a bad situation; the gate is what prevents the bad situation.And the corrected code in context is not self-executing. A model that over-weights authoritative documentation can ignore the truth even when you spell it out.What this doesn't showI would rather state the limits than have them used against the result.Curated fixtures, not real repositories. Bespoke scenarios; a real-OSS case study is future work.The drift is exactly the kind Surface detects: flipped operators, changed constants, dropped guards. Conclusions generalize to detectable, anchorable drift, not to semantic drift that is wrong in spirit.One model per non-Anthropic provider, and reasoning compute was not held equal across vendors, so the failure-mode labels are model-level, not provider verdicts.Read-only loop: no edit/run/test cycle, so the compounding cost of acting on rot is not measured.The verification-to-correctness link is an association, not proven causation. Verifying is the agent's own choice, not a randomized intervention.The conflict of interest, stated plainlyI built Surface. This study measures Surface's value and finds it valuable. That is exactly the kind of result you should distrust on sight.So I made it as hard as possible to fake. The hypotheses were pre-registered and git-tagged before the run; grading is deterministic with no LLM judge; every hypothesis had a pre-specified direction and a reportable failure condition; and all raw per-call data is released so you can re-grade and re-analyse without spending a cent. If I had cooked this, the artifacts would show it. Check the git history, re-grade the raw data, and tell me where I am wrong.Dive into the detailsPaper (pre-registered, full results): https://github.com/Connorrmcd6/surface-bench/blob/main/PAPER.mdBenchmark repo (harness, scenarios, raw data): https://github.com/Connorrmcd6/surface-benchSurface (the tool): https://github.com/Connorrmcd6/surfaceSurface (site): https://surface.gradientdev.xyzArchived release / DOI: https://doi.org/10.5281/zenodo.20722100If you run agents against documentation they cannot independently verify, which is most of us, the takeaway is uncomfortably simple. Your agent will trust whatever doc you give it and stop checking, no matter how smart it is, so the doc had better be accurate.And note what “no docs” actually costs. It was the most expensive way to be correct, it only held up because the agent could reach code it usually cannot, and it gives nothing to the humans, especially non-technical ones, who also read those docs. No docs is not the rational choice this study leaves you with. Fresh docs are.I Gave Five AI Coding Agents a way to Fact-Check the Docs They Were handed. They Refused to Use it. was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.