Skip to content

AgentTracer: Tracing Indirect Prompt Injection Attacks via Fine-Grained Intent-Execution AlignmentAgentTracer: Tracing Indirect Prompt Injection Attack through Fine-Grained Intention-Execution Alignment

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.09935· Zitong Yao, Jiangrong Wu, Yixi Lin, Anrui Huang, Luoyun Zhang, Yuhong Nan·Indexed by this site · 2026-10-08· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

AgentTracer treats IPI as intent drift, with an average injection point accuracy of 94.17% and path precision of 93.56% across 300 samples in each of two datasets.

Threat modelAn attacker can embed natural language instructions in external resources processed by the agent but cannot modify the original user request or execution logs. Tracing starts from anomalous tool calls; logs must contain user requests, reasoning records, and tool records. Attacks that do not produce tool execution are out of scope.

Questions
IPI hides malicious instructions in external resources such as web pages and emails, causing the agent to deviate from the user's task. Post-hoc, the challenge is to locate the injection point and reconstruct the attack chain among tool calls interleaved with legitimate operations and often lacking explicit dependencies. The authors state that dependency graph, contribution, and counterfactual methods struggle to recover the complete chain.
Methods
AgentTracer treats IPI as intent drift: it recovers decision dependencies from reasoning traces and builds an intent execution graph; it instantiates user requests into an authorization space using an operation knowledge base, marks drift edges by action, goal, and constraint, and then traces backward from anomalous events to the injection point.
Experiments and results
After mixing 300 successful logs each from AgentDyn and InjecAgent with 1,800 normal requests and 9,000 background calls, the average injection-point accuracy is 94.17% and path precision is 93.56%. On the comparison set of 100, it is 94.00%, which the authors state is 18.00–54.00% higher than the baselines.
Limitations and future work
The authors state that performance degrades without reasoning records, and that code-level injection is not directly traced; the 45 cross-session experiments were not included in the formal evaluation. The formal evaluation uses successful logs from AgentDyn and InjecAgent and a five-month Codex historical pool, with the backbone LLM being deepseek-v4-flash.
Experimental setupAgentDyn、InjecAgent et al. · DetectionRate、InjectionAcc et al.
Benchmarks
AgentDynInjecAgenthistorical-log pool
Metrics
DetectionRateInjectionAccCoveragePrecisionedge-level false-positive rate
AI summaryThe researchers propose AgentTracer, an intent-aware tracing framework that treats indirect prompt injection as task intent drift, for post-hoc localization of injection sources and reconstruction of attack chains. The method recovers implicit decision dependencies between tool calls, builds an intent-driven execution graph, and connects scattered tool calls by task intent; combined with user requests and an operation knowledge base, it constructs a user intent authorization space to identify tool calls with intent drift. Starting from anomalous tool calls in the audit, AgentTracer reconstructs the attack chain through goal pruning and backward tracing, locating the injection source and injection point. In end-to-end experiments mixing successful IPI attack execution logs from AgentDyn and InjecAgent with normal logs containing 1,800 user requests and 9,000 background tool calls without IPI, AgentTracer achieves 94.17% injection point accuracy and 93.56% path precision, improving injection point accuracy by 18% to 54% over existing methods.

The researchers propose AgentTracer, an intent-aware tracing framework that treats indirect prompt injection as task intent drift, for post-hoc localization of injection sources and reconstruction of attack chains. The method recovers implicit decision dependencies between tool calls, builds an intent-driven execution graph, and connects scattered tool calls by task intent; combined with user requests and an operation knowledge base, it constructs a user intent authorization space to identify tool calls with intent drift. Starting from anomalous tool calls in the audit, AgentTracer reconstructs the attack chain through goal pruning and backward tracing, locating the injection source and injection point. In end-to-end experiments mixing successful IPI attack execution logs from AgentDyn and InjecAgent with normal logs containing 1,800 user requests and 9,000 background tool calls without IPI, AgentTracer achieves 94.17% injection point accuracy and 93.56% path precision, improving injection point accuracy by 18% to 54% over existing methods.

Related events and news

2 events · 2 news mentions

News that mentions this paper

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    In post-hoc tracing of IPI, malicious calls often lack explicit dependencies and are interleaved with legitimate operations; AgentTracer reconstructs the attack chain via intent drift.

    After the fact, locate IPI injection points and reconstruct the attack chain from tool calls that are interleaved with legitimate operations and often have no explicit dependencies.

    • Scenario: The authors state that agents accessing external resources during office work, shopping, and software maintenance are exposed to indirect prompt injection (IPI). Malicious instructions come from lower-trust sources such as web pages and emails, steering execution from the user's task toward the attacker's intent. The authors state that IPI is prevalent and difficult to defend against in real environments, making tracing and attribution after anomalous tool calls crucial.
    • Limitations of existing work: The authors state that existing methods mainly traverse backward along explicit control flow or data flow, or assign contribution scores to input segments, or use counterfactual interventions to estimate influence. Multiple calls driven by malicious instructions can have no explicit dependencies and can be interleaved with legitimate operations, which the authors state makes it difficult to obtain a complete and precise attack chain.
    • Core assumption: The authors define task intent as the task goal realized by a sequence of tool calls; user intent comes from the user request, and attacker intent comes from malicious instructions. The authors treat IPI as task intent drift, where calls deviating from user intent form the attack chain in sequence.
    • Proposed method: AgentTracer recovers implicit decision dependencies between tool calls, builds an Intent-Driven Execution Graph, uses the user request and an operational knowledge base to delineate the authorization space and mark drift calls, then traces backward from the audited anomalous event to locate the injection source and injection point.
    • Threat model:
      • Attacker capability: Can embed natural language instructions in external resources processed by the agent; cannot modify the original user request or execution logs.
      • Scope: Only analyzes IPI where malicious instructions influence reasoning and produce observable tool calls; attacks that do not result in tool execution are out of scope.
      • Log prerequisite: Applicable to agent logs containing user requests, reasoning records, tool calls, and tool results.
      • Audit goal: Given historical logs and an anomalous event, determine whether it is attributable to IPI; if so, output the ordered attack chain excluding legitimate interleaved calls, the injection source, and the injection point.
  2. What related research exists?

    Related work covers prompt injection benchmarks, agent defenses, and execution tracing; the authors position this work as post-hoc intent-alignment tracing.

    Prompt Injection and Attack Benchmarks

    • Instructions in external resources: Greshake et al. (2023), Yi Liu et al. (2023), Yupei Liu et al. (2023) discuss prompt injection in external content or application integrations. Toyer et al. (2023)'s Tensor Trust and Yi et al. (2023) provide prompt injection benchmarks.
    • Tool execution and multi-step attacks: AgentDojo, InjecAgent, and Agent Security Bench cover injection in tool execution; AgentDyn and StepJack cover dynamic, multi-step attacks; AgentHarm covers harmful multi-tool tasks. The authors state that these works show malicious instructions can induce a chain of tool calls, thus requiring reconstruction of the full attack chain.

    Agent Safety Evaluation and Defenses

    • Behavior and risk evaluation: AgentBench, AgentBoard, OSWorld, and WebArena evaluate interaction, web, and computer use; Ruan et al. (2023) use sandboxes to identify risks, and R-Judge, Agent-SafetyBench, and AgentHarm evaluate risky tool use or harmful task completion.
    • Layered defenses: StruQ, SecAlign, Spotlighting, and Instruction Hierarchy strengthen instruction separation at the model layer; information flow control, Debenedetti et al. (2025)'s design-based defenses, and Progent enforce system-level information flow or permission policies; ToolSafe, Agent-Sentry, and AuthGraph check tool behavior or authorization at runtime.

    Execution Tracing and Reasoning Evidence

    • System provenance: PROV-DM characterizes entities, activities, and provenance relationships; SLEUTH, NoDoze, and UNICORN use execution provenance for security analysis.
    • Three types of agent tracing: Graph-based methods traverse backward along control flow, data flow, or explicit dependencies; the paper names Agent-BOM, TraceAegis, and AgentArmor; attribution methods assign contribution scores to tokens or segments, naming PromptLocate and AttnTrace; counterfactual methods remove or replace context to see if anomalous events still occur, naming NeuroTaint and ARGUS. The authors state in Section 2 that parameterless attack steps cannot be linked by parameter dependencies; attribution methods cannot connect ordered attack chains; and legitimate operations may also be flagged as candidate injection sources by counterfactual methods.
    • Whether reasoning is faithful: Chain-of-thought, ReAct, and structural representations expose reasoning or execution structure. The authors cite Turpin et al. (2023), stating that generated reasoning may be unfaithful, so they ground extracted decision relationships in executed tool calls.

    Baseline methods are Codex, OpenClaw, and Agent-BOM, NeuroTaint, AuthGraph, AgentArmor, ARGUS. Benchmarks/datasets are execution logs of successful IPI attacks on AgentDyn and InjecAgent, mixed with a historical log pool without IPI.

    The authors position AgentTracer on the post-hoc tracing side: it connects scattered tool calls via task intent, rather than intercepting injection at the model, system, or runtime, and does not rely solely on explicit execution dependencies, contribution scores, or counterfactual interventions.

  3. How does the paper address this problem?

    AgentTracer uses decision dependencies to build an intent-driven execution graph, then uses the authorization space to mark drift edges, and traces backward from anomalous events to the injection point.

    AgentTracer turns post-hoc IPI tracing into an alignment between task intent and tool calls. The input is historical execution logs and anomalous events; the output is whether the event is attributed to IPI, along with the attack chain, injection source, and injection point. Three modules build the graph, mark drift edges, and then prune and trace back by anomalous events.

    Log Slicing and Intent Setting

    • Analysis unit: From the anomalous event, trace backward to the nearest user request; the logs between the two are called a LogSegment. The authors believe IPI unfolds within this segment.
    • Intent representation: User intent is a sequence of tool calls driven by the user request. After IPI occurs, the calls in the actual sequence that deviate from user intent, in order, constitute the attacker's intent. The attack chain should include these calls and exclude interleaved legitimate calls.
    • Role of the graph: A directed multigraph connects entry nodes to resource nodes. Edges store operations: the source node provides decision context, and the target node is the object introduced by a successful tool call. Edges directly based on the user request start from the entry node.

    Intent Execution Graph

    • Extract resources: For each successful tool record, extract the operation and the data object it introduces; the object becomes a resource node. Nodes introduced into context from the external environment via tool results are marked as ExternalResource.
    • Extract decision relations: From each reasoning record, extract ContextDecisionRel, containing the source entities supporting the decision, the intent operation, and the expected target entity. If a reasoning record contains n tool decisions, extract n relations. Figure 3 shows four entity associations: one-to-one, one-to-many, many-to-one, and many-to-many.
    • Land onto edges: After the intent operation matches a successful tool call, the source entity pair maps to an existing resource node, and the target entity pair maps to the node introduced by that call, forming a decision-landing edge with an operation attribute. If the source node of a later edge is the target node of an earlier edge, the two calls are connected through decision dependency. Failed calls do not enter the graph.

    User Intent Alignment

    • Authorization space: UA-Scope consists of task frames and their dependencies. Table 1 groups actions into four categories—acquisition, processing, modification, and interaction—with 11 high-level operation classes. The operation knowledge base provides five types of templates per class: operation boundaries, prerequisite operations, follow-up operations when failure or missing information occurs, targets and their authorized scope, and execution checkpoints.
    • Two-stage instantiation: First, extract explicit steps from the user request and map them to operation classes, then build the task frame. Next, retrieve operation knowledge and add allowed supporting operations and explicit constraints. Figure 4 uses a salary summary request as an example: summarization and sending are main steps, locating and reading files serve as prerequisites, and execution conditions, recipients, and payload limits are specified.
    • Bounded dynamic completion: Only when the user request explicitly authorizes a contextual entity to provide missing information is it extracted for the parameters or steps it is authorized to provide. Other entities referenced by that entity cannot gain the authority to define new steps.
    • Three-dimensional judgment: For landed decision relations, check along action, target, and constraint whether it is a main operation or an allowed supporting operation, whether the target is within the authorized scope, and whether parameter and execution constraints are satisfied. Each dimension takes Satisfied, Violated, or N/A. Single-frame aggregation is R(r,f)=Misaligned (if any dimension is Violated); when all three dimensions are Satisfied or N/A, it is Aligned. The meaning is that any authorization conflict makes the frame misaligned. Only when aligned with at least one candidate task frame is it marked Aligned; otherwise it is marked Misaligned and written to all edges landed by that relation.

    Attack Chain Tracing and Judgment

    • Analysis scope: Use the anomalous event's operation, target, and available parameters to match tool records in historical logs. Candidates are analyzed from newest to oldest; tracing stops when a LogSegment reconstructs a complete IPI attack chain.
    • Graph and path scope: When building the graph, remove failed tool calls and their reasoning records; for replanning that succeeds after failure, keep only the edges corresponding to successful execution. The sink is the resource node introduced by the anomalous event; trace backward only along Misaligned edges entering that event until no earlier drift edge remains.
    • Whether attributed to IPI: If the sink has no corresponding incoming Misaligned edge, it is not judged as IPI. When the root node of the drift path is an ExternalResource, it is judged as IPI: the root node is the injection source, the log line where the external resource enters context is the injection point, and the tool calls from root to sink constitute the attack chain. When the root node is not an ExternalResource, the authors state the deviation may also come from misunderstanding or execution errors and is not judged as IPI. If no candidate has a drift path, the anomalous event is not attributed to IPI.
  4. What experiments did the paper conduct?

    On 300 cases from each of the two datasets, the average injection point accuracy is 94.17% and path precision 93.56%; in the comparison experiment, injection point accuracy is 94.00%.

    Experimental setup

    • Attack logs: Only successful IPI is kept. AgentDyn has 356 logs covering daily life, code hosting, and online shopping, with attack chains averaging 3 tool calls and lengths from 1 to 8. InjecAgent has 936 logs reproduced on the Codex platform, covering device control, finance, code hosting, cloud storage, and others. The paper does not report the victim model names used to generate these logs.
    • Noise: The historical log pool comes from a five-month Codex environment and contains 1,800 normal user requests and 9,000 background tool calls without IPI. InjecAgent logs are merged directly; AgentDyn logs are normalized before insertion. The authors state that the evaluated attack chains average about 3 calls, with a background-to-attack-chain call ratio of about 3,000:1. All tracking is performed in the full pool.
    • Annotation and metrics: Human annotators label anomalous events, injection points (the log lines where malicious content first enters the context), and attack-chain tool-call sets. Under this annotation, injection sources and injection points correspond one-to-one, so only injection-point accuracy is reported. The denominators of both DetectionRate and InjectionAcc are the total number of IPI logs. Coverage and Precision are computed from the intersection of the recovered set and the annotated set, not as step-by-step sequential matching; precision is recorded as 0 when no chain is returned. The paper does not report annotation agreement.
    • Model and repetition: All AgentTracer components and baselines that require an LLM use deepseek-v4-flash. The paper does not report the number of repetitions or results after changing this model.
    • Sampling: The end-to-end experiment uses 300 randomly selected logs per dataset. The comparison experiment draws another 100 logs, with annotated chains averaging 4 tool calls. The ablation uses another 100 chains different from the comparison set. The benign experiment additionally takes 100 injection-free AgentDyn logs.

    Main results

    Swipe horizontally to read the table

    DatasetNDetection rateInjection-point accuracyCoveragePrecision
    AgentDyn30098.67%93.33%89.24%91.11%
    InjecAgent30096.00%95.00%91.25%96.00%

    Per Table 2. The authors report averages across the two datasets of 97.34% detection rate, 94.17% injection-point accuracy, 90.25% path coverage, and 93.56% path precision, and state that end-to-end tracking is effective.

    • Sources of error: The authors state that one class of errors comes from natural-language reasoning traces: the LLM may extract the wrong source entity, target entity, or intent operation, and entity aliases may also be attached to the wrong node.
    • Deviation without IPI: The authors state that an agent may deviate from the user request even without IPI; such edges are correctly labeled Misaligned and form drift branches unrelated to the attack chain; backtracking anchors on anomalous events to exclude these branches.
    • How to read the table: The denominator of injection-point accuracy is all IPI logs, not only detected samples. Coverage is lower than precision on both datasets; the authors do not separately explain this gap.

    Comparison with existing methods

    The comparison is conducted on another 100 chains. When baselines lack complete implementations, they are reproduced according to the published algorithms, prompts, and rules; ARGUS uses the core components released with AgentLure. Per Table 3:

    Swipe horizontally to read the table

    MethodDetection rateInjection-point accuracyCoveragePrecision
    Codex93.00%70.00%46.22%50.98%
    OpenClaw89.00%69.00%44.80%50.20%
    Agent-BOM52.00%43.00%50.92%45.89%
    NeuroTaint98.00%40.00%47.97%91.40%
    AuthGraph100.00%68.00%88.28%75.41%
    AgentArmor99.00%76.00%94.10%53.62%
    ARGUS95.00%70.00%80.28%66.79%
    AgentTracer98.00%94.00%88.07%93.18%
    • Improvements reported by the authors: The authors state that relative to all baselines, injection-point accuracy improves by 18.00–54.00%; the abstract writes 18–54%. Relative to Codex and OpenClaw, injection-point accuracy is higher by 24.00% and 25.00%, respectively, and path precision is higher by 42.20% and 42.98%.
    • Not the highest on every metric: The authors state that AuthGraph has a higher detection rate but a much lower injection-point accuracy; AgentArmor has higher coverage but much lower precision. The authors state that AgentTracer is the strongest overall in injection-point identification and precise reconstruction.
    • Direct tracking: The authors state that when analyzing raw logs directly without a structured intermediate representation, it is difficult to connect scattered attack steps and separate them from unrelated calls.

    Module ablation

    On another set of 100 chains, the full AgentTracer has a detection rate, injection-point accuracy, coverage, and precision of 98.00%, 91.00%, 90.32%, and 88.66%, respectively (Table 4); this is not the same sample as Table 3.

    • Removing the intent execution graph: After switching to connecting adjacent tool calls by time, the four metrics are 78.00%, 74.00%, 58.54%, and 80.97%. The authors state that injection-point accuracy drops by 17.00% and path coverage by 31.78%, because calls from different task intents interleave and temporal adjacency does not imply decision relevance.
    • Removing structured alignment: After switching to having the LLM directly judge whether an edge is drift, the four metrics are 79.00%, 64.00%, 57.04%, and 77.91%. The authors state that injection-point accuracy drops from 91.00% to 64.00%, and state that natural-language user requests are often vague and lack a reliable alignment criterion.

    Alignment on benign tasks

    • What is measured: 100 injection-free AgentDyn logs, where only the graph is built and alignment is performed on evaluable landed decision relations, without attack-chain backtracking. There are 394 evaluable execution edges in total.
    • Results: In manual review, 25 edges labeled Misaligned are genuine execution deviations and are not counted as false positives. After excluding them, 13 of the remaining 369 legitimate edges are mislabeled, giving an edge-level false positive rate of 3.52%.
    • Authors' interpretation: The authors state that the impact of isolated false-positive edges is further limited because an anomalous event is attributed to IPI only when a drift path connects an ExternalResource root node to a sink.

    Other ablations and analyses

    • Removing event-guided pruning (Table 5, same ablation sample): Full-history LLM analysis gives 97.00%, 89.00%, 87.29%, and 85.54% on the four metrics; relative to the full method, analysis time increases by 30.98% and token consumption by 51.24%. The authors state the effect is similar but the cost is higher.
    • Cross-session exploration (Section 6.1, informal evaluation): Reproducing the 45 cases from Xie et al., injection-point accuracy exceeds 85%. The authors state that the sample size and scenarios are insufficient to support general conclusions and this is not included in the formal evaluation.
  5. What are some points that can be further explored?

    The authors state that cross-session samples are insufficient to draw general conclusions, code-level injection is not directly traced, and performance degrades when reasoning records are absent.

    Limitations and future directions noted by the authors

    • Dependence on reasoning traces (Section 6.1): The authors state that AgentTracer is best suited to ReAct or similar perceive–plan–act–observe loops. Black-box agents without reasoning traces can only be analyzed through tool records; the time-graph ablation shows that tracking performance drops when reasoning evidence is absent.
    • Persistent IPI across sessions (Section 6.1): The authors state that the design can extend to cases where malicious content influences later sessions through memory, configuration, or other persistent entities. The sample size of 45 cases and the covered scenarios are insufficient to support general conclusions; the authors leave broader persistent entities and cross-session tracking evaluation to future work and do not count this result in the formal evaluation.
    • Code-level injection (Section 6.2): The authors state that code-level injection is not currently tracked directly. Malicious code may modify files, change environment variables, or issue network requests without appearing as separate agent tool calls. The authors discuss extending this with system-level tracing that combines system calls, file access, and network activity; this is not a completed integration.
    • Incomplete baseline implementations (Section 6.2): The authors state that some comparison methods have not released complete implementations, so they were reproduced according to the published algorithms, prompts, and rules. The authors also state that the conclusions do not rely only on these comparisons; the end-to-end and ablation experiments evaluate AgentTracer and its components separately.
    • Industrial logs are hard to reproduce as-is (Section 6.2): The authors state that long-term industrial deployments accumulate large amounts of execution data over time, making it difficult to reproduce their log environments. They approximate this with five months of Codex logs and state that it remains effective under roughly 3,000:1 background noise because event-guided pruning restricts analysis to relevant log segments and drift paths.

    Experimental coverage

    • The formal end-to-end evaluation uses 300 of AgentDyn's 356 successful attack logs and 300 of the 936 logs reproduced on the Codex platform from InjecAgent, tracked in a historical pool containing 1,800 normal requests and 9,000 background tool calls (Sections 5.1–5.2, Table 2).
    • The comparison experiments use another 100 attack chains, with baselines Codex, OpenClaw, Agent-BOM, NeuroTaint, AuthGraph, AgentArmor, and ARGUS; the ablation uses a different set of 100 chains (Sections 5.3–5.4, Tables 3–5).
    • The benign alignment uses another 100 injection-free logs selected from AgentDyn, with 394 evaluable edges; all LLM-requiring components and baselines use deepseek-v4-flash (Sections 5.1, 5.5).
    • Ground truth is manually annotated anomalous events, injection points, and attack-chain tool-call sets. The paper does not report the number of annotators, annotation agreement, number of repeated runs, or the model name of the victim agent used to generate the attack logs.
    • The formal metrics cover only natural-language IPI that produces tool calls. The 45-case cross-session result in Section 6.1 is excluded by the authors from the formal evaluation; the paper does not report tracking numbers after changing the backbone LLM.
  6. Summarize the main content of the paper

    AgentTracer treats IPI as intent drift, uses an intent execution graph and alignment to trace back the attack chain, with an average injection-point accuracy of 94.17%.
    • Positioning: AgentTracer is a post-hoc tracing framework for IPI on agent execution logs, aiming to locate the injection source and injection point after anomalous tool calls appear, and reconstruct the attack chain excluding legitimate interleaved calls.
    • Problem: Malicious instructions from external resources can drive a chain of tool calls without explicit data dependencies, interleaved with user-authorized operations. The authors argue that relying only on control flow, data flow, contribution scores, or counterfactual interventions makes it difficult to recover this attacker-intent chain.
    • Method: Extract decision relationships from reasoning records and ground them in successful tool calls to obtain an intent execution graph; instantiate the authorization space using 11 categories of operation knowledge and user requests, marking drift edges by action, target, and constraints; then use anomalous events as anchors for three-level pruning of log segments, successful calls, and drift paths, classifying as IPI only when the root node of the drift path is an external resource.
    • Main results: In a historical pool mixed with 1,800 normal requests and 9,000 background calls, across 300 cases each from AgentDyn and InjecAgent, the average detection rate is 97.34%, injection point accuracy 94.17%, path coverage 90.25%, and path precision 93.56% (Table 2).
    • Comparison and exceptions: On another 100 chains, AgentTracer achieves 94.00% injection point accuracy and 93.18% path precision; the authors state this is 18.00–54.00% higher than baselines, but detection rate and coverage are not the highest in the table (Table 3). Without the intent graph or structured alignment, injection point accuracy drops to 74.00% and 64.00% (Table 4). The false positive rate on edges without injection is 3.52% (13/369).
    • Authors' conclusions: The authors state that the reconstructed evidence supports incident analysis and response; they also note that the method relies on reasoning records, does not directly trace code-level injection, and the 45 cross-session explorations are insufficient for general conclusions.

Related papers

Show 3 more papers
Read originalarxiv.org