# Why AI Agents Drift: 470 Tests and a Passive MCP Solution > Task-level instructions silently override root enterprise rules in up to 100% of cases. Here is what 470 tests show and how to fix context drift. Source: https://www.starboxai.cn/en/insights/ai-news/2026-11-28-agent-context-drift-enterprise-fix/ (Starbox AI Insights, updated 2026-11-28) ## Why AI Agents Silently Break Enterprise Rules When an AI agent deviates from company guidelines, team leaders often assume the model has failed or that prompt engineering was insufficient. Recent empirical testing demonstrates a different reality: your model is not losing intelligence; task-level context is quietly overriding your enterprise rules. In enterprise deployments, context is assembled from diverse sources: - Base instruction files (such as `AGENTS.md`) injected into every new session. - Procedural skill files dynamically loaded for specific workflows. - Word documents, spreadsheets, and shared repository markdown files. - Automated memories managed behind the scenes by agent harnesses. When different team members update these assets asynchronously, contradictions inevitably appear. A customer document might state that the refund window is 30 days, while a company policy document lists 14 days. To evaluate how language models handle these contradictions, Google AI developer Patrick Kelly conducted 470 automated tasks across Gemini 3.8 Flash and Gemini Pro. The findings reveal a structural blind spot in how modern agents interpret enterprise guidelines. | Context Failure Type | Definition | Primary Impact Observed | | :--- | :--- | :--- | | **Context Rot** | Degradation caused by session bloat, dead ends, and conversational noise over extended runs. | Adding 50,000 tokens of bloat produced zero rule violations in benchmark tests. | | **Context Drift** | Underlying sources (`AGENTS.md`, dynamic skills, docs, code) gradually falling out of sync over time. | Local task files overrode root system rules in 95% to 100% of test runs. | ## Context Rot vs. Context Drift: 470 Sandbox Runs The industry frequently groups all context failures under context rot, a term describing accuracy loss as a conversation history grows excessively long. To measure the real impact of bloat versus drift, Kelly established a git sandbox equipped with terminal tools, testing both Gemini 3.8 Flash and Gemini Pro across 470 tasks with planted contradictions, duplicates, and stale documentation. The results challenged common assumptions: - **Session bloat had minimal impact on rule compliance:** Injecting 50,000 tokens of unrelated chat history and duplicated agreeing rules caused zero rule violations, even on the smaller Gemini 3.8 Flash model. - **Context drift caused immediate, silent divergence:** When root instructions conflicted with local files, the agent failed to follow the global baseline on the very first turn of a clean session. The testing revealed that models spend measurable computational effort resolving contradictions. When two peer skill files contained conflicting instructions with no clear tie-breaker, the model spent 47% more thinking tokens debating the conflict in its internal reasoning scratchpad. ## How Models Handle Conflict: The 0% Warning Problem The most critical finding from the 470 test runs involves how frontier models communicate inconsistencies to human operators. In 73% of runs, the model's internal thinking trace explicitly identified that two documentation sources disagreed. However, across 110 unprompted runs, the model warned the user exactly 0% of the time. ``` [Agent Internal Thinking Trace] "File A specifies 14-day refund window. File B specifies 30-day refund window. File B is closer to the current task execution path. Proceeding with File B." │ ▼ [Silent Execution: 0% User Notification] Agent executes the task using File B without alerting the operator. ``` Instead of seeking clarification, models quietly select a winner: 1. **Task-specific skills override global rules:** On 95% to 100% of matching tasks, a task-specific procedural skill file overrode the root `AGENTS.md`, even when `AGENTS.md` used strict, capitalized "MUST" syntax. 2. **Agents patch around stale code:** When documentation referenced a test helper function that had already been renamed in the live codebase, the model wrote a one-line compatibility wrapper in 9 out of 15 runs so tests would pass, rather than flagging the stale specification. This behavior stems directly from reinforcement learning from human feedback (RLHF). Frontier models are optimized to be autonomous, decisive, and task-oriented. Asking human operators to resolve minor ambiguities is penalized during training, leading agents to prioritize task completion over enterprise compliance. ## A Free Fix: Passive MCP Conflict Logging If models already identify context contradictions internally, how can organizations capture that awareness without breaking the workflow? Prompting the model in `AGENTS.md` to declare all conflicts in chat succeeded in 100% of completed runs (16 out of 16). However, conversational warnings interrupt execution and flood human operators with minor complaints about documentation. The cleaner approach uses a dedicated Model Context Protocol (MCP) tool called `report_inconsistency`. This read-only escape hatch offers two logging categories: `conflict` and `stale`. Testing the MCP tool demonstrated strong operational results: - **High capture rate:** Without any prompt instructions added to `AGENTS.md`, simply making the tool available led the agent to log 98.7% of encountered conflicts (150 out of 152 runs) across Gemini 3.8 Flash and Gemini Pro. - **Zero false positives:** Gemini 3.8 Flash recorded zero false alarms. - **Negligible token overhead:** Total execution turns remained stable, and thinking tokens dropped by approximately 19% on average. Passive logging is essentially cost-neutral. ``` Agent discovers contradiction during execution │ ├──> Calls report_inconsistency (MCP) │ ├── Category: "conflict" | "stale" │ ├── File paths & exact quotes │ └── Chosen branch record │ └──> Completes task execution uninterrupted ``` Two operational details matter when running this tool: - **Logging suppresses chat interruptions:** Providing the tool causes the model to log silently rather than speak in chat (0% chat mentions), unless explicitly instructed to do so. - **Tool visibility is essential for larger models:** Larger architectures like Gemini Pro take fewer exploratory steps than Flash models. They only detect drift across skill or memory files if file summaries are visible in the initial prompt and the MCP tool is loaded eagerly rather than hidden behind dynamic tool search. ## Architecture Defense: Three Layers to Stop Drift Passive reporting records drift, but architectural boundaries prevent it. In our Enterprise AI Adoption (FDE) practice at Starbox AI, we see companies struggle when they place every instruction, policy, and fact into a single, monolithic system prompt. Engineers analyzing Kelly's 470 runs pointed out that task-level override is not a bug to eliminate; it is a structural mechanism to harness. The instruction loaded closest to the execution path wins. A resilient enterprise AI workflow isolates context into three distinct layers: ### Layer 1: Progressive Disclosure and Event-Driven Hooks Loading every guideline on turn one forces the model to referee complex documents. Instead, keep system instructions scoped to paths and execution contexts. Routing file-write hooks through an event bus establishes a deterministic log of what enters context and what executes, eliminating the need to rely exclusively on self-reporting. Furthermore, pre-session linters (such as running structural checks across instruction files) can detect cross-file duplication and dead references before an agent session starts. ### Layer 2: External Fact Injection with Explicit Supersession Facts and changing metrics do not belong in static agent prompt files. In systems like RE-call, enterprise facts are stored as dated records. Hooks search the data store against user inputs and inject only the relevant summaries when needed. Each summary carries its date metadata and a deterministic rule: later dates supersede earlier dates. Records can explicitly declare a `supersedes: [record_id]` attribute. In testing, this mechanism resolved policy contradictions (such as the 14-day versus 30-day refund window) within the retrieval layer, halving instruction files from 746 lines down to 358 lines. ### Layer 3: Passive Discrepancy Queues Equip running agents with passive reporting tools like `report_inconsistency` or `recall_report_stale`. In controlled tests on memory stores, 36 out of 38 stale-knowledge reports successfully identified true superseded records. The agent logs the conflicting paths, the exact text snippets, and the version it selected, directing items into an asynchronous review queue for human operators. ## Self-Audit Checklist for Enterprise Agent Workflows Before expanding autonomous agent operations, use this checklist to verify whether context drift threatens your workflows: - [ ] **System file size:** Are your core instruction files (such as `AGENTS.md`) lean, focusing strictly on behavioral boundaries rather than operational facts? - [ ] **Fact centralization:** Are operational numbers, policy windows, and product specs isolated in dated external stores rather than hardcoded across multiple procedural prompts? - [ ] **Tool discovery:** Is your conflict-reporting MCP tool loaded eagerly at session initialization rather than tucked behind deferred tool-search calls? - [ ] **Explicit tie-breakers:** When task-specific skill files are introduced, do they specify which root instructions they are authorized to override? - [ ] **Audit queues:** Do you maintain an automated log collecting agent-reported documentation mismatches for regular administrative review? Deploying reliable AI agents requires moving beyond the belief that system prompts are permanent safeguards. By understanding how context drifts across files and implementing structured isolation, organizations ensure their enterprise rules remain intact.