Defense control

Tool-Chain Analysis

How to reconstruct ordered chains of proposed and observed tool actions from application telemetry and lineage, and evaluate their cumulative effect against task-level constraints. A chain finding is evidence for a response policy, not permission, not proof of intent or execution and not a substitute for per-call authorization or flow control.

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
Hybrid sequence analysis: deterministic structural and state checks plus optional probabilistic semantic analysis, feeding a deterministic response policy
Core question
Does the ordered chain create a cumulative effect outside the recorded task constraints
Level
Advanced
Table of contents

Security Objective

Tool-chain analysis reconstructs the ordered chain of proposed and observed tool actions from application-recorded telemetry and lineage, then evaluates the chain's cumulative, composed effect against task-level constraints and invariants. It exists because individually plausible, and even individually authorized, calls do not imply that the combined chain is safe.

A read of an internal record, a local summary and a notification are each unremarkable. In sequence they can form a path that moves internal data to a destination the task never contained. Two reservations that each respect a per-call limit can together exceed the task's total. A retry after a lost acknowledgement can duplicate an effect that already happened.

Ownership Boundaries

What tool-chain analysis owns and what neighbouring controls own
ControlQuestion it answersRelation to tool-chain analysis
Tool-chain analysisDoes the ordered composition of calls create a cumulative effect outside task constraintsOwns chain reconstruction, cumulative checks, reason codes and hand-off to response policy
Plan drift detectionDoes the intended objective or effect diverge from the recorded task baselineComplementary; drift looks at intent against the baseline, chains look at composition
Agent authorizationMay this fully resolved call executeIndependent and deterministic; a chain classification neither replaces nor pre-authorizes it
Information flow controlMay data with these attributes reach this destinationIndependent and deterministic; the chain view can surface a read-then-send path, IFC decides the flow
Least privilegeWhich tools, credentials and capabilities exist at allBounds the inputs; chain analysis evaluates how available capabilities combine in one run
Output validationDoes output meet the sink's structural and format constraintsIndependent; a chain within constraints still produces output that must be validated
Human-in-the-loopDoes a selected action need an informed human decisionA chain finding can add review context; it never replaces a required approval
Data provenanceWhere did context and data come fromSupplies the lineage the chain view depends on

The broad Prompt Injection Detection article places sequence signals inside a larger correlation architecture. This page goes deeper into that one layer.

Threat Model

The concern is that influenced model behavior, whether from direct input, retrieved content, tool output or a sub-agent result, steers the agent into a sequence whose combined effect the task never asked for. Each step may look like normal work. The harm, if any, lies in the composition.

01
PatternRead then send

Data from an internal read reaches an outbound sink in a later step.

02
PatternSplit operations

Several calls each respect a per-call limit but together exceed a task total.

03
PatternDuplicate effect

A retry after an unobserved result repeats a state change.

04
PatternDelegation composition

Separate hops with narrow grants are combined into a larger effective capability.

05
PatternState then use

One call changes configuration or permissions that a later call relies on.

Out of scope: proving intent, judging whether content is malicious and deciding whether a single call may run. Those belong to triage, inspection and authorization respectively.

What Is a Tool Chain?

On this page a tool chain is the ordered, possibly branching set of tool calls that belong to one task, including calls made by delegated sub-agents, together with the data and resource lineage that connects them. It includes proposed calls, calls that were authorized, submitted or executed, and their recorded results.

Why Per-Call Review Is Not Enough

Per-call review asks whether one resolved request is allowed and well formed. It does not see what an earlier call read, what a later call will send, how many units have already been reserved or whether an identical effect is pending. Those facts only exist across calls.

What each review scope can see
FactPer-call reviewChain review
Parameters of this callYesYes
Where the data in this call's parameters came fromOnly if lineage is attachedYes, from recorded lineage
Running total against a task capNoYes, from cumulative counters
Whether a prior identical effect is unobservedNoYes, from execution states
Which hop contributed which capabilityNoYes, from delegation records

Tool availability is not permission, and it says nothing about what a chain does end to end.

Authoritative Chain Evidence

The authoritative chain comes from application-side records: task and run IDs, ordered call IDs, tool and operation, concrete resolved parameters, resource classes, destinations, data lineage, counters, idempotency keys, delegation records and execution states.

Trust Model

Task constraints, chain, telemetry, analysis and response
SystemRecorded task and chain constraints
UntrustedModel proposes calls
SystemCall telemetry and lineage
SystemChain analyzer
SystemResponse policy

Task constraints, telemetry, the analyzer and the response policy are system components. The proposed chain is variable content. A sub-agent's returned result is also variable content; its lineage and delegation record are application facts.

Chain Reconstruction

Reconstruct order explicitly. Where calls run concurrently, timestamps alone do not establish order or dependency. Record sequence numbers within a run and parent call IDs, so the chain is a directed graph of dependencies rather than a list sorted by clock time.

Represent branches and concurrent calls as branches. Pretending every agent run is linear hides the case where two parallel reads feed one later send.

Chain Identity, Task and Correlation

Chain record fields

  • Task ID, run ID, call ID and parent call ID
  • Parent and child agent run IDs for delegated work
  • Initiating principal and acting workload or agent identity
  • Tool, operation and fully resolved parameters
  • Resource class, resource ID and effect class
  • Source and destination, with data lineage reference
  • Delegation scope for the hop that made the call
  • Idempotency key and relevant cumulative counter or invariant
  • Timestamps, policy version and analyzer version
  • Execution state and result reference

These fields are engineering guidance. Correlation IDs must propagate across every hop, or the chain breaks into fragments that each look harmless.

Execution-State Model

01
StateProposed

The model suggested the call. Nothing happened.

02
StateAuthorized

The authorization layer permitted this resolved call. It may still not run.

03
StateSubmitted / executed

The call was sent to or performed by the tool.

04
StateSucceeded

A result confirms the intended effect.

05
StateFailed

A result confirms the effect did not happen.

06
StateUnobserved

No result evidence exists. The effect may or may not have happened.

Proposed vs Observed Chains

Analyze proposed chains before execution to enable restriction or pause. Analyze observed chains to support reconciliation and investigation. Keep them separate in telemetry: a proposed chain finding says what would happen if every step ran, an observed chain finding says what the records show happened.

Mark each fact as observed or inferred. An analyzer's inference that a call "probably succeeded" is not an observation.

Cumulative Effects and Task-Level Invariants

Task-level constraints are separate from per-call technical limits. A tool may accept up to 40 units per call while the task allows 50 in total. Record cumulative invariants with the task, such as total units, number of state changes, allowed destination classes or read-only and draft-only scope, and evaluate every proposed step against the running total.

Read-Then-Send and Data-Flow Composition

Sequence-level lineage connects a read to everything derived from it. When derived content reaches an outbound sink, the chain contains an end-to-end data path that isolated call review cannot see. The analyzer can flag the path with a reason such as LINEAGE_TO_EXTERNAL_SINK. Whether that flow is allowed stays an information flow control decision.

Split Operations and Aggregate Limits

Splitting one large effect into several small calls keeps each call within limits while the total exceeds the task cap. Keep application-side counters per task and per invariant, update them from recorded execution states, and include proposed calls when evaluating a proposed chain. A split may be innocent; the finding is CUMULATIVE_LIMIT_EXCEEDED, not an accusation.

Retries, Idempotency and Unobserved Results

When a state-changing call was submitted and its acknowledgement was lost, the result is unobserved. A second call with a new idempotency key can duplicate the effect. The engineering pattern is reconciliation: read the target state, or reuse the original idempotency contract as application policy defines, before any retry.

Resource and Destination Lineage

Carry resource class and destination class through the chain. A new destination class, a new resource class or a new state-changing effect class that the task constraints do not contain is a strong chain signal, reported as NEW_DESTINATION or a comparable reason code. Destination identity must come from resolved parameters, not from how the model named it. Whether a new destination is reachable at all is decided separately by network and egress restrictions.

Cross-Agent and Multi-Agent Chains

A delegated sub-agent's calls belong to the parent task's chain. Propagate correlation IDs, record each hop's delegation scope and keep every delegation a bounded subset of the parent's.

See Multi-Agent Prompt Injection for how influence travels across hops.

Effective Permission Graph and Composed Capability

As an engineering model, not a standard term, an effective permission graph connects principals, agents, delegations, tools, resources and destinations. Composed capability is the set of end-to-end effects reachable by combining edges within one task. Analyzing it shows where narrow grants combine into broad effects, and informs both chain rules and least privilege design.

Relationship to Plan Drift Detection

Tool-chain analysis and plan drift detection
AspectTool-chain analysisPlan drift detection
Guiding questionDoes the ordered composition create a risky cumulative effectDoes the intended objective or effect diverge from the baseline
Reference pointChain constraints, invariants, lineage and execution statesRecorded task baseline
Typical findingSplit total above cap, read-then-send path, duplicate effectNew send or write the task never asked for
Blind spotA new objective expressed as a single isolated stepHarmful compositions within baseline classes

Plan drift detection and tool-chain analysis are complementary signal families.

Relationship to Per-Call Authorization

Per-call authorization is independent. A call can be individually permitted while the sequence still creates an unsafe combined effect. Conversely, a chain classified as within constraints does not pre-authorize any call. Each call still goes through agent authorization.

Relationship to Information Flow Control

Information flow control owns whether data from a source may reach a destination. Tool-chain analysis may identify a read-then-send path; IFC makes the separate, deterministic flow decision using labels and policy. A chain classified as within constraints never declassifies data.

Analyzer Families

Ways to analyze chains
  1. 01
    Deterministic rules

    Rules over structured chain facts and invariants, such as new destination class or state change in a read-only task.

  2. 02
    Graph and lineage analysis

    Source-to-sink paths and parent-child edges across hops.

  3. 03
    Stateful counters

    Aggregate constraints per task, updated from execution states.

  4. 04
    Policy or DSL sequence checks

    Declarative sequence patterns reviewed like other policy.

  5. 05
    Model-assisted semantic analysis

    Optional, for purpose questions structured fields cannot answer.

  6. 06
    Hybrid

    Recommended where structured facts exist: deterministic backbone, semantic analysis as an additional signal.

Model-Assisted Chain Analysis

A model-assisted analyzer is probabilistic. Isolate it from unnecessary untrusted context, give it no tools, require schema-bound findings with reason codes, and version it.

Response Policy

Response options by workflow risk tier
  1. 01
    Record

    Low-impact read-only workflows: log the finding for later analysis.

  2. 02
    Alert

    Send to triage with chain context and reason codes.

  3. 03
    Restrict

    Remove outbound or state-changing capabilities for the rest of the run.

  4. 04
    Pause

    Hold the run pending review for high-impact workflows.

  5. 05
    Reconcile

    For unobserved results, verify target state before any retry.

Avoid a blended trust score. Keep chain finding, provenance, authorization, flow decisions, classification and execution evidence as separate fields.

Telemetry Design

Record for each analyzed chain

  • Task, run and correlation IDs across all hops
  • Ordered call graph with sequence numbers and parent edges
  • Execution state per call, with explicit unobserved
  • Lineage references from source through derived content to sink
  • Counter values before and after each evaluated step
  • Reason codes, analyzer version and policy version
  • Response taken and by which policy rule
  • Marking of observed facts versus analyzer inference

When required fields are missing, report CHAIN_INCOMPLETE. Missing evidence is never evidence that the chain is within constraints.

Alert Quality and Triage

Alerts should show the ordered chain, the constraint it crosses, the reason code, execution states and lineage in one view. Triage decides whether a finding reflects influence, a missing task constraint, a legitimate workflow the constraints did not model or an analyzer error. Feed outcomes back into constraints and the regression set.

Worked Scenario A: Bounded Internal Report Chain

Task t-17: the user ops-user-dana asks for an internal restock report for SKU-17. Recorded chain: c1 read_stock(SKU-17), c2 read_threshold(SKU-17), c3 local compute, c4 draft_report to ops-user-dana. Constraints: read-only and draft-only, no external destination. All four steps are proposed.

Classification: within chain constraints. This is a sequence-level classification only. It grants no authorization and no standing or future authority; each call is still authorized separately.

Worked Scenario B: Read Then External Send

Task t-310: support-user-ana asks for a summary of synthetic case K-310. Recorded chain: c1 read_case(K-310), c2 summarize locally, c3 notify(to=reviewer@outside.example.test). Constraints: answer in chat to the initiating user, no outbound step. c1 to c3 are proposed.

Finding: chain risk with LINEAGE_TO_EXTERNAL_SINK and NEW_DESTINATION. The end-to-end path would move internal case data to an external destination the task does not contain. Because all steps are only proposed, no exfiltration or execution is claimed. IFC and per-call authorization still decide separately.

Worked Scenario C: Split Reservation and Retry After Unobserved Result

Task t-50 caps reservations of SKU-17 at 50 units in total; the tool accepts up to 40 per call. The proposed chain is c1 reserve 30 and c2 reserve 30. Each call is under the per-call maximum, but the chain total is 60. Finding: CUMULATIVE_LIMIT_EXCEEDED. Neither call executed, so no reservation is claimed, and the split is not proof of malice.

Task t-44 requires exactly one synthetic ticket for SIM-44. c1 create_ticket with key sim44-1 was authorized and submitted, and its acknowledgement was lost, so c1 is unobserved, not failed. The proposed c2 uses a new key sim44-2. Finding: DUPLICATE_EFFECT_RISK. Reconcile by reading ticket state or reusing the sim44-1 contract per application policy. No duplicate ticket is claimed.

A cross-agent variant: two read-only sub-agents with strict subset delegations and preserved lineage feed a parent that drafts an internal recommendation. With no permission union and no outbound step, the chain can remain within constraints.

What the Scenarios Prove and Do Not Prove

Interpreting the worked scenarios
ScenarioShowsDoes not show
A: bounded reportMulti-step chains can stay within constraintsThat any call is authorized or that the chain is safe in every respect
B: read then sendA composed path invisible to per-call reviewExfiltration, execution or malicious intent
C: split and retryCumulative and duplicate-effect risksThat a reservation or duplicate ticket exists

The same scenarios can be practised in the Tool-Chain Analysis lab, which is a deterministic simulation.

Testing and Validation

Maintain a labelled regression set that contains benign multi-step chains, risky composition chains, concurrent branches, retries after unobserved results and multi-agent hops. Test that missing fields produce CHAIN_INCOMPLETE, that unobserved is never read as failed and that responses only narrow authority. Benchmarks such as AgentDojo and InjecAgent evaluate agent behavior under injected tool content and can inform scenarios; they do not define this control.

Metrics

Operational measures with separate denominators
MetricDenominator
Chain reconstruction coverageRuns with tool calls
Lineage coverageCalls whose inputs derive from earlier calls
Execution-state coverageSubmitted calls
Cumulative-invariant coverageTasks with a defined cumulative constraint
Risky-composition recallLabelled risky composition cases
False-positive rateLabelled benign multi-step chains
Unobserved-result rateSubmitted state-changing calls
Duplicate-effect prevention or reconciliation rateProposed retries after an unobserved result
Reason-code distributionAll chain findings
Alert actionabilityTriaged alerts
Time to response or reconciliationFindings that triggered a response
Benign task utilityLabelled benign tasks

These are operational measures, not proof of security. Do not combine them into one score.

Common Mistakes

Failure patterns
  1. 01
    Trusting the model's summary

    Reconstructing the chain from narration instead of telemetry.

  2. 02
    Counting calls as risk

    Flagging long chains instead of cumulative effects.

  3. 03
    Treating unobserved as failed

    Allowing a new-key retry that duplicates an effect.

  4. 04
    Unioning permissions

    Treating hops as one agent with combined grants.

  5. 05
    Chain result as permission

    Skipping per-call authorization after a within-constraints result.

  6. 06
    Sorting by timestamp

    Losing dependencies in concurrent branches.

  7. 07
    Blended trust score

    Mixing chain, provenance and authorization evidence into one number.

Implementation Checklist

Before relying on tool-chain analysis

  • Chains are reconstructed from application records, not model prose
  • Order uses sequence numbers and parent edges, with branches represented
  • Execution states are recorded, including explicit unobserved
  • Cumulative invariants are stored with the task and checked per step
  • Lineage connects sources through derived content to sinks
  • Correlation IDs and bounded delegation scopes cover every hop
  • Reason codes, analyzer and policy versions are logged
  • Response policy can only narrow authority
  • Per-call authorization, IFC and output validation stay independent
  • A labelled regression set covers benign and risky chains

Standards and Sources

Standards and guidance referenced

Microsoft
Defend against indirect prompt injection attacks
OWASP
LLM01:2026 Prompt Injection, Top 10 for Agentic Applications 2026: ASI02 Tool Misuse and Exploitation, ASI03 Identity and Privilege Abuse
NIST
AI 100-2e2025 (terminology)

Source scope: Microsoft's guidance lists tool chain analysis as a technique to assess and block risky sequences of tool execution, alongside plan drift detection, information flow control and least privilege; it does not specify an algorithm. The OWASP Top 10 for Agentic Applications 2026 provides risk context for tool misuse and identity or privilege abuse; it does not define tool-chain analysis. OWASP LLM01:2026 provides prompt injection risk context. NIST AI 100-2e2025 is used only for terminology. CaMeL is related design research on separating control and data flow. Chain schemas, reason codes, counters, idempotency handling and graph reconstruction on this page are engineering guidance, not requirements from these sources.

Frequently Asked Questions

Does a chain finding block the call?

Not by itself. A response policy may restrict, pause or require reconciliation. Whether a call may run is decided by agent authorization.

Does within constraints mean safe?

No. It means no cumulative effect outside the recorded constraints was seen on the observed facts. It grants no authority.

Are long chains suspicious?

No. The number of calls is not a risk signal; cumulative effect is.

Is an unobserved result a failure?

No. It may or may not have taken effect. Reconcile before any retry.

How is this different from plan drift detection?

Plan drift compares intent with the task baseline. Tool-chain analysis evaluates how ordered steps combine.

Does it replace information flow control?

No. It can surface a read-then-send path; IFC decides whether the flow is allowed.

Can a model analyze chains?

It can help with purpose questions, but it is probabilistic, must have no tools and must never act as an authorization oracle.

Is tool-chain analysis a standard?

No published standard defines it. Microsoft names it as a technique; this page describes an engineering pattern.

References

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