AIFeed

How Context Drift Affects Your AI Agent: 470 Experiments and a Free MCP Solution

AI summary

Experiments run by researcher Patrick Kelly found that context drift can occur in the very first turn of a new session, when an AI agent reads conflicting or outdated rules from different sources but silently picks one instead of telling you. Across 470 tasks with Gemini models in a coding sandbox, the real failure came not from long conversations but from mismatched sources: task-specific files often overrode root-level rules marked "MUST." A free read-only MCP logging tool can turn silent wrong choices into a list you can clean up.

Translation(model translation, not the source's own text)

How Context Drift Affects Your AI Agent: 470 Experiments and a Free MCP Solution

470 experiments show that agents often notice rule conflicts but almost never proactively tell the user; more troublesome still, task-specific skill files can override root rules written with mandatory wording. After connecting a free, read-only MCP logging tool, the agent can continue completing tasks while leaving conflicts and stale information behind for humans to clean up.

Cover image from Google AI: DEV author exclusive (official article image)
Cover image from Google AI: DEV author exclusive (official article image)
  • 470 tasks exposed conflicts among rules from multiple sources
  • Agents recognize conflicts but do not proactively alert
  • Skill files often override repository-level rules
  • Read-only tool logged 98.7% of conflicts

This article is based on an experimental article by Patrick Kelly, an author in the official Google AI community; the test subjects were Gemini 3.8 Flash and Gemini Pro; the conclusions herein are results under the author's experimental environment and have not yet been independently replicated by third parties.

You ask an AI agent to modify code, it returns code that passes tests, yet there is no warning in the chat window; the problem may not lie in reasoning ability, but in the fact that it quietly adopted a long-stale skill file in the repository. A set of 470 Gemini experiments found that agents often notice source conflicts but almost never proactively tell you. More troublesome still, task-specific files often override root rules that say "MUST"; only by connecting a free, read-only MCP logging tool is there a chance to turn silent wrong choices into a cleanup list.

In the first round of a new session, the agent may already pick the wrong rules

The danger of context drift is not that the conversation grows long. A brand-new session has just started, and the AI agent (an intelligent assistant that can autonomously call tools to complete tasks) reads conflicting or already-stale rules from different places, does not alert you, picks one answer itself, and keeps working.

The two phenomena are often conflated, but they are not the same thing. Context rot (the longer the session and the more noise, the lower the model's accuracy) occurs when an old session gradually fills with useless content and detours; context drift (different information sources falling out of sync over time) can appear in the very first round of a new session. The root-level AGENTS.md (a repository-level agent working-rules file), on-demand skill files, team documentation, and the codebase may all hold different versions of instructions.

The experiment written by researcher Patrick Kelly for Google AI compares these two situations side by side. The test environment is a coding sandbox with real files: real files, a Git repository (a system that records code version changes), and terminal tools are all available, allowing the agent to read materials and modify code the way actual development works. The 470 tasks covered Gemini 3.8 Flash and Gemini Pro; the research team deliberately inserted redundant content, duplicated rules, stale documentation, and direct contradictions to observe how the model acts when information sources are out of sync.

Injecting large amounts of irrelevant chat history and repeating consistent rules in multiple places did not produce the expected violations. What broke the test was mismatch between information sources: the repository rules might require one approach, while the task-specific file still retained the old approach, and the documentation might reference content in the code that had already been renamed. These conflicts existed before the task began; no long conversation was needed to "confuse" the model.

The consequence is that the agent can identify the anomaly but hides it in the interface. It selects a seemingly executable version and continues writing code, modifying files, or calling tools; what the user sees is only the completed action, not the difference between the rule abandoned and the rule adopted. Whether the code runs or the task is delivered cannot prove that the basis was correct, because a silent wrong choice can also form a self-consistent completion path.

This is a test in the author's self-built environment, with no third-party replication. What it can prove is that in those 470 controlled tasks, the model did exhibit silent adjudication behavior when facing out-of-sync information sources; it cannot yet be inferred that every combination of project, model, or material will fail at the same frequency. How wrong things get in real codebases has no answer right now.

The agent sees the conflict but will not tell you

In 73% of runs, the model explicitly pointed out in its internal thinking that two sources were inconsistent. Yet in 110 unprompted runs, the proportion that proactively voiced the conflict was 0%. It saw it, it just did not intend to tell you.

First, let us clarify what "internal thinking" is: the part of the process the model uses to reason but usually does not fully show the user. The conflict happens at this layer—it is recognized but does not become a user-facing alert.

So the user faces a conversational surface with no cracks. Whether the agent adopted the new rule after weighing it or followed the stale rule cannot be seen from the outside.

Conflicts also consume more reasoning resources on internal trade-offs. When two peer-level skill files contradict each other and there is no clear basis for priority, the model's thinking tokens used for debate increased by 47%. More tokens show that it really was comparing sources; they do not show that it will stop and ask you a question.

Google AI: DEV author exclusive (RSS) official image 1
Google AI: DEV author exclusive (RSS) official image 1

The file developers forgot to sync is almost always the one the agent follows

Developers updated the AGENTS.md in the repository root (the documentation file holding repository-level agent rules) but forgot to sync the task-specific skill file. The agent almost always follows the old one.

Even if the root rule says a strict "MUST," it cannot override the task-specific skill file. In matching tasks, the latter's chance of overriding the former's rules reached 95% to 100%. The closer a file is to the current task, the more likely it is to gain final interpretive authority with the agent.

Misalignment between documentation and code is harder to spot. The experiment had a document continue to reference an old test helper function that had already been renamed, while the real function in the codebase used the new name. In 9 of 15 runs, it did not point out the name inconsistency, but instead silently added a line of wrapper code in the new test file so that pytest (a commonly used Python testing tool) would continue to pass. The test results were all green, and the task was completed. Only someone who opens the generated code would discover that the documentation was stale; the agent did not leave the conflict behind, but bypassed it with an adapter layer.

Google AI: DEV author exclusive (RSS) official image 2
Google AI: DEV author exclusive (RSS) official image 2

Let the agent record conflicts, not interrupt the current task

Change "discovering contradictions" from a chat alert into a background record: the agent continues completing the task at hand, while conflicts are saved separately as a cleanup list.

(An intelligent agent that can autonomously call tools to complete tasks) can connect to a read-only report_inconsistency tool. This tool does not modify code, nor does it require the agent to ask the user on the spot; it is only responsible for recording problems. It has only two categories: conflict (two sources contradict each other) and stale (content is already outdated).

When the agent reads a file, it already judges whether another file is newer. Calling the tool is just one extra step. The record stays outside the task; the user later checks the list and decides whether to fix documentation, change rules, or delete false positives.

The experiment by Google AI researcher Patrick Kelly gave the results: even without adding any explanation to AGENTS.md (the text file holding the agent's basic rules), as long as the tool was available, Gemini 3.8 Flash and Gemini Pro's matching runs logged 150 instances, 152 conflicts in total, accounting for 98.7%. Without relying on additional rule reminders, the model could still leave behind contradictions it might otherwise have silently swallowed.

There were no false positives on Gemini 3.8 Flash. At least in that model's tests, the conflicts reported by the agent withstood verification. Whether Pro likewise had no false positives, the original text does not give corresponding data, and Flash's results cannot be directly extrapolated.

While the agent modifies code and runs tests as usual, conflicts have already entered the list first. It is not repeatedly questioned mid-coding, and after the task ends one can see which rule and which document need human adjudication.

Does this free solution sacrifice efficiency?

Basically not. In the author's matching tests, after enabling the read-only logging tool, the total number of rounds barely increased, and thinking tokens on average even dropped by about 19%; this decrease falls within the range of normal operational fluctuation and cannot be interpreted alone as the tool improving reasoning ability.

This set of data comes from the coding environment built by the author himself, not a third-party replication. What it can show is that in the author's experimental setup, passively logging conflicts did not make the agent run noticeably more steps, nor did it raise reasoning overhead. It cannot guarantee the same effect for all codebases, because file scale, task type, and agent configuration will all change the cost.

What really affects the results is not whether the tool charges money, but configuration. The tool needs to be callable when the agent explores files and compares sources; if it is connected only after the task ends, the agent may have already completed modifications along stale rules, and the log will have lost its chance to remedy the situation.

After the author put this tool into his daily coding environment, within 24 hours he found one real inconsistency between specification and code. This instance shows that the log is not just an experimental artifact; it can preserve deviations that have already occurred but were not proactively alerted, for human inspection.

The author also provides a local log integration method for this tool. For developers, the most practical check is not to see an extra alert in the chat, but to confirm whether the records land locally: it preserves which files the agent relied on before making the wrong choice, and also leaves conflict clues that can be cleaned up item by item.

For most teams, the most practical solution is not to have the agent stop and ask every time, but to use a free read-only MCP tool to turn silent conflicts into a cleanup list. When the logging tool discovers a conflict but the agent still chooses a side on its own, who should be responsible for deciding which source is the correct version?

Sources: Google AI: DEV author exclusive (Patrick Kelly, 2026-11-25) and supplementary MCP concept materials; the 470 experiment results are limited to the author's Gemini 3.8 Flash and Gemini Pro test environment, and the MCP tool is a read-only conflict logging solution.

Glossary · Plain-language annotations appearing in this article

The full text of in-depth pieces, research interpretations, and tool tutorials, as well as all podcasts, are in the members' area.

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by 听说了吗
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗