Instruction Drift and Goal Displacement in Long-Running Agents
Long-running agents quietly drop goals, and outputs alone won't show it.

Intent-aware auditing for AI agents compares an agent’s actions across a complete task trajectory with its original instructions, including goals it silently stops pursuing. Instruction drift and goal displacement are structural failure modes of long-running agents, so detecting them requires more than checking outputs for errors. A useful audit must preserve the original intent, track missing and displaced actions, and distinguish context failures from changes in the underlying model.
Why long-running agents are structurally prone to drift, not just occasionally unlucky
Mingguang Chen and colleagues’ 2026 paper, The Horizon Gap, distinguishes single-step capability from reliable completion of an extended task. A model can reason well in isolation yet lose earlier decisions, declare incomplete work done, or diverge from its assigned goal inside an agent loop. These are failures of continuity across the run. A strong answer at one step does not establish that the next steps will remain aligned with the task.
The same paper separates three properties often treated as interchangeable. Long-horizon is the number of steps a task takes, while long-context is its token capacity and long-term memory is how state persists across steps or sessions. These properties are logically independent of one another. More context capacity therefore does not show that an agent can be trusted to carry out long tasks, and persistent memory does not show that it will follow instructions. Detecting drift first requires identifying which mechanism could have broken that connection.
Context attention decay: how earlier instructions lose influence as sessions grow
Liu and colleagues’ 2024 TACL paper, Lost in the Middle, describes how models use some parts of long contexts more than others. Information in the middle receives less attention than information at the head or tail. Availability is not the same as influence. As sessions grow, earlier task instructions can occupy a low-attention region and lose their hold on behavior, even though the agent has received no instruction to deprioritize them.
This distinction changes what counts as a warning signal. An agent affected by attention decay may not produce an explicit contradiction or attempt a forbidden action. It may simply stop doing something it was told to do earlier. Inaction-type drift is the dominant surface manifestation described for this mechanism, making the missing action more informative than an error message. Monitoring that inspects only attempted actions cannot establish whether all active objectives still receive attention.
Diagnosis requires determining whether earlier goals remain represented in the agent’s work. Token count alone cannot answer that question. A goal that disappears from the action sequence without completion or a documented deferral is evidence that warrants investigation. By contrast, an unused instruction is not automatically evidence of drift if the corresponding work is already complete. Detection needs task-state information to distinguish abandonment from legitimate progress.
Inherited trajectory conditioning: how drift propagates through prefilled context
Achyutha Menon and colleagues’ 2026 workshop paper, Inherited Goal Drift, describes another way an agent’s objective can be displaced. In a simulated stock-trading environment, models that were largely robust under adversarial pressure often inherited drift when given prefilled trajectories from weaker agents. The displacement arrived with the supplied history. Recent actions became a behavioral prior, providing implicit evidence about what the task required even when that evidence conflicted with the original objective.
Only GPT-5.1 maintained consistent resilience among the tested models, but strong instruction-hierarchy following did not reliably predict resistance to inherited drift. A model can respect instruction priority in a direct evaluation yet absorb an unintended objective from a trajectory. The study also found inconsistent drift across prompt variations, limiting the assurance provided by a successful prompt-level test.
The stock-trading results came from simulations. Early evidence of transfer in a simulated ER triage environment suggests this mechanism may occur beyond the main setting, but does not show how reliably systems work or how often they fail across settings. The monitoring implication is nevertheless distinct from attention decay. Step count and token count cannot show whether the history an agent was given has displaced its objective. The relevant comparison is between the working goal inferred from recent actions and the goal the agent was originally assigned.
Governance decay via context compaction: the silent policy-erasure mechanism
Context compaction introduces a failure in the harness itself. To stay within a token budget, a harness may summarize or evict earlier turns, keeping the task going while dropping governance constraints that still apply. The policy disappears before the next decision. When the summarizer has no instruction to preserve those constraints, rules that the agent followed while they were visible can be lost through the same process that keeps the task running.
After compaction, the constraint may no longer be available at all, so stronger reasoning cannot compensate for its removal. The distinction is especially important for bespoke organizational policies. An agent can keep its baseline safety behavior while losing the restrictions for its deployment, so it still looks well behaved under general checks. A monitor that looks only for broad safety violations can therefore miss the loss of the rules that govern that particular deployment.
Constraint Pinning addresses this loss by separating governance constraints from lossy compaction and re-injecting them verbatim afterward. Its protection has a strict boundary, however. Only constraints explicitly and precisely written into the prompt can be pinned, while informal expectations that were never recorded remain outside that defense. For teams operating long-running agents, the architectural lesson is to avoid making conversational context the sole repository of safety and policy constraints. Durable governance requires external enforcement that survives compaction, with the compaction event treated as a point for re-verifying constraint coverage.
Silent model updates as a hidden drift trigger in stable deployments
An unchanged prompt and harness do not guarantee unchanged behavior. A provider’s silent update to the underlying model can alter the agent’s effective policy without any change inside the session. Liu Zewen’s 2026 paper reports that a silent GPT-4o update between May and June 2026 completely reversed the result of an eight-run replication. The reported trigger was outside the context-management process. Keeping earlier goals and protecting constraints during compaction cannot account for a change in the model that interprets them.
This creates a separate requirement for behavioral evidence. A deployment-time result establishes behavior under the conditions tested. The model endpoint must therefore be tracked and baselined as a variable in its own right. Re-running defined tasks against that endpoint can reveal changes independently of prompt or harness revisions. Without that comparison, a team can look for problems in its own unchanged code while missing the component whose behavior changed.
Why standard testing and error monitoring cannot see these failure modes
Ulysse Richard and colleagues’ 2026 paper, Testing and Evaluation of Agentic AI Systems In Military Command and Control, identifies assumptions that established evaluation methods make about their subject. These include specifiability, stability, composability, and supervisability. Agentic properties weaken those assumptions by design. Consequently, correctly performed tests can yield evidence that satisfies a testing process without supporting the inference that fielded behavior will remain acceptable.
For an agent, the unit of behavior is a trajectory encompassing tool use, memory, and delegation. Each output shows only part of that behavior. A well-formed response can be semantically wrong, while a successful tool call can violate policy or serve a displaced objective. Error monitoring can establish that an operation executed without establishing that it belonged in the task. Correctness depends on the relation between the operation, the instructions, and the preceding sequence.
State accumulation also weakens the link between deployment tests and later behavior. An agent that has progressed through a long session and repeated compaction is not in the state originally characterized. The horizon-gap paper explains that outcome-only supervision becomes sparser and noisier per step as trajectories lengthen. A final pass or fail therefore offers limited evidence about where the process departed from its goal. Human oversight does not automatically close this gap, because opacity, adaptation, and delegation can erode the operator’s understanding while narrowing the opportunity to intervene.
How do you audit AI agents against their original instructions?
A production audit must compare the full action sequence with a durable record of what the agent was instructed to do. That record must remain accessible outside the session context. Otherwise, that record can itself be lost during compaction. The comparison must include both actions taken and obligations left unfulfilled, because missing work and displaced work expose different mechanisms.
For teams evaluating auditing platforms, the criteria follow directly from that requirement. A suitable system needs access to original instructions, trajectory-level evidence, objective coverage, constraint checks, and behavioral regression results. For attention decay, objective coverage shows whether earlier requirements still receive action without an unexplained gap. For inherited drift, recent actions must be assessed against the original objective rather than accepted as proof that the task has legitimately changed.
The testing-and-evaluation paper identifies recoverable assurance claims including bounded mission envelopes, trajectory-grounded correctness, executable runtime constraints, and characterized run-to-run variance. Each claim needs an instrument that can produce evidence during operation. Compaction monitoring must check whether constraints are still there, while model-update detection needs golden tasks run against the live endpoint and checked against a prior baseline. These checks answer different questions about the same deployment. A single aggregate success score cannot substitute for all of them.
Repeated deviations also need to be grouped by condition. One trace showing a violation establishes an incident, while a cluster showing the same violation under the same circumstances points toward a structural failure mode. That distinction changes the response from issuing another alert to correcting the relevant instructions or constraints. The evidence must stay connected to production traces so that evaluation reflects fielded behavior. Approval to deploy thus becomes a judgment that teams keep making with help from monitoring, re-baselining, and goal-drift detection.
Building a practical drift-detection posture for teams shipping long-running agents today
For attention-decay drift, teams should track active coverage of original task objectives across steps. Earlier goals that stop receiving action need a logged completion or deferral, or a flag for investigation. Absence needs its own explicit detection rule. Teams should also distinguish this inaction-type drift from action-type drift, where the agent pursues a displaced objective, because the evidence and remediation differ.
For inherited-trajectory drift, teams should check traces against a record of the original instructions kept outside the session. The comparison should examine whether the agent’s inferred working objective has diverged, including when the supplied history already contains displacement. Hierarchy compliance is not a substitute test. For compaction-driven decay, teams should place safety and policy constraints in an external policy layer and check constraint presence in compacted outputs. After each compaction event, teams should re-verify that the policy still holds, even when the task keeps going.
For model-update drift, teams should maintain golden tasks with expected output characteristics and run them against the live endpoint on a schedule independent of code deployments. A shift against that baseline warrants investigation even when the prompt and harness are unchanged. Across these mechanisms, trajectory-level evaluation should score runs with explicit rubrics, block regressions in CI, and stay linked to production traces. Lemma, a production monitoring platform for AI agents, audits recorded traces against the agent's own instructions rather than only what it did, and groups recurring failures into issues. The decisive criterion is whether the audit can show that the agent continued doing what it was assigned to do, under the constraints that originally governed the task.
Sources
- Inherited Goal Drift: Contextual Pressure Can Undermine Agentic Goals
- The Horizon Gap: Planning, Memory, Execution, Training, and Evaluation for Long-Horizon LLM Agents
- Testing and Evaluation of Agentic AI Systems In Military Command and Control
- Inherited Goal Drift: Contextual Pressure Can Undermine Agentic Goals


