Intent Drift Detection in Long-Running Agents

Intent, in the agentic sense, is not a prompt. It is the goal the agent is actually pursuing at any given moment: shaped by memory, role definition, available tools, accumulated context, and the workflow history it is operating inside. It is dynamic and compositional. Drift is what happens when that composite goal begins moving away from the one originally assigned, without the agent erroring out, without execution halting, without anything firing.
Three forms show up in the research. Semantic drift: outputs diverge from the original intent while remaining syntactically coherent. The sentences parse, the files are validly formatted, but the content is serving a different objective. Behavioral drift: the agent develops strategies absent at initialization, new patterns of tool use or sequencing that were never specified. Coordination drift: in multi-agent systems, shared understanding between agents degrades over time and consensus around the collective goal breaks down.
The distinction that matters operationally is between a behavioral anomaly and intent drift. An anomaly is a statistical outlier; intent drift is a change in what the agent is trying to accomplish, and it only becomes visible across a sequence of actions, never in a single event. This is precisely why anomaly detection scores miss it. Each step in a drifted sequence falls comfortably within normal operating bounds. The wrongness lives in the pattern across time, and most monitoring architectures were not designed to read patterns across time.
Decision quality degrades gradually, and agents cannot self-correct the way a person would; they lack the social and contextual feedback that lets humans notice when their behavior has drifted from expectations. An agent observes its own outcomes through its own interpretive frame and reinforces whatever pattern produced those outcomes, regardless of whether that pattern is serving the original goal. The deviation accumulates because nothing in the system is looking at the trajectory, only at the individual steps.
The Sequence Through Which Drift Accumulates in Practice
Drift does not arrive as one wrong decision. It arrives as a chain of small, individually defensible ones, each making sense given the context the agent has accumulated, none of which would trigger an alert on its own.
The pattern goes like this: an early interaction produces a narrow scope deviation, something slightly outside the original parameters but plausible enough to execute. The agent's subsequent decisions treat that deviation as established context rather than as an error. Scope expands from there, each step compounding the initial deviation. Research puts numbers to this: detectable drift emerged after a median of roughly 73 interactions, and by 500 interactions, more than half of the financial analysis agents studied had drifted. The window between onset and consequence is genuinely wide, wide enough to cause real damage before anyone notices.
Context window accumulation accelerates it. As a long-running agent ingests data across a session, early instructions become relatively less prominent and recent context increasingly shapes decisions. The original goal does not disappear; it loses influence by dilution. This is not a model bug. It is a structural property of how context windows work, and it means the longer an agent runs without behavioral monitoring, the more its founding instructions erode as a governing constraint.
The adversarial version is goal manipulation: an attacker incrementally nudges an agent's objective across repeated interactions rather than issuing a single malicious command that would be immediately flagged. A finance agent could gradually begin routing copies of reports to an external recipient after a series of subtle prompt nudges. No single nudge is obviously malicious. The destination changes, but the change arrives in pieces small enough that each looks plausible.
A related attack pattern, Delayed Tool Invocation, takes this further. Malicious instructions are planted during a benign interaction and sit dormant, then trigger in a later session when a specific condition is met. This bypasses guardrails that inspect only the current context window, because at the moment of execution, the context looks clean. The payload arrived in a session the guardrail never connected to this one.
Conventional monitoring fails against all of these for the same reason. It is calibrated to catch the implausible; drift lives entirely in the plausible.
How the MCP Tool Layer Creates Structural Conditions for Drift
The Model Context Protocol gives agents the ability to act on the world: filesystem access, database reads, external API calls, ticketing systems, communication tools, all reachable through a standardized protocol. That standardization is also what creates a coherent attack surface.
The security challenge MCP introduces is that attacks at this layer operate at the semantic level of natural language, not the network level. Perimeter controls do not see them because there is nothing anomalous at the packet or connection layer. The attack surface is the model's own reasoning process.
Tool poisoning, catalogued as OWASP MCP03:2025, embeds malicious instructions in tool description fields that the model reads as part of its context and then follows. The attack is not in the tool's code; it is in the natural language the tool uses to describe itself to the model. The model reads that description, incorporates it into its reasoning, and acts accordingly. This is not a vulnerability you patch; it is a property of how language models consume context, and the tool description is indistinguishable from legitimate instruction once it enters the model's reasoning frame.
Rug pulls work differently. A tool behaves legitimately at installation to earn permissions, then silently changes behavior after those permissions are granted. Most MCP clients do not detect or flag definition changes, which means the agent continues operating under the assumption it is using the same tool it was authorized for.
Cross-server tool shadowing connects these dynamics to data exfiltration. Invariant Labs demonstrated in 2025 how a malicious MCP server operating in the same agent context as a legitimate one used tool poisoning to silently read and export a user's entire message history, no user error, no network exploit, no anomalous connection. The entire operation ran through the agent's normal reasoning process.
What all of these share: a compromised tool definition changes what the agent believes it is doing without changing what the agent is formally authorized to do. The authorization check passes. The behavior is wrong. This is the gap that perimeter security was never designed to close.
Compounding this, most production deployments rely on a single bearer token granting access to an entire MCP server. A drifted agent operating with that kind of broad, undifferentiated credential can traverse a substantial surface before detection fires, assuming it fires at all.
Why Outcome Auditing Catches Drift Too Late
The dominant enterprise approach to agent oversight is logging what the agent did and reviewing those logs after an action completes or a time period ends. This is defensible for compliance; it is inadequate for drift.
By the time an outcome is auditable, the sequence of decisions that produced it has already executed. The drift happened in the sequence. The outcome is residue.
Volume compounds this quickly. AI agent traffic grew substantially in 2025, and at that scale, manual review of outcomes is not viable even for teams that genuinely want to do it.
What outcome logs structurally cannot show: the reasoning path that led to a decision, whether intermediate tool calls were within scope for the original task, whether the sequence of actions across a session represents the original intent or a drifted one. The log captures events; drift lives in the relationship between events, and that relationship is only legible while the sequence is running. Infosys's August 2025 report found that 77% of executives reported direct financial loss as the most common consequence of enterprise AI failures. That figure is what outcome auditing found after the fact.
What Continuous Behavioral Detection at the Tool-Call Level Actually Looks Like
The unit of analysis has to shift from events to sequences. A single tool call almost never reveals drift. The chain is what matters: tool call, data access, egress destination. That trajectory is the signal. No individual link looks wrong; the wrongness lives in the direction of travel.
Stack-level correlation assembles signals across cloud events, container events, and application events into a single narrative rather than scoring each event independently. The output is one coherent finding: prompt injection detected, leading to an unauthorized tool invocation, leading to sensitive data access, leading to exfiltration to an external endpoint. Under a conventional anomaly detection model, each of those steps scores as individually normal. Only the sequence reveals the drift. One finding with full chain attribution, rather than four separate alerts an analyst has to manually connect under time pressure, is not a minor operational difference; it is the difference between catching something and missing it.
Decision traces extend this. Rather than capturing only outputs, they capture reasoning paths, policy evaluations, and context quality at each step. A trace shows when the agent's reasoning begins citing context outside the original task scope, or when policy evaluations start returning different results than they did at session initialization.
Dynamic validation of function trajectories validates both privilege and intention at each step in a tool-call sequence, not just at session start. This treats authorization as a continuous property of execution rather than a gate checked once at the beginning. You are not trusting the initial authorization to hold across a session that runs for hours.
LLM-as-judge approaches address semantic drift specifically. A secondary model evaluates whether the agent's current actions remain consistent with its original stated goal, catching divergences that statistical tests miss because the outputs remain structurally valid while serving a different purpose. Distributional divergence metrics track behavioral shift over time as state features rather than one-off anomaly flags, which is particularly useful in multi-agent settings where coordination drift accumulates across systems.
One practical constraint shapes all of this. Most enterprises interact with proprietary models through APIs and have no access to model weights or internal states. Detection has to work in user space, observing behavior from the outside. Full OpenTelemetry tracing and tamper-proof audit logs capturing tool call identity, not just tool call outcome, are the foundational data requirements. Without that instrumentation, behavioral detection has nothing to read.
The Authorization Controls That Make Detection Actionable
Knowing that drift is occurring is only useful if you can tie the action to a specific agent, a specific credential, a specific session. Without that binding, a detection finding is an anonymous signal; anonymous signals generate tickets that age out of queues.
The current deployment gap is significant. A substantial majority of MCP server deployments implement no meaningful access scoping for tool permissions. Most drifted agents are operating with broad, undifferentiated access, which means when drift occurs, it propagates across a wide surface before hitting any boundary.
The July 2026 MCP specification update addresses this through an incremental scope consent model. Rather than requesting broad access upfront, clients request only the minimum permissions needed for each specific operation. A drifted agent attempting to reach a tool or data store outside its current operation's scope hits a permission boundary before it can act, limiting damage to the radius of what the operation actually required.
The 2026 specification also introduces role-based authorization at the tool level through annotations restricting which tools a given identity can invoke. Drift that crosses a tool boundary becomes immediately enforceable, because the boundary is defined in terms the authorization layer can evaluate. Just-in-time credential issuance per operation bounds a drifted agent's ability to act by credential lifetime rather than session length, which is a considerably tighter window.
SSO and SCIM integration makes all of this auditable in a way that actually matters operationally. When every tool call carries a verifiable identity, audit logs become something you can act on rather than sequences of anonymous events. Attribution is the prerequisite for accountability, and accountability is the prerequisite for any response faster than forensics.
What the specification does not close is the runtime enforcement gap. MCP defines the authorization handshake. Token vaulting, just-in-time consent workflows, RBAC enforcement at execution time, and per-call audit all require a runtime layer built above the protocol. The specification draws the architecture; the implementation is still an organizational responsibility, and that gap is where most teams are currently sitting.
What Organizations Need to Put in Place Before Drift Becomes a Loss Event
Most enterprises are already inside the problem this infrastructure is designed to address. A majority have agents in production, deployment counts are compounding over intervals of months, and governance infrastructure has not kept pace. The risk is not approaching; it is accumulating quietly, in sequences no one is reading.
Three things are non-negotiable if you are running agents at any meaningful scale.
Continuous behavioral monitoring at the tool-call level. Periodic log review does not catch drift because drift only exists as a sequence, and sequences are only legible while they are running or immediately after.
Identity attached to every action. Agent identity, credential, session, tool call, together. Detection that cannot be attributed cannot be acted on; a finding without attribution is an alarm with no address on it.
Least-privilege access scoped to operations rather than sessions. Limiting what a drifted agent can reach before detection fires is what converts a policy correction into something manageable, rather than an incident.
Infosys's 2025 research found that 86% of executives aware of agentic AI believed it posed additional risks and compliance challenges. The gap is between awareness and instrumentation. Those executives understand the risk. The organizations running agents without behavioral monitoring are simply carrying it without a mechanism to see it.
The goal is not to slow agent deployment. The goal is to instrument deployment so that drift is caught in the sequence rather than discovered in the aftermath.
An agent caught at interaction 80 is a configuration correction; a context reset, a tool permission adjustment, a policy update. Caught after a loss event, it is an incident report, a forensic exercise, and a careful review of what the outcome logs showed after the sequence had already run its course.


