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
| Control | Question it answers | Relation to tool-chain analysis |
|---|---|---|
| Tool-chain analysis | Does the ordered composition of calls create a cumulative effect outside task constraints | Owns chain reconstruction, cumulative checks, reason codes and hand-off to response policy |
| Plan drift detection | Does the intended objective or effect diverge from the recorded task baseline | Complementary; drift looks at intent against the baseline, chains look at composition |
| Agent authorization | May this fully resolved call execute | Independent and deterministic; a chain classification neither replaces nor pre-authorizes it |
| Information flow control | May data with these attributes reach this destination | Independent and deterministic; the chain view can surface a read-then-send path, IFC decides the flow |
| Least privilege | Which tools, credentials and capabilities exist at all | Bounds the inputs; chain analysis evaluates how available capabilities combine in one run |
| Output validation | Does output meet the sink's structural and format constraints | Independent; a chain within constraints still produces output that must be validated |
| Human-in-the-loop | Does a selected action need an informed human decision | A chain finding can add review context; it never replaces a required approval |
| Data provenance | Where did context and data come from | Supplies 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.
Data from an internal read reaches an outbound sink in a later step.
Several calls each respect a per-call limit but together exceed a task total.
A retry after an unobserved result repeats a state change.
Separate hops with narrow grants are combined into a larger effective capability.
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.
| Fact | Per-call review | Chain review |
|---|---|---|
| Parameters of this call | Yes | Yes |
| Where the data in this call's parameters came from | Only if lineage is attached | Yes, from recorded lineage |
| Running total against a task cap | No | Yes, from cumulative counters |
| Whether a prior identical effect is unobserved | No | Yes, from execution states |
| Which hop contributed which capability | No | Yes, 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, 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
The model suggested the call. Nothing happened.
The authorization layer permitted this resolved call. It may still not run.
The call was sent to or performed by the tool.
A result confirms the intended effect.
A result confirms the effect did not happen.
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
| Aspect | Tool-chain analysis | Plan drift detection |
|---|---|---|
| Guiding question | Does the ordered composition create a risky cumulative effect | Does the intended objective or effect diverge from the baseline |
| Reference point | Chain constraints, invariants, lineage and execution states | Recorded task baseline |
| Typical finding | Split total above cap, read-then-send path, duplicate effect | New send or write the task never asked for |
| Blind spot | A new objective expressed as a single isolated step | Harmful 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
- 01Deterministic rules
Rules over structured chain facts and invariants, such as new destination class or state change in a read-only task.
- 02Graph and lineage analysis
Source-to-sink paths and parent-child edges across hops.
- 03Stateful counters
Aggregate constraints per task, updated from execution states.
- 04Policy or DSL sequence checks
Declarative sequence patterns reviewed like other policy.
- 05Model-assisted semantic analysis
Optional, for purpose questions structured fields cannot answer.
- 06Hybrid
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
- 01Record
Low-impact read-only workflows: log the finding for later analysis.
- 02Alert
Send to triage with chain context and reason codes.
- 03Restrict
Remove outbound or state-changing capabilities for the rest of the run.
- 04Pause
Hold the run pending review for high-impact workflows.
- 05Reconcile
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
| Scenario | Shows | Does not show |
|---|---|---|
| A: bounded report | Multi-step chains can stay within constraints | That any call is authorized or that the chain is safe in every respect |
| B: read then send | A composed path invisible to per-call review | Exfiltration, execution or malicious intent |
| C: split and retry | Cumulative and duplicate-effect risks | That 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
| Metric | Denominator |
|---|---|
| Chain reconstruction coverage | Runs with tool calls |
| Lineage coverage | Calls whose inputs derive from earlier calls |
| Execution-state coverage | Submitted calls |
| Cumulative-invariant coverage | Tasks with a defined cumulative constraint |
| Risky-composition recall | Labelled risky composition cases |
| False-positive rate | Labelled benign multi-step chains |
| Unobserved-result rate | Submitted state-changing calls |
| Duplicate-effect prevention or reconciliation rate | Proposed retries after an unobserved result |
| Reason-code distribution | All chain findings |
| Alert actionability | Triaged alerts |
| Time to response or reconciliation | Findings that triggered a response |
| Benign task utility | Labelled benign tasks |
These are operational measures, not proof of security. Do not combine them into one score.
Common Mistakes
- 01Trusting the model's summary
Reconstructing the chain from narration instead of telemetry.
- 02Counting calls as risk
Flagging long chains instead of cumulative effects.
- 03Treating unobserved as failed
Allowing a new-key retry that duplicates an effect.
- 04Unioning permissions
Treating hops as one agent with combined grants.
- 05Chain result as permission
Skipping per-call authorization after a within-constraints result.
- 06Sorting by timestamp
Losing dependencies in concurrent branches.
- 07Blended 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
- Defend against indirect prompt injection attacksMicrosoft Learn · GuidanceReviewed 2026-09-27
- OWASP Top 10 for Agentic Applications for 2026OWASP GenAI Security Project · Guidance · 2025-12Reviewed 2026-09-27
- OWASP GenAI LLM Top 10 2026 (LLM01:2026 Prompt Injection)OWASP GenAI Security Project · GuidanceReviewed 2026-09-27
- Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations, NIST AI 100-2e2025NIST · Standard · 2025-03Reviewed 2026-09-27