AI coding agents

Inconsistent docs and AI coding agents: what 140 runs showed

In short

On 25 November 2026 Microsoft published a study of what coding agents do when two docs pages disagree. Across about 140 runs on contradictory Dev Proxy pages, agents often followed the outdated page, mostly recovered, and paid for it in tokens and steps. Agents that checked a second source, such as the CLI or API reference, were not misled.

Microsoft's Waldek Mastykarz published a study on 25 November 2026 that asks a question most teams with docs now face. When two pages disagree, does a coding agent notice, follow the wrong one, recover and report honestly? The short answer from about 140 runs: agents often follow the outdated page, they usually recover when the mistake shows up as an error, and the price is extra tokens and steps. The more useful finding is about what prevented the mistake: a second source the agent could check.

How the experiment worked

The subject was the documentation for Dev Proxy, Microsoft's API simulator, which spans versions 0.29 to 4.0. An earlier consistency review found 79 disagreements among 3,827 facts across 193 pages. Most have since been fixed, and the study picked three of them.

The setup was deliberately plain:

  • Models: Claude Sonnet 5.5, Claude Haiku 5.5 and GPT-6.1 Terra.
  • Agent: VS Code with GitHub Copilot Chat, no extensions or custom instructions, Dev Proxy v4.0.0 installed.
  • Docs: not in the workspace. Each prompt linked the relevant page.
  • Swapping versions: Dev Proxy's own MockResponsePlugin served either the outdated or the fixed version of the same Learn URL, so the agent saw an identical link either way.
  • Runs: up to 15 per page version, about 140 in total, judged from traces and the final files.

One limitation matters for how you read the results. Agents rarely found the contradictory pages on their own without a link, so this tests how agents handle a page they are handed, not how they discover docs.

The three contradictions and what happened

The three cases were chosen to fail in different ways: loudly, silently, and only in CI.

Outdated API endpoints (fails with a 404). The CI/CD page used old endpoint paths.

ModelWrote outdated endpoints, old pageSame, fixed pageMedian tokens, old / fixed
Claude Sonnet 5.510/150/151.60M / 1.16M
Claude Haiku 5.55/140/142.16M / 2.55M
GPT-6.1 Terra0/150/151.00M / 0.91M

Every Sonnet run that used the wrong endpoints recovered, so every final script worked. But tokens rose 38%, the median run took 12 more steps, and recovery alone cost a median of 19 steps and 0.66M tokens. Even Sonnet runs that avoided the wrong endpoints used more tokens (median 1.53M) than fixed-page runs, because they spent effort working out which page to trust. Haiku also recovered from every 404, though its token spread was too wide to isolate the cost.

A misplaced rate setting (fails silently). The configure page put rate at the top level, where Dev Proxy ignores it and falls back to its 50% default without an error. Here the agents did fine: Sonnet placed it correctly in all 8 old-page runs and GPT in all 10.

A version without the v prefix (fails only in CI). On the GitHub Actions page, Sonnet pinned v4.0.0 correctly in all 4 runs. Haiku dropped the v in 3 of 12 old-page runs and still reported the workflow as done, against 0 of 5 on the fixed page. The author notes these samples are small.

Only the endpoint case produced a difference too large to be chance. That is three contradictions out of 79, so treat the specific numbers as illustrative rather than as a ranking of models.

The finding worth acting on: second sources

The most practical table in the post is about what agents did before writing code on the old CI/CD page.

CheckSonnet 5.5Haiku 5.5GPT-6.1 Terra
Read the Proxy API reference7/1511/1415/15
Ran devproxy api show2/154/1415/15
Wrote outdated endpoints10/155/140/15

In 8 runs Sonnet wrote the script before opening the API reference, and all 8 used the outdated endpoints. The study's summary is that agents which checked a second source were not misled. Whether an agent recovers, in the author's words, "comes down to whether the task lets it run into the mistake."

That has two consequences for anyone running agents against their own code.

First, give the product a way to tell the truth. A command like devproxy api show, a shipped default config file, or machine-readable action metadata gave agents a ground truth that beat the prose. If your CLI can print its own endpoints, schema or defaults, an agent can check the docs against it.

Second, the dangerous contradictions are the ones that fail late or silently. A 404 forces recovery. A setting that is quietly ignored, or a version string that only breaks in CI, lets the agent declare success. Haiku's "done" on a workflow with the wrong version is exactly the kind of result that passes review if nobody runs it.

What to change in your docs and your agent setup

For docs maintainers, the post's recommendations are concrete:

  1. Fix contradictions even when agents recover. Users pay for the recovery in tokens and wall-clock time.
  2. When you rename an endpoint or move a setting, search for the old value across every page, including code samples, and update them in the same change.
  3. Prioritise contradictions where the wrong value fails late or silently and the product gives no contrary signal.
  4. Make the product a reliable second source: commands that print the real API surface, default configs, action metadata.
  5. Run a consistency review with an agent. The article includes a prompt that has the agent list facts, flag contradictions with evidence, and check them against source code.

For the "search for the old value" step, a plain grep in CI catches most regressions after a rename. Replace the patterns with your own renamed endpoints and moved settings:

bash
if grep -rnE '/api/v1/old-endpoint|old_setting_name' docs/; then
  echo "Outdated reference found" >&2
  exit 1
fi

For teams running agents on their own repositories, the lessons translate directly. If your internal docs, READMEs or ADRs disagree with each other, an agent will sometimes pick the wrong one. Prompts that ask the agent to verify against the code or a CLI before writing reduce that, and so does stating the correct fact once in a place every run sees. In CodeBeast that place is Org Memory, a Markdown document of standing preferences added to the prompts of the planning, integration and Explore agents. It is a good home for "the API base path is /v2, ignore older pages" while the docs are being fixed. For evaluators, the post makes a point that applies well beyond docs. Decide whether you are testing content (you link the page) or discovery (you don't). And check traces and final files, not only pass or fail: the LLM judge failed some runs whose final config was correct, while a run that hit a 404 and recovered still passes. Our write-up of Hugging Face's eight-step agentic evaluation guide covers the same trap.

Open questions

The author lists next steps that would change how far these results generalise: prompts without a "make sure it works" instruction (which likely encouraged recovery), discovery through search rather than a linked page, agents that summarise pages through a subagent, and facts that appear only in the docs, where no CLI or API can contradict them. That last case is the one to watch. When the docs are the only source, a second-source check isn't available, and the study doesn't yet say how often agents get it wrong.

Sources

FAQ

Do inconsistent docs make AI coding agents fail?

Sometimes, but in Microsoft's runs the main cost was extra tokens and steps rather than broken output. Claude Sonnet 5.5 used outdated endpoints in 10 of 15 runs with the old page and recovered in all 10, at 38% more tokens. Failures were more likely when the wrong value failed silently or only in CI.

Which model handled contradictory docs best?

GPT-6.1 Terra wrote correct endpoints in all 15 runs and checked the API reference and the devproxy api show command every time. The study tested only three contradictions with small samples, so it isn't a general model ranking. The clearer lesson is that any agent that checked a second source was not misled.

How can I make my docs safer for coding agents?

Fix contradictions even when agents seem to cope, update every page and sample when you rename something, and prioritise errors that fail silently. Give agents a ground truth to check against, such as a CLI command that prints the real API or a shipped default config. Microsoft's post also includes a prompt for running an agent-based consistency review.

Does this study test whether agents find the right docs page?

No. Each prompt linked the relevant page, because agents rarely found the contradictory pages without a link. Discovery through search is listed as future work.

Written by the CodeBeast Team with AI assistance. Spotted a mistake? Email support@codebeast.ai.