Detecting Instruction Drift in Long-Running Production Agents
Continuous monitoring of agent behavior reveals drift that infrastructure metrics miss entirely.

Traditional error monitoring fails for AI agents because its measurements are limited to infrastructure health [6]. Detecting instruction drift in long-running production agents requires continuous auditing of actual behavior against intended behavior. Small deviations across prompts, tool schemas, context, and model behavior can accumulate while error rates and latency remain normal.
Why standard monitoring misses instruction drift in long-running agents
An agent can look healthy in logs while giving users wrong outputs. A successful request establishes only that the system returned a response. The same input can also produce different tool sequences across runs. Infrastructure health checks cannot distinguish a valid alternative path from a sequence that quietly abandons the original instruction.
The blind spot extends beyond operational metrics. Mukund Pandey’s Evaluating Agentic AI in the Wild reports that standard metrics, including ROUGE, BERTScore, and accuracy/AUC, fail to detect four of seven production agentic failure modes entirely. The paper finds that the other three can be detected only after multiple evaluation cycles. Accuracy can stay stable while output diversity collapses, just as latency can stay normal while correctness erodes. Detection therefore requires a signal tied to behavior.
How drift accumulates across prompts, tool schemas, and model behavior
Prompt and schema changes create the first layer of drift. A system prompt changes in staging, a downstream parser expects a different JSON format, or a tool definition is adjusted to improve extraction. Each change can affect what the agent does while it keeps running. In the refund-handling case described in the notes, a Tuesday prompt tweak was followed by a significant accuracy drop by Thursday afternoon while every dashboard stayed green. This is why engineering teams treat prompts as deployable infrastructure that can be versioned, tested, traced, and rolled back.
Tool failures add another layer when the agent keeps running. A malformed argument at step two can corrupt steps three, four, and five because the agent improvises around the broken response. The later steps can each appear successful. Their local execution status hides the upstream defect that shaped their inputs, so checking only the final response or the last failed call misses the origin of the deviation.
Context can degrade even without a new deployment. A column captured at session start may be renamed in a migration, or a superseded policy may retain priority over its replacement in retrieval. Long sessions also put pressure on working memory. As the context window grows, attention to early instructions can weaken, allowing the effective objective to shift without an explicit instruction change.
Model routing adds variation across the same workflow. A prompt that behaves correctly on one model can behave differently on another, while both providers return valid responses. Routing records are rarely connected to output quality in a form that exposes this relationship. Together, these layers explain why drift is cumulative. The running agent depends on instructions, interfaces, context, and model behavior remaining aligned, even as each changes independently.
The seven failure modes that production evaluation must catch
Pandey’s paper proposes a seven-mode taxonomy of production agent failures. Its value is a vocabulary for separating failures that otherwise look alike in operational logs. Tool misuse is choosing the wrong tool, giving it wrong arguments, or using the right tool in the wrong way. Context loss is losing earlier decisions or constraints as the run grows. Goal drift differs from both because the agent’s effective objective moves away from the stated instruction, even when individual steps remain coherent.
Cascading errors describe propagation across agents. A hallucinated identifier from Agent A can become Agent B’s query input, leading to a modification of the wrong record that Agent C then acts on. The destructive action occurs downstream of the original error. Silent quality degradation describes a different pattern, in which output quality erodes continuously while performance metrics remain normal. Accuracy can also stay stable as output diversity collapses, so one aggregate score cannot show whether behavior is healthy.
False success exposes an especially consequential evaluation gap. The agent reports completion, but the actual system state shows that the task was not completed. LatentEval found that false success accounted for the majority of failures on AppWorld among architectures making explicit completion claims. No LLM-as-judge configuration in the study exceeded AUROC 0.65 on tau2-bench, and the judges reached only 0.54 on AppWorld.
These distinctions define what a detector must observe. Tool inputs can expose misuse, while a sequence of decisions is needed to reveal context loss, goal drift, or propagation. False success requires comparison with actual system state. Existing health checks cover execution failures, but they do not establish these behavioral relationships, and text-based quality scoring does not close every gap.
Why the gap between benchmark scores and production behavior persists
The PayFlow case anchors the gap at the tool boundary. The notes trace the case to absent schema validation, illustrating a production weakness that a favorable evaluation score does not rule out. Evaluation needed to test and enforce the conditions under which the deployed agent would act.
Pandey’s paper names three ways in which production differs from laboratory evaluation. Production involves sequential decisions whose errors compound, continuous operation in which output distributions shift, and actions with real consequences. An isolated decision score cannot show how an early mistake amplifies across later steps. A point-in-time score also cannot establish reliability after prompt templates, model weights, or underlying data change. In production, consequences extend beyond benchmark penalties to a denied access request, a misdirected transaction, or a destructive database action.
Text-based scoring compounds this mismatch when it rewards a reported outcome without checking the resulting state. LatentEval’s false-success findings show how results that look strong can lead teams to trust a system too much. Pre-deployment testing still establishes a necessary baseline. It cannot prevent a running system from drifting away from that baseline, so production reliability requires detection that continues after release.
What continuous trace-based auditing detects that periodic evals miss
Observability records what happened, while evaluation scores how well it matched what should have happened. Neither replaces the other. Confident AI frames the distinction as evaluation establishing whether an agent is good and monitoring establishing what it costs. For instruction drift, the essential combination is a live execution trace and a judgment about whether that execution satisfied the applicable instruction.
Step-level tracing supplies the minimum useful evidence. Agent-authored logs are insufficient because an agent that fails may also describe its failure inaccurately. Structured spans for model calls, tool executions, and recorded reasoning steps make the trajectory available for inspection. That evidence lets evaluation locate a deviation at a specific step. For false success, the comparison must extend to actual system state.
Sampling production traces turns this evidence into a feedback loop that keeps running. Online evaluation can score every Nth trace in real time, while offline evaluation can batch-score a day’s sample. Both show patterns in live traffic that were never in a static suite. Instruction-aware scoring then distinguishes a harmless change in execution from a failure to follow the governing constraint. Without that reference, a changed tool sequence establishes only a difference.
AgentAssay proposes a related approach based on behavioral fingerprints. It compares execution-trace representations with a baseline and uses statistical decision procedures, including SPRT and Hotelling T², to detect distributional shift. Its proposed use is primarily a CI/CD deployment gate. That distinction is important because statistical regression testing before release complements continuous production auditing but does not replace it.
The three-layer eval architecture that catches drift before users do

For engineering teams, the detection posture translates into three complementary evaluation layers. The first is unit evaluation at discrete tool boundaries. Agent output must match the tool’s JSON schema before execution, and empty or malformed responses must count as failures. Repeated identical failures also need a circuit breaker. These checks catch tool misuse and silent error swallowing before they propagate, while preventing retry loops from accumulating cost unnoticed.
The second layer evaluates subjective output quality through regression suites. These suites cover coherence, policy compliance, instruction fidelity, and tone and must run before changes to prompts go into production. Their methods should combine LLM judges with non-judge detectors because the appropriate evaluator depends on the failure being measured.
LatentEval makes that method choice concrete for false success. Its TF-IDF detector reached AUROC 0.95 on AppWorld and 0.83 on tau2-bench, outperforming the LLM judges on those benchmark-specific measurements. These benchmark-specific results show why a more expensive model can still be a weaker completion judge, especially when completion must be established from evidence beyond the agent’s claim.
The third layer evaluates samples of real production traces. It catches new edge cases, distribution shift, and quality that falls over time in ways that fixed regression suites cannot foresee. Online scoring serves latency-sensitive detection, while daily batch scoring supports cost-sensitive evaluation. A team using only unit evaluation can catch malformed tool calls yet miss deteriorating quality. A team using only regression suites can detect known regressions yet miss a new production pattern.
The Production Agentic Evaluation Framework, or PAEF, provides a concrete starting point for this architecture. Pandey’s paper proposes five evaluation dimensions for monitoring production as it runs and describes an open-source reference implementation. It also presents formal detection guarantees for failure-mode classes.
What teams need to instrument before drift becomes visible in production
Teams need tool-call records detailed enough to reconstruct a failure’s path. Each record must include the tool name, arguments, response, latency, and success or failure status. Prompt and schema versions must also be tied to deployment events. That connection allows a quality drop to be correlated with a specific change, giving the investigation a starting point. Model choice must be connected to output quality as well, or routing-related drift remains detached from its likely cause.
The evaluation layer also needs access to intent. System prompts, tool schemas, and policy constraints must be versioned and available at runtime. Otherwise, an evaluator can inspect the action without knowing which requirements governed it. Grouping repeated deviations automatically then gives engineers patterns to look into, without making them review every trace by hand.
Human overrides give teams another signal before a quality incident is clear. Their frequency must be logged and trended so that rising intervention rates are visible. Cost controls need an equally concrete foundation. Spending caps and retry counters must be enforced at the infrastructure level. The April 2026 cost-drift incident ran for 63 hours because no hard limit existed.
Detection also needs a route into the development workflow. Slack alerts, coding-agent integration, or tooling built into the development environment can place findings where engineers will act on them. The trace, governing instruction, and associated change need to remain connected through that handoff. Otherwise, the delay between detection and remediation leaves users exposed while a finding sits in a dashboard.
Teams that ship without this instrumentation are waiting for user complaints to reveal behavioral failures. Their infrastructure may be monitored, but their agent’s adherence to instructions is not. Continuous, intent-aware auditing must begin when the agent goes live, because a successful response is not evidence that the agent did the right thing.


