Defense control

Plan Drift Detection

How to detect material divergence between an agent's proposed plan and an authoritative, application-recorded task baseline. Plan drift is probabilistic evidence for a response policy; it is not proof of compromise, not permission and not a substitute for authorization, flow control, output validation or human approval.

By Norbert HofmannPublished: 2026-09-27Last reviewed: 2026-09-27Level: AdvancedAudience: Security Engineers, Developers, AI Engineers
Control family
Detection and monitoring
Control type
Detective
Enforcement
Probabilistic evidence feeding a deterministic response policy
Core question
Does the proposed plan materially diverge from the current recorded task baseline
Level
Advanced
Table of contents

Security Objective

Plan drift detection compares the plan an agent proposes, and the action intent behind it, with an authoritative task baseline recorded by the application. When the plan adds objectives, side effects, destinations, resource classes or consequential actions that the current baseline does not contain, the detector raises a drift signal. That signal feeds a response policy, an alert queue and later investigation.

The control exists because many prompt injections work by redirecting a task rather than by producing obviously hostile text. An agent asked to compare two vendors that suddenly plans to read an internal sheet and send it elsewhere has drifted, whatever the wording of its plan.

Ownership Boundaries

What plan drift detection owns and what neighbouring controls own
ControlQuestion it answersRelation to plan drift
Plan drift detectionDoes the proposed plan diverge from the current recorded baselineOwns baseline comparison, reason codes and hand-off to response policy
Prompt injection detectionDo correlated runtime signals indicate an injection attempt or effectThe broader architecture; plan drift is one specialised signal family inside it
Tool-chain analysisDoes a sequence of tool operations create an unsafe combined effectComplementary; it looks at composition, plan drift looks at divergence from the task
Agent authorizationMay this fully resolved action executeIndependent and deterministic; a drift flag never replaces or waives it
Information flow controlMay data with these attributes reach this sinkIndependent and deterministic; drift never declassifies data
Output validationDoes output meet the sink's structural and format constraintsIndependent; a plan within baseline still produces output that must be validated
Human-in-the-loopDoes a selected action need an informed human decisionDrift can add review context; it never replaces a required approval
Data provenanceWhere did context come fromSupplies which sources were present when the plan changed

The broad Prompt Injection Detection article explains how content, behavior, plan, tool and enforcement signals are correlated. This page goes deeper into one of those inputs: comparing plans with a baseline.

Threat Model

The threat is text in context that changes what the agent tries to do. It can arrive in an indirect prompt injection through retrieved pages, messages, files or tool results, or directly in a user turn. In agentic systems the influence becomes visible as a changed plan: new recipients, new writes, broader reads or a different purpose.

Assume the attacker can shape wording so that the plan still sounds related to the task, can spread influence across steps or agents, and may know that plan comparison exists. Assume also that legitimate users change their minds and that agents adapt plans for ordinary reasons. The detector has to work under both conditions and will still miss or over-flag some cases.

What Is a Task Baseline?

A task baseline is an application-owned record of what the current task is allowed to be about. It is derived from the user's current request, the workflow definition, policy, task scope, permitted resource classes, permitted destination classes and the current workflow stage. It is versioned and stored outside model output.

What Counts as Drift?

01
IndicatorNew objective

The plan pursues a goal the current baseline does not contain.

02
IndicatorNew side effect

The plan adds a send, write, delete, share or purchase not represented in the baseline.

03
IndicatorNew consequential action class

A read-only task gains a write or outbound action.

04
IndicatorNew destination

A recipient, domain or sink appears that the baseline does not list.

05
IndicatorNew resource class

The plan reads a class of data outside the task scope, such as internal pricing in a public-research task.

06
IndicatorScope or purpose change

The same tools are used for a broader population or for a different purpose.

Legitimate User Scope Changes

Users revise tasks. When the same authenticated user explicitly asks for something new in a later turn, the application records that turn and updates the baseline to a new version before the next plan is evaluated. A plan that matches the updated baseline is not drift.

Benign Adaptation vs Material Drift

Adaptation versus drift
Change in the planUsuallyWhy
Different approved read-only tool, same fact returnedWithin baselineObjective, effect, resource class and destination are unchanged
Extra step to reformat a result for the requested channelWithin baselineNo new effect or destination
Retry after a transient errorWithin baselineSame operation, same parameters class
Added send to a new recipientDriftNew side effect and new destination
Added write to an unrelated recordDriftNew consequential action on an out-of-scope resource
Added read of a more sensitive resource classDriftResource class expansion

The question is not whether the plan looks different, but whether its objective, effects, resources or destinations leave what the baseline allows.

Trust Model

Baseline, plan, detection and response
SystemUser turn and workflow definition
SystemRecorded task baseline
Variable trustModel and context
Variable trustProposed plan
SystemPlan drift detector
Variable trustDrift signal
SystemResponse policy
SystemAuthorization / IFC (independent)

The detector is a system component, but its output is still variable evidence. Only the response policy that consumes it, and the enforcement controls that act independently of it, are system decisions.

Baseline Construction

Baseline fields

  • Baseline ID and objective version
  • Initiating principal and tenant
  • Workflow and current workflow stage
  • Objective, recorded as structured intent plus the user's text reference
  • Allowed effect classes, such as read, draft, send, write
  • Allowed resource classes and scope
  • Allowed destination classes and any named destinations
  • Requested output channel
  • Delegation scope for any subtasks
  • Source of each field: user turn, workflow definition or policy

Structured fields come from the application: workflow definitions, form inputs, selected records and policy. Where the objective is free text, keep the user's text as a reference and store a normalised intent that the application or a constrained parser derived, together with how it was derived.

Baseline Versioning and Freshness

Each accepted change creates a new baseline version with the triggering event, the principal and a timestamp. Plans are evaluated against the version that was current when they were proposed. A plan compared with a stale version produces false drift after legitimate user changes, or misses drift when an old, wider baseline is still in force.

Close or narrow baselines when a workflow stage ends. A baseline that silently accumulates every past scope becomes too permissive to detect anything.

Proposed Plan Representation

Comparison is much more reliable when the plan is structured. Where possible, have the agent framework emit proposed steps as records with tool, operation, effect class, resource references, destinations and purpose, rather than parsing prose.

Record the plan version and whether it parsed completely. A plan the detector could not represent is unobserved for the affected fields, not within baseline.

Comparison Dimensions

Dimensions compared against the baseline
DimensionComparison styleExample reason code
ObjectiveSemantic, constrained, plus structured intentOBJECTIVE_ADDED
Effect classDeterministic set comparisonEFFECT_CLASS_ADDED
DestinationDeterministic class and value comparisonDESTINATION_NEW
Resource classDeterministic class comparisonRESOURCE_CLASS_EXPANDED
ScopeDeterministic count or selector comparisonSCOPE_EXPANDED
Workflow stageDeterministic stage checkSTAGE_MISMATCH
Delegation scopeDeterministic subset checkDELEGATION_SCOPE_EXCEEDED

Do not rely on natural-language similarity between plan and request alone. A plan can be worded to sound close to the task while adding a new destination, and a legitimate plan can be worded very differently from the request.

Destination and Side-Effect Drift

New destinations and new side effects are the most security-relevant drift dimensions because they are where influence becomes consequence. They are also the easiest to compare deterministically: the destination class and effect class of each proposed step either appear in the baseline or they do not.

A draft-only baseline that gains a send, or an internal-only baseline that gains an address under outside.example.test, should produce a drift signal regardless of how the plan justifies it.

Resource and Capability Drift

Resource drift covers reads of data classes outside the task, and capability drift covers the use of tools or operations the task did not need. Both often precede an outbound step. Least privilege limits what is available at all; plan drift detection notices when the plan reaches for more of what is available than the task requires.

Multi-Agent Delegation and Hop Boundaries

When a parent agent delegates, the delegation should carry a bounded scope that is a subset of the parent's baseline, together with a correlation ID linking parent and child runs. The child's plan is compared with that delegation scope. A downstream agent cannot silently redefine the task.

In multi-agent systems, a read-only subtask whose plan adds contacting an external party has drifted even if the parent never sees that step. Hop-level comparison is what makes this visible.

Relationship to Tool-Chain Analysis

Plan drift detection and tool-chain analysis
AspectPlan drift detectionTool-chain analysis
Primary questionDoes the intended objective or effect diverge from the baselineDoes the composition of operations create an unsafe combined effect
Reference pointRecorded task baselineSequence patterns and data flow between steps
Typical catchA new send or write the task never asked forA read then summarise then send chain where each step looks plausible
Blind spotHarmful chains that stay within baseline classesNew objectives expressed in a single step

The two are complementary. Tool-chain analysis has its own article; the Tool-Chain Analysis lab practises the sequence view.

Detector Families

Implementation options
FamilyStrengthsWeaknesses
Rules over structured fieldsDeterministic, explainable, cheapNeeds structured plans and complete baselines
Structural comparisonCatches new effects, destinations and resource classes reliablyCannot judge purpose changes expressed only in text
Model or classifier-assistedHandles free-text objectives and paraphraseProbabilistic and can be influenced by context
HybridDeterministic fields plus constrained semantic comparisonMore components to test and version

Model-Assisted Drift Detection

A model can compare a free-text objective with a proposed plan. Treat it as a probabilistic detector: isolate it from the agent's context where possible, give it only the baseline and the structured plan, give it no tools, and constrain it to a fixed output schema with reason codes.

Response Policy

Response options by workflow risk tier
  1. 01
    Record

    Low-risk workflows: store the signal with reason codes for trend analysis.

  2. 02
    Alert

    Route to triage with baseline and plan versions attached.

  3. 03
    Restrict

    Remove outbound or write capabilities for the rest of the run.

  4. 04
    Pause

    Stop the run and ask the user to confirm or restate the task.

Map responses to workflow risk tiers in a deterministic policy outside the model. A response policy may only narrow authority. It never grants permission, never declassifies data and never waives authorization or a required human approval.

Telemetry Design

Record for each evaluated plan

  • Baseline ID and version, plan ID and version
  • Correlation IDs across parent and child agent runs
  • Detector name, version and configuration
  • Result: within baseline, drift flagged or unobserved
  • Reason codes per dimension
  • Which fields were unobserved and why
  • Provenance references for context present when the plan was formed
  • Response policy decision and resulting authority changes
  • Downstream authorization, flow-control and approval decisions, recorded separately

Unobserved Is Not Within Baseline

When the baseline is missing a field, the plan cannot be parsed, or a hop did not report its plan, the detector cannot compare. Record that dimension as unobserved and report the run as incomplete. Treating missing telemetry as within baseline hides exactly the paths an attacker would prefer.

Alert Quality and Triage

A useful alert shows the baseline version, the plan version, the dimensions that diverged, the reason codes, the sources in context and what happened next. Triage then establishes whether the drift reflected a legitimate change the baseline missed, a benign adaptation the detector misread, or likely influence from content.

Keep provenance, authorization, classification and drift as separate fields. A single blended trust score hides why a case was raised and invites use as a permission signal.

Worked Scenario A: Legitimate User Change

The user asks for a comparison of fictional vendors Alpha and Beta on support terms. The baseline records a comparison objective, read-only effects and no destinations. In a later turn the same user asks the agent to also draft a message to procurement@corp.example.test.

Scenario A
StageObservationOutcome
Baselinev2 recorded from user turn 2: compare and draft, internal destination, draft onlyUpdated by the application
ProposedCompare, draft to procurement@corp.example.test, present draftMatches v2
FlaggedNo new objective, effect class or destination beyond v2No drift flag
Authorized / executedNothing is sent; any send would need separate authorization and approvalNot reached

Worked Scenario B: External Content Adds a Send

The user asks for a comparison from public material. After retrieved external content enters context, the plan adds reading an internal pricing sheet and sending a summary to reviewer@outside.example.test.

Scenario B
StageObservationOutcome
BaselinePublic-source comparison, read-only, no destinationsUnchanged; retrieved text cannot change it
ProposedAdds internal resource read and external sendRESOURCE_CLASS_EXPANDED, EFFECT_CLASS_ADDED, DESTINATION_NEW
FlaggedMaterial driftDrift flag raised before execution
AuthorizedAgent authorization and IFC evaluate independentlySeparate decisions
Executed / succeededNothing executed at flag timeNo effect recorded

A cross-hop variant: a parent delegates a read-only lookup of SKU-17 stock, and the sub-agent's plan adds emailing supplier@vendor.example.test. The child plan exceeds the delegation scope and is flagged as drift.

What the Scenarios Prove and Do Not Prove

01
StateProposed

The agent suggested a plan. Nothing has happened yet.

02
StateFlagged

The detector saw material divergence. This is evidence, not proof of attack or intent.

03
StateAuthorized

Independent enforcement allowed a concrete action. A missing flag never implies this.

04
StateExecuted

The action ran. Only execution logs establish this.

05
StateSucceeded

The action had its effect. This needs its own evidence.

Scenario A shows that a legitimate change should not alert. Scenario B shows that the flag is useful triage evidence. Neither shows that the system is safe, that no drift occurred elsewhere, or that the flagged plan was malicious.

Testing and Validation

Build a labelled regression set with benign user changes, benign adaptations, clear drift and cross-hop drift, using fictional data and .example.test destinations. Run it for every detector, baseline schema or agent framework change. Include cases with missing baseline fields to confirm they are reported as unobserved.

The Plan Drift Detection lab is a deterministic simulation for learning the classification, not a detector benchmark. Research benchmarks such as AgentDojo can supply agent tasks for broader evaluation, and designs such as CaMeL show how separating control flow from untrusted data reduces reliance on detection; neither defines this control.

Metrics

Operational measures with explicit denominators
MeasureNumeratorDenominator
Baseline coverageRuns with a complete baselineAll agent runs in scope
Plan representation coveragePlans fully parsedAll evaluated plans
Drift recallLabelled drift cases flaggedLabelled drift cases
False-positive rateBenign adaptation and user-change cases flaggedBenign labelled cases
Unobserved rateEvaluations with any unobserved dimensionAll evaluations
Reason-code distributionFlags per reason codeAll flags
Alert actionabilityAlerts leading to a triage conclusionAll alerts
Time to responseTime from flag to response actionFlags with a response
Benign task utilityBenign tasks completed without interruptionBenign tasks

These are operational measures. Do not combine them into a single security score, and do not read good numbers as proof of security.

Common Mistakes

Failure patterns
  1. 01
    Baseline from the model

    Using the agent's own goal statement as the reference.

  2. 02
    Every change is drift

    Flagging legitimate user turns because the baseline was not versioned.

  3. 03
    Similarity only

    Relying on text similarity instead of effect, destination and resource fields.

  4. 04
    Missing means fine

    Reporting unparsed plans or missing fields as within baseline.

  5. 05
    Flag as permission

    Letting no drift observed unlock actions or skip authorization.

  6. 06
    Unbounded delegation

    Letting sub-agents inherit the full parent scope or define their own.

Implementation Checklist

Before relying on plan drift detection

  • Baseline is application-owned, versioned and never taken from model output
  • Explicit user changes create a new baseline version
  • Plans are structured where possible and parse failures are recorded
  • Effect, destination, resource and scope comparisons are deterministic
  • Semantic comparison is isolated, schema-bound and treated as probabilistic
  • Delegation carries a bounded scope and correlation IDs
  • Missing fields are reported as unobserved
  • Response policy is tiered and can only narrow authority
  • Authorization, IFC, output validation and human approval stay independent
  • Labelled regression set runs on every change

Standards and Sources

Standards and guidance referenced

Microsoft
Defend against indirect prompt injection attacks (vendor guidance)
OWASP
LLM01:2026 Prompt Injection (risk context)
NIST
AI 100-2e2025 (terminology)

On source use: Microsoft's guidance lists plan drift detection as a runtime monitoring technique that watches multi-step reasoning for deviations from intended task flows, pairs it with deterministic controls such as information flow control, and notes that probabilistic defenses like plan drift detection can produce false positives. It does not specify an algorithm. OWASP LLM01:2026 provides risk context for prompt injection, not a plan drift specification. NIST AI 100-2e2025 is used only for terminology. Baseline schemas, reason codes, response tiers and metrics on this page are engineering guidance, not requirements from these sources.

Frequently Asked Questions

Does a drift flag block the action?

Not by itself. A response policy may restrict or pause the run. Whether an action may execute is decided by agent authorization.

Does no drift observed mean the plan is safe?

No. It means no divergence was seen on the observed dimensions. Harmful chains within baseline classes and unobserved fields remain possible.

Is a new user request drift?

No, when it is an explicit, authenticated user turn that the application records as a new baseline version.

Can retrieved content update the baseline?

No. Only application-recognised authority changes the baseline.

How is this different from Prompt Injection Detection?

Prompt Injection Detection is the broad correlation architecture; plan drift is one specialised signal family within it.

How is this different from tool-chain analysis?

Plan drift compares intent and effects with the baseline. Tool-chain analysis looks at whether a sequence of operations combines into an unsafe effect.

Can a model do the comparison?

It can help with free-text objectives, but it is probabilistic and can be influenced by context. Keep deterministic field checks as the backbone.

Does drift prove an attack?

No. Triage decides whether it reflects influence, a missed legitimate change or a detector error.

References

  1. Defend against indirect prompt injection attacksMicrosoft Learn · GuidanceReviewed 2026-09-27
  2. OWASP GenAI LLM Top 10 2026 (LLM01:2026 Prompt Injection)OWASP GenAI Security Project · GuidanceReviewed 2026-09-27
  3. Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations, NIST AI 100-2e2025NIST · Standard · 2025-03Reviewed 2026-09-27