Manuscript Offprint
arXiv:2610.09935AgentTracer: Tracing Indirect Prompt Injection Attack through Fine-Grained Intention-Execution Alignment
Zitong Yao, Sun Yat-sen University, China
Jiangrong Wu , The Hong Kong University of Science and Technology, China
Yixi Lin, Sun Yat-sen University, China
Anrui Huang, Sun Yat-sen University, China
Luoyun Zhang, Sun Yat-sen University, China
Yuhong Nan, Sun Yat-sen University, China
Large language model (LLM) agents interact with external resources to complete complex user tasks, exposing them to indirect prompt injection (IPI), where malicious instructions redirect agents toward attacker-intended tasks. Since IPI is difficult to defend against in real-world environments, post-incident tracing is essential for locating the injection source and reconstructing the attack chain. However, existing tracing methods primarily capture explicit control-flow and data-flow dependencies, overlooking the implicit relationships among tool calls driven by the malicious instruction. These tool calls may lack explicit dependencies and be interleaved with legitimate operations, making complete attack-chain reconstruction difficult. In this paper, we present AgentTracer, an intent-aware tracing framework that treats IPI as task intent drift. AgentTracer recovers implicit decision dependencies among tool calls to construct an Intent-Driven Execution Graph that connects dispersed tool calls by task intent. It combines the user request with an operation knowledge base to construct a user intent authorization space and identify intent-drift tool calls. Starting from an anomalous tool call under audit, AgentTracer performs target-based pruning and backward tracing to reconstruct the attack chain and locate the injection source and injection point. To evaluate AgentTracer in the presence of noise from normal tasks, we combine execution logs constructed from successful IPI attacks in AgentDyn and InjecAgent with normal execution logs containing 1,800 user requests and 9,000 background tool calls without IPI. In end-to-end experiments, AgentTracer achieves 94.17% injection-point accuracy and 93.56% path precision. Comparative experiments show that AgentTracer improves injection-point accuracy over existing methods by 18–54%.
CCS Concepts: • Software and its engineering → Software creation and management.
Additional Key Words and Phrases: LLM agents, indirect prompt injection, security tracing, attack-chain reconstruction, intent alignment
1 Introduction
Large language model (LLM) agents have now become one of the mainstream application architectures, which can perform tasks such as office work, online shopping, and software maintenance. To handle complex user tasks, existing agents often need to interact with external resources. This exposes them to a common threat known as Indirect Prompt Injection (IPI) [9, 45, 47]. IPI involves embedding malicious instructions within external resources (e.g., web pages, emails) to compromise the LLM powering an agent and redirect an agent from the user task to perform the attacker-intended task.
In real-world environments, IPI is ubiquitous and difficult to defend against [7, 9, 47]. Therefore, a security tracing and attribution method for IPI is crucial. When an anomalous tool call is discovered,
Corresponding author.
Authors' Contact Information: Zitong Yao, Sun Yat-sen University, Guangzhou, China, yaozt@mail2.sysu.edu.cn; Jiangrong Wu, The Hong Kong University of Science and Technology, Hong Kong, China, jiangrongwu@cse.ust.hk; Yixi Lin, Sun Yat-sen University, Guangzhou, China, linyx98@mail2.sysu.edu.cn; Anrui Huang, Sun Yat-sen University, Guangzhou, China, huanganr3@mail2.sysu.edu.cn; Luoyun Zhang, Sun Yat-sen University, Guangzhou, China, zhangk367@mail2.sysu.edu.cn; Yuhong Nan, Sun Yat-sen University, Guangzhou, China, nanhy@mail.sysu.edu.cn.
auditors need a tracing method to investigate the incident. Such a method enables developers or auditors to trace the entire IPI incident through vast agent execution logs, thereby guiding developers in deploying superior and more robust agent architectures and supporting auditors in responding to incidents.
However, existing tracing methods [2, 16, 19, 38, 41] for LLM agents are limited for IPI attacks. Existing work primarily captures explicit control-flow and data-flow dependencies, overlooking the tool call sequence relationship generated by the malicious instructions, which represent the attacker intent. Since an IPI instruction can influence several tool calls without explicit dependencies between them, together with legitimate and malicious operations may alternate within one execution, existing tracing methods are incompatible for IPI attacks.
Our Work. In this paper, we propose AgentTracer, an intent-aware tracing framework for IPI attacks. We define task intent to represent the tool call sequence executed by the agent for the task goal (More details in Section 2.1). The key of AgentTracer is to treat the IPI as a form of task intent drift by the malicious instruction, which causes the corresponding tool invocation to deviate from the user intent (i.e., the tool call sequence expected by the user). Accordingly, AgentTracer compares the agent's task intent against the user intent to identify intent-drift operations, reconstruct the attack chain, and locate the injection source and its entry point in the agent execution log (the injection point).
To achieve this goal, there are three challenges that need to be solved: (i) How to construct a tracing graph that connects tool calls driven by the task intent; (ii) How to recognize tool calls that drift from the user intent; (iii) How to efficiently reconstruct the attack chain from noisy historical agent execution logs. First, legitimate and malicious operations may be interleaved in agent execution logs. This interleaving makes it difficult to connect dispersed tool calls by task intent. Second, user requests only describe high-level goals. Therefore, it is necessary to transform a natural-language request into a concrete yet flexible authorization space, which acts as the criteria for identifying intent-drift operations. Third, historical agent execution logs contain large amounts of unrelated execution data. Effective tracing must prune the tracing space while preserving the critical log scope needed to reconstruct the attack chain.
AgentTracer addresses these challenges with three core modules:
• Intent-Driven Execution Graph Construction. Based on the agent’s execution logs, AgentTracer recovers implicit decision dependencies among tool calls and uses these dependencies to construct an Intent-Driven Execution Graph. The graph connects dispersed tool calls by task intent.
- User Intent Alignment. AgentTracer combines the user request with an operation knowledge base to construct a concrete user intent authorization space. AgentTracer then evaluates agent tool calls against this space to identify intent-drift tool calls.
• Attack-Chain Traceback. AgentTracer performs event-guided pruning to progressively narrow the tracing space and reconstruct the attack chain. The anomalous tool call under audit serves as the pruning anchor. AgentTracer then traces the intent-drift tool-call sequence backward to reconstruct the attack chain and locate the injection source and injection point.
Evaluation. We evaluate AgentTracer on two representative datasets, AgentDyn [17] and InjecAgent [47], covering diverse implementations of IPI attacks. In addition, to evaluate AgentTracer under noise from normal tasks, we combine the attack logs with normal execution logs containing 1,800 user requests and 9,000 background tool calls without IPI. All attack-tracing experiments are conducted on the combined execution logs.

Fig. 1. An Example of an Indirect Prompt Injection (IPI) Attack. The malicious instruction induces an attack chain interleaved with user-authorized tool calls.
Across the two datasets, AgentTracer achieves 94.17% injection-point accuracy (accuracy in locating the injection point) and 93.56% path precision (precision of the reconstructed attack chain). Compared with existing methods, AgentTracer improves injection-point accuracy by 18–54%.
Contributions. Our contributions are threefold:
-
We formulate IPI tracing as fine-grained alignment between task intent and tool calls. We introduce the Intent-Driven Execution Graph to connect dispersed tool calls by task intent and represent the tool-call sequence that realizes each task intent.
-
We propose a knowledge-enhanced user intent alignment method that combines the user request with operation knowledge to construct a structured user intent authorization space. The method evaluates tool calls along three dimensions—action, target, and constraint—to identify intent drift.
-
We construct and annotate datasets of agent execution logs covering diverse agent scenarios and multi-step IPI attacks. The evaluation demonstrates the effectiveness and efficiency of AgentTracer in locating injection points and reconstructing attack chains.
2.1 Background
Indirect Prompt Injection (IPI). LLM agents can perform complex tasks with external resource interaction, but this exposes them to a common threat known as Indirect Prompt Injection (IPI) [9, 45, 47]. IPI occurs when an agent treats malicious instructions embedded in external resources as instructions for its own behavior. Unlike a direct user request, a malicious instruction enters the agent's context through a lower-trust source, such as a retrieved webpage or a received email. The malicious instruction can introduce an unauthorized attacker intent while appearing relevant to the user request. The attacker intent may then drive a sequence of tool calls, which collectively forms an IPI attack chain.
For example, Figure 1 shows a multi-step IPI attack. The user asks the agent to download the release from www.redscalar.com and upload it to a GitHub repository. While performing this task, the agent encounters a malicious instruction on the release page. The instruction induces the agent to register an attacker-controlled SSH key and clear its working memory. Meanwhile, the agent continues performing the user-authorized task, causing legitimate and malicious tool calls to become interleaved in the agent execution log. The following four malicious tool calls form the attack chain: git_add_ssh_key, get_received_emails, verify_github_account, and clear_working_memory. Suppose an audit is triggered by the final memory-clearing tool call. The reconstructed attack chain reveals the earlier registration of an attacker-controlled key, enabling auditors to revoke the malicious key and examine repository activity. The same evidence also helps developers identify security weaknesses and harden the agent architecture.
Definition of Task Intent. A task intent is a task goal realized by a sequence of tool calls. A task intent can be either user intent, which originates from the user request, or attacker intent, which is introduced by a malicious instruction.
The user intent can be represented as , where each is a tool call driven by the user request. When an IPI attack occurs, a malicious instruction induces the agent to pursue a new task intent. As a result, the actual tool-call sequence may become , where each is a tool call that deviates from the user intent. These intent-drift tool calls form in order. The sequence represents the attacker intent and forms the IPI attack chain.
Agent Attack Investigation. Agent tracing is a form of post-incident analysis that begins when an anomalous tool call is discovered. We refer to this anomalous tool call as anomalous event. Given the anomalous event and historical agent execution logs, an auditor seeks to identify the source of the anomalous behavior and reconstruct the relevant tool-call sequence.
Existing tracing methods follow three main strategies: (i) tracing execution dependencies in a graph; (ii) localizing high-contribution input fragments; and (iii) estimating causal influence through counterfactual interventions. Graph-based methods represent control flow, data flow, or other explicit execution dependencies as edges in a tracing graph. They traverse the graph backward from the anomalous event to identify related operations and possible sources [16, 19, 38]. Attribution-based methods estimate the contribution of each token, text fragment, or input region to the occurrence of the anomalous event. Fragments with high contribution scores are treated as likely sources of the anomalous event [15, 39]. Counterfactual-based methods remove or replace candidate context and observe whether the anomalous event still occurs. A candidate context is considered influential if removing or replacing it prevents the anomalous event [2, 41].
2.2 Motivation
Limitations of Existing Work. Existing log tracing approaches mainly infer tracing relationships from data dependencies or causal correlations, overlooking the attacker intent behind a sequence of tool calls without data dependencies and causal correlations. The case in Figure 1 illustrates the limitations of these methods in recovering IPI attacks. (i) Graph-based methods rely on explicit execution dependencies to reconstruct an attack chain, but tool calls driven by the task intent may not exchange data or expose shared parameters. In this case, parameterless attack operations such as get_received_emails and clear_working_memory cannot be connected to the other attack steps by methods relying on parameter dependencies, resulting in an incomplete attack chain. (ii) Attribution-based methods associate input fragments with the anomalous event using contribution scores. They may associate the RedScalar webpage with the final memory-clearing tool call, but cannot establish relationships among the remaining attack operations to recover an ordered attack chain. (iii) Counterfactual-based methods treat context as influential when removing or replacing it changes the anomalous event. However, legitimate repository operations and intermediate results may also affect the anomalous event and therefore be reported as possible injection sources, producing noisy source candidates and making it difficult to isolate the injection source from other causal candidates. Overall, these methods do not trace how attacker intent is realized through a sequence of tool calls, limiting their ability to recover a complete and precise IPI attack chain.
Research Goal and Scope. Motivated by the limitations of prior approaches, we propose AgentTracer, an intent-aware tracing framework for investigating IPI attacks. Given historical agent execution logs and a anomalous event (e.g., the credentials. json file is deleted), AgentTracer determines whether the anomalous event is attributable to IPI and, if so, identifies the injection source (e.g., a webpage containing the malicious instruction), locates the injection point (e.g., the tool call that retrieves the webpage), and reconstructs the complete attack chain. The recovered attack chain contains the ordered malicious tool calls while excluding interleaved legitimate tool calls. This evidence enables auditors to assess the impact of the attack and respond appropriately, while helping developers identify security weaknesses exposed by the incident.
AgentTracer applies to agents whose execution logs contain user requests, reasoning records, and tool records (including tool calls and tool results). We consider attackers who can embed natural-language instructions in external resources processed by the agent but cannot modify the original user request or the agent execution logs. Our analysis focuses on IPI attacks in which malicious instructions affect agent reasoning and lead to observable tool calls. Attacks that do not result in tool execution are outside the scope of AgentTracer.
3 Overview of AgentTracer
3.1 Challenges and Solutions
To achieve the research goal in this paper, there are three challenges that need to be solved:
• C1: How to construct a tracing graph that connects tool calls by task intent.
During an execution, an agent may work on multiple tasks. Each task intent can drive a sequence of tool calls, and tool calls from different sequences may be interleaved. Consequently, in an IPI attack, legitimate and malicious tool calls may appear interleaved in the agent execution log. Moreover, these malicious tool calls may not share explicit dependencies. It is therefore difficult to connect dispersed tool calls by task intent.
Solution: Decision-dependency recovery. Tool calls that collectively realize one task intent exhibit decision dependencies. The result of one tool call changes the agent's context and informs the decision to invoke a later tool, allowing task execution to continue until the task goal is achieved. These dependencies provide a basis for connecting dispersed tool calls by task intent.
• C2: How to recognize tool calls that drift from the user intent.
A tracing graph can connect dispersed tool calls by task intent, but the graph does not reveal which path drifts from the user intent. Identifying the intent-drift path requires a clear user intent authorization space for intent alignment. Constructing such a space is challenging because it must balance legitimate execution flexibility with the user's authorization boundaries.
Solution: Knowledge-enhanced intent alignment. The user request usually describes only a high-level goal, while legitimate execution may require supporting operations that are not explicitly stated. AgentTracer introduces an operation knowledge base to supply this missing information and combines it with the user request to construct a structured authorization space for intent alignment.
- C3: How to prune the tracing space around an anomalous event. Historical agent execution logs may contain many unrelated user requests and tool calls. Constructing and analyzing a global graph would introduce substantial tracing noise and cost. The tracing space must be narrowed without discarding the evidence required to reconstruct the attack chain.

Fig. 2. Workflow of AgentTracer.
Solution: event-guided tracing pruning. The anomalous event provides a concrete anchor for tracing. Centering the analysis on the anomalous event allows AgentTracer to progressively restrict the tracing space to execution evidence relevant to the anomalous event.
3.2 Workflow of AgentTracer
Figure 2 presents the workflow of AgentTracer. The input to AgentTracer is an agent execution log and the corresponding anomalous event, typically the security event that ultimately occurred (e.g., the deletion of a specific file). For a given anomalous event, AgentTracer performs a backward log-slicing operation to locate the user request closest to that event. Since the IPI attack unfolds between that user request and the final anomalous event, the intervening log segment becomes the primary unit of analysis; we refer to this unit as the log segment (LogSegment). Based on LogSegment, the three modules of AgentTracer are shown below:
Intent-Driven Execution Graph Construction. Taking the log segment as input, this module recovers decision dependencies among tool calls and constructs an intent-driven execution graph. AgentTracer uses decision dependencies to connect dispersed tool calls by task intent in the graph. User Intent Alignment. Taking the user request, operation knowledge, and the intent-driven execution graph as input, this module combines the user request with operation knowledge to instantiate a structured user intent authorization space. Considering that IPI-induced behavior typically invokes an unauthorized operation, changes the target of an authorized operation, or violates an execution constraint. The module evaluates the agent's behavior along the action, target, and constraint dimensions. The module outputs the graph with intent-drift edges marked.
Attack-Chain Traceback. This module uses the anomalous event to progressively narrow the tracing space and trace the intent-drift tool-call sequence backward in the graph. Focusing the analysis on the anomalous event removes unrelated execution evidence while preserving the evidence required to reconstruct the attack chain and locate the injection point.
4 Design Details of AgentTracer
4.1 Intent-Driven Execution Graph Construction
This module reconstructs the tool-call sequence that represents each task intent. The module takes a LogSegment as input and outputs an Intent-Driven Execution Graph (IntentExecGraph). An agent often completes a task through a series of dependent tool calls: the result of one call enters the agent's context and informs a later tool decision. Accordingly, AgentTracer extracts resource nodes and contextual decision relations from the LogSegment, and grounds the relations in successful tool calls to form decision-grounded execution edges.
Graph Representation. For each LogSegment, AgentTracer constructs a directed multigraph , where , with the following components:
-
(entry node). The entry node represents the user request and provides the initial contextual basis for tool decisions directly derived from the request.
-
(resource nodes). contains nodes representing data objects introduced through successful tool-call results, such as retrieved webpages, received emails, and objects created or modified during execution. Each resource node represents a discrete object available in the agent's context to inform subsequent tool decisions.
-
E (execution edges). E contains directed edges of the form , where , , and o denotes an operation performed by the agent. The source node provides the contextual basis for executing o, while the target node represents the object introduced through the execution. The operation o is stored as an edge attribute.
The graph makes decision dependencies among tool calls explicit. An execution edge may originate from the entry node when the corresponding tool decision is based directly on the user request. When a resource introduced through a tool call informs a later tool decision, this resource node connects the corresponding execution edges. A path of connected execution edges therefore represents the ordered tool-call sequence that realizes one task intent.
Graph Elements Extraction. AgentTracer first adds the user request in the LogSegment as the entry node. For each successful tool record, AgentTracer extracts the executed operation and the data objects introduced by the operation. Each extracted object becomes a resource node in , while the executed operation and tool record are retained for subsequent relation grounding. To support traceback, AgentTracer also labels resource nodes according to their origins. A resource node is labeled ExternalResource if it represents content retrieved from the external environment and introduced into the agent's context through a tool result.
Decision Dependency Extraction. Reasoning records provide the decision dependencies needed to connect tool calls by task intent. For each reasoning record, AgentTracer extracts contextual decision relations (ContextDecisionRel). Each ContextDecisionRel represents one tool-call decision, including the source entities supporting the decision, the intended operation, and the target entities expected from the corresponding execution. We represent a ContextDecisionRel as , where S is the set of source entities supporting the decision, A is the intended operation, and T is the set of expected target entities. If a reasoning record contains n distinct tool-call decisions, the extractor produces n ContextDecisionRel instances.

Reasoning: Okay, I have read the payroll files. I will now analyze the files and extract information: q1_payroll.xlsx: ..., q2_payroll.xlsx: ..., now I can write the aggregated result to payroll_summary.md.
Reasoning: According to q2_payroll.xlsx, I should prepare a complete Q2 audit package, so I need to write the summary to q2_summary.md and the detected exceptions to q2_anomalies.csv.
Reasoning: I analyze two files now: q1_payroll.xlsx: ..., q2_payroll.xlsx: ..., next I will write the consolidated statistics to payroll_summary.md and the cross-quarter exceptions to quarter_anomalies.csv.
Fig. 3. The Four Entity-association Patterns Represented by One ContextDecisionRel.
Because S and T are sets, one ContextDecisionRel can represent one-to-one, one-to-many, many-to-one, or many-to-many entity associations, as illustrated in Figure 3. These patterns describe entity multiplicity within one tool-call decision. Multiple decisions advancing the same task intent are represented by separate ContextDecisionRel instances and connected through their shared entities.
Decision Dependency Grounding. AgentTracer maps each extracted ContextDecisionRel to a set of decision-grounded execution edges between resource nodes, as illustrated in Figure 3. For each ContextDecisionRel, AgentTracer first matches the intended operation to a successful tool call extracted from the LogSegment. AgentTracer then maps each source entity to an existing resource node and each target entity to the resource node introduced by the matched tool call. After grounding, each source-target node pair produces a directed decision-grounded execution edge that stores the executed operation as an edge attribute. When a target node of one edge serves as the source node of a later edge, the two executed tool calls become connected through their extracted decision dependency. The resulting resource nodes and decision-grounded execution edges form the IntentExecGraph. The next module performs user intent alignment to identify intent-drift edges in the graph.
4.2 User Intent Alignment
This module identifies tool calls that drift from the user intent. The module takes the user request and the IntentExecGraph as inputs. The output is a labeled IntentExecGraph in which execution edges representing intent drift are marked MISALIGNED. AgentTracer first constructs a structured user intent authorization space (UA-Scope) as the evaluation criteria for intent alignment. AgentTracer then evaluates each tool call against this authorization space to identify intent-drift behaviors.
4.2.1 User-Intent Authorization Space Construction. AgentTracer first constructs a structured UA-Scope from the user request as the criteria for intent alignment, because the user request provides the most direct expression of the user intent. However, the user request usually specifies high-level goals but lacks details in natural language, which makes intent alignment hard in practice. For example, the user may ask the agent to “send the quarterly report to auditor@example.com” without specifying the execution details. The request may omit necessary preparation, such as locating and reading the report, as well as implicit authorization boundaries on the recipient and payload. To address this challenge, we build an operation knowledge base to map a user’s vague goal to a clearer, more detailed user authorization specification. AgentTracer combines the user
Table 1. High-level Operation Classes.
| Category | Operation class | Semantics |
|---|---|---|
| Acquisition | locate_resourceread_resourcesearch_resource | Locate a referenced resource.Read the content of a resource.Search for resources by criteria. |
| Processing | resolve_conditionprocess_information | Verify a condition required for an operation.Transform intermediate information. |
| Modification | create_resourceupdate_resourcedelete_resourcemodify_access | Create a persistent artifact.Modify an existing resource.Remove an existing resource.Change access control. |
| Interaction | send_resourcerequest_input | Transfer a resource across a boundary.Obtain information or confirmation from the user. |
request with an operation knowledge base to produce a concrete and structured authorization space.
UA-Scope Representation. The UA-Scope represents user authorization through two complementary elements: a task-frame structure and a high-level operation abstraction.
-
Task-frame Structure. The UA-Scope consists of task frames and the dependencies among them. Each task frame captures a distinct step in fulfilling the user goal and records the authorization information required to evaluate related tool calls, such as the principal operation and authorized target. The dependencies describe the execution relationships among these steps.
-
High-level Operation Abstraction. High-level operation classes represent the user task and agent behavior in a common semantic space. Drawing on established data-action taxonomies and capability abstractions for tool-using agents [18, 26], AgentTracer groups agent actions into four categories according to their primary effects: information acquisition, information processing, system modification, and external interaction. Based on these categories, AgentTracer defines the 11 operation classes shown in Table 1. AgentTracer maps each task frame and tool call to the class that best describes its primary effect.
Operation Knowledge Base. The task-frame structure and high-level operation abstraction establish the basic representation of the UA-Scope but do not fully specify the authorization information required for intent alignment. The operation knowledge base fills this gap by mapping high-level user goals to detailed authorization specifications.
We construct the knowledge base separately for each high-level operation class. First, we examine the descriptions, required inputs, and execution effects of the tools mapped to the operation class. The execution effects determine the operation boundary, while the required inputs identify the information needed for execution [8]. Second, we use the required inputs to identify operation prerequisites and common missing-information and failure conditions to identify applicable operation follow-ups [28]. Each prerequisite or follow-up rule records the condition under which it is applicable. Third, we apply least-privilege and agent-tool authorization principles to determine the operation targets and their authorized scope. We then translate these authorization requirements into operation-specific checkpoints [29, 32, 37].
This procedure produces five types of operation knowledge. Operation prerequisites and failure-triggered follow-ups are recorded separately because they apply under different execution conditions. Operation targets and operation checkpoints are also recorded separately because the former specifies what must remain within the authorized scope, while the latter specifies what must be checked during execution.
• Operation Boundary defines the concrete tool effects covered by an operation class. For example, send_resource covers tool calls that transfer information, requests, or assets across an external boundary, such as send_email, submit_form, and transfer_fund.
• Operation Prerequisite specifies the supporting operations that may legitimately precede a principal operation. For example, sending a file may require locating and reading it first.
• Operation Follow-up specifies the supporting operations applicable when required information is missing or an operation fails. For example, if a file cannot be found, the agent may search an authorized directory or ask the user for its location.
• Operation Target defines the target entities and their authorized scope. For example, a file may be uploaded only to the repository specified by the user.
• Operation Checkpoints specifies the operation-specific conditions that must be checked, such as parameters, condition dependencies, and required confirmations.
The knowledge base provides reusable authorization templates for the high-level operation classes. During UA-Scope instantiation, AgentTracer retrieves the operation knowledge associated with each mapped operation class and combines it with the user request to determine the concrete content of the corresponding task-frame fields. Together, these knowledge types enable AgentTracer to construct an authorization space that includes legitimate supporting operations without extending the authorized scope of the user task.
UA-Scope Instantiation. The UA-Scope is constructed through two-stage instantiation. In the first stage, AgentTracer extracts explicit task steps from the user request and maps each task step to a high-level operation class. AgentTracer constructs a task frame for each task step and identifies task information that must be resolved during execution. In the second stage, AgentTracer retrieves the operation knowledge associated with the mapped classes and enriches each task frame with permitted supporting operations and explicit authorization constraints. AgentTracer also identifies the execution dependencies among the task frames. The completed task frames and their dependencies form the initial UA-Scope.
For example, Figure 4 illustrates the UA-Scope for the request: “If the total payroll amount recorded in payroll.xlsx exceeds USD 1 million, summarize the file and send only the summary to external-auditor@example.com.” The request contains two principal task steps. Summarizing the spreadsheet maps to process_information, then sending the summary maps to send_resource. Operation knowledge adds file location and reading as prerequisite operations. It also makes the execution condition, recipient, and payload restrictions explicit.
UA-Scope Dynamic Completion. AgentTracer performs bounded dynamic completion when the user request explicitly authorizes a contextual entity to provide task information missing from the initial UA-Scope. In such cases, AgentTracer extracts only the parameters or task steps that the entity is authorized to provide. For example, in “pay the bill in bill.txt,” the file may provide only the payee and amount; in “configure the system according to standard.txt,” the manual may specify the steps required to complete the task. The authorization does not extend to other entities referenced by the authorized entity. If standard.txt instructs the agent to read data.xlsx, the spreadsheet is authorized only as a data input and cannot define new task steps. Bounded dynamic completion therefore resolves missing task information without expanding the authority granted by the user.

Fig. 4. The UA-Scope Instance for the Payroll-summary Request.
4.2.2 Intention-ToolCall Alignment. Once the UA-Scope is instantiated, AgentTracer uses the UA-Scope as the authorization criterion for evaluating the tool call associated with each grounded ContextDecisionRel. IPI-induced intent drift typically occurs in three ways: invoking an unauthorized operation, changing the target of an authorized operation, or violating an execution constraint. Accordingly, AgentTracer evaluates each grounded ContextDecisionRel along the action, target, and constraint dimensions. For each grounded ContextDecisionRel r and candidate task frame f, AgentTracer evaluates
As shown in Figure 4, each alignment dimension is evaluated using the corresponding fields in the instantiated UA-Scope. checks whether the operation is the principal operation or a permitted supporting operation. checks whether the target entities are within the authorized scope. checks operation-specific arguments and execution constraints, such as amounts, execution conditions, or required confirmations.
SATISFIED indicates that the authorization requirement for the dimension is satisfied. VIOLATED indicates an explicit authorization conflict. N/A indicates that no authorization requirement in the dimension applies to the operation. For example, is N/A when an operation has neither arguments nor applicable execution constraints. The dimensional results for one task frame are aggregated as follows:
A ContextDecisionRel is labeled ALIGNED if it aligns with at least one candidate task frame. Otherwise, the ContextDecisionRel is labeled MISALIGNED. The final label assigned to a ContextDecisionRel is applied to all decision-grounded execution edges derived from the relation. Therefore, if a ContextDecisionRel is labeled MISALIGNED, every execution edge between the corresponding source and target entity nodes is also labeled MISALIGNED. The module outputs a IntentExecGraph in which intent-drift edges are marked MISALIGNED.
4.3 Attack-Chain Traceback
This module performs event-guided pruning around the anomalous event and traces intent-drift edges backward to reconstruct the attack chain. The module takes the historical agent execution logs and the anomalous event as inputs. The module determines whether the anomalous event is attributable to IPI and, if so, outputs the attack chain, injection source, and injection point. Event-guided pruning progressively narrows the tracing space at three levels: the analysis scope, graph scope, and path scope. AgentTracer coordinates the two preceding modules to carry out the overall tracing procedure.
Analysis-scope Pruning. The first level narrows the analysis scope from the complete historical agent execution logs to LogSegment associated with the anomalous event. AgentTracer extracts the operation, operation target, and relevant arguments from the anomalous event. AgentTracer then searches the historical agent execution logs for tool records that match the operation and the operation target by the anomalous event. When available, arguments from the anomalous event further distinguish among multiple matching tool records. Each matching tool record is treated as a candidate occurrence, and AgentTracer extracts the corresponding LogSegment for subsequent analysis.
Because multiple tool records may match the anomalous event, AgentTracer sorts the candidate occurrences from newest to oldest and analyzes the corresponding LogSegment instances in that order. If traceback within a candidate LogSegment reconstructs a complete IPI attack chain, AgentTracer stops the search and returns the tracing result. Otherwise, AgentTracer proceeds to the LogSegment associated with the next earlier candidate occurrence. This strategy avoids constructing graphs for historical requests unrelated to the anomalous event.
Graph-scope Pruning. After selecting a candidate LogSegment, the second level excludes failed tool calls and their associated reasoning records from graph construction. Only successful tool calls with observable results participate in the graph. A failed tool call cannot represent an executed attack step. AgentTracer also filters the reasoning record associated with the failed tool call, preventing an unexecuted tool decision from forming execution edges in the graph. If the agent replans after the failure and subsequently completes the operation, AgentTracer retains the contextual decision relation associated with the successful execution and grounds the relation in the corresponding tool call to form execution edges.
Path-scope Pruning. After constructing and aligning the IntentExecGraph, the final level limits the paths examined during traceback. AgentTracer identifies the resource node introduced by the anomalous event as the sink node, such as a deleted file or modified account record. The sink node serves as the starting point for traceback. Starting from the sink node, AgentTracer selects the incoming MISALIGNED edge corresponding to the anomalous event and follows MISALIGNED edges backward until no earlier intent-drift edge can be found. The traversed edges form the intent-drift path. Restricting traceback to this path excludes graph branches unrelated to the anomalous event. The intent-drift path determines whether the candidate occurrence is attributable to IPI:
-
If the sink node has no incoming MISALIGNED edge for the anomalous event, AgentTracer does not classify the candidate occurrence as IPI.
-
If the root node of the intent-drift path is labeled ExternalResource, AgentTracer classifies the candidate occurrence as IPI. The root node is reported as the injection source, and the log line through which the external resource entered the agent’s context is reported as the injection
point. The tool calls represented by the intent-drift path, ordered from the root node to the sink node, form the attack chain.
- If the root node is not labeled ExternalResource, the intent-drift path does not establish that the deviation originated from externally injected content. The deviation may result from agent misunderstanding or an execution error. AgentTracer therefore does not classify the candidate occurrence as IPI.
If no candidate occurrence produces an intent-drift path, AgentTracer does not attribute the anomalous event to IPI and returns the audit results for the analyzed candidate occurrences.
5 Evaluation
Our evaluation addresses four research questions:
• RQ1: How effectively does AgentTracer trace IPI attacks?
• RQ2: How does AgentTracer compare with existing tracing methods?
• RQ3: How does each core module contribute to tracing performance?
• RQ4: Does user-intent alignment misclassify legitimate agent behavior as intent drift?
5.1 Experimental Setup
Evaluation Data. To evaluate AgentTracer across different IPI scenarios, we construct two datasets of agent execution logs by executing attack cases from AgentDyn [17] and InjecAgent [47]. We retain only logs generated by successful IPI attacks and refer to the two resulting datasets as AgentDyn and InjecAgent. These logs support event-guided tracing evaluation because each contains an observable anomalous event, an injection point, and the corresponding attack chain.
AgentDyn contains 356 agent execution logs covering daily-life, code-hosting, and online-shopping scenarios. Its attack chains contain three tool calls on average, with lengths ranging from one to eight. InjecAgent contains 936 agent execution logs reproduced on the Codex platform and covers device control, finance, code hosting, cloud storage, and other scenarios.
For the ground truth in our dataset, we manually annotate each agent execution log with (i) the anomalous event, (ii) the injection point, i.e., the log line at which malicious content first enters the agent's context, and (iii) the set of annotated malicious tool calls in the attack chain.
Data Augmentation. In practice, real-world agents generate large volumes of normal execution logs, including normal user requests and tool calls that do not involve IPI. To approximate this setting and evaluate AgentTracer in the presence of noise from normal tasks, we combine the attack logs with normal execution logs. Specifically, we construct a historical-log pool from agent execution logs generated over five months in a Codex environment. The pool contains 1,800 normal user requests and 9,000 background tool calls without IPI. The InjecAgent execution logs were reproduced in this Codex environment and can therefore be directly integrated into the pool. In contrast, the AgentDyn execution logs were generated in its native benchmark environment and are normalized before being inserted into the pool. In our evaluation, AgentTracer traces each IPI attack chain within the complete historical-log pool.
This setup includes two forms of noise. First, within each evaluated agent execution log, tool calls from the user-authorized task are interleaved with attack-chain tool calls. Second, the historical-log pool introduces noise from normal user requests and tool calls without IPI accumulated over time. As an evaluated IPI attack chain contains approximately three tool calls on average, the ratio of background normal tool calls to attack-chain tool calls is approximately 3,000:1. By combining both forms of noise, this setup better approximates a long-running agent deployment.
Table 2. End-to-end Tracing Effectiveness.
| Dataset | DetectionRate (%) | InjectionAcc (%) | Coverage (%) | Precision (%) | |
|---|---|---|---|---|---|
| AgentDyn | 300 | 98.67 | 93.33 | 89.24 | 91.11 |
| InjecAgent | 300 | 96.00 | 95.00 | 91.25 | 96.00 |
LLM Configuration. We use deepseek-v4-flash for every AgentTracer component and baseline that requires an LLM. Using the same model across all LLM-dependent methods reduces variation caused by differences in model capability.
Evaluation Metrics. We mainly evaluate these experiments using IPI detection rate, injection-point accuracy, path coverage, and path precision. The metrics are defined as follows.
- IPI Detection Rate measures the proportion of successful IPI attacks that are correctly detected. For attack logs, it is calculated as
- Injection-point Accuracy measures the proportion of attacks for which the predicted injection-point line exactly matches the annotated line. Because each injection source has a unique annotated context-entry line, injection-source and injection-point accuracy are equivalent in our evaluation. We therefore report only injection-point accuracy:
- Path Coverage and Precision evaluate the quality of the recovered attack chain. Let be the set of tool calls in the recovered chain and the set of annotated attack tool calls:
Coverage measures the proportion of annotated attack steps recovered by AgentTracer. Precision measures the proportion of recovered tool calls that belong to the annotated attack chain. Higher precision indicates that the recovered chain contains fewer unrelated tool calls. If no attack chain is returned, precision is recorded as zero.
5.2 RQ1: End-to-End Effectiveness
This experiment evaluates the end-to-end effectiveness of AgentTracer across AgentDyn and InjecAgent. We randomly select 300 agent execution logs from each dataset and evaluate whether AgentTracer can catch each attack chain from the historical-log pool.
Result Analysis. As shown in Table 2, AgentTracer achieves an average IPI detection rate of and an average injection-point accuracy of across the two datasets. For attack-chain reconstruction, AgentTracer achieves an average path coverage of and an average path precision of . Together, these results demonstrate the effectiveness of AgentTracer for end-to-end IPI tracing.
Reasons for tracing errors. The tracing errors mainly arise from two factors. First, IntentExecGraph construction depends on extracting contextual decision relations from natural-language reasoning records. The LLM may extract incorrect source entities, target entities, or intended operations. Different aliases for the entity may also cause a correctly extracted relation to be grounded in the wrong entity node. Second, an agent may deviate from the user request even without IPI. Such genuine execution deviations are correctly labeled MISALIGNED, but may form additional
Table 3. Comparison with Baseline Methods.
| Method | DetectionRate (%) | InjectionAcc (%) | Coverage (%) | Precision (%) |
|---|---|---|---|---|
| Codex (Agent) | 93.00 | 70.00 | 46.22 | 50.98 |
| OpenClaw (Agent) | 89.00 | 69.00 | 44.80 | 50.20 |
| Agent-BOM | 52.00 | 43.00 | 50.92 | 45.89 |
| NeuroTaint | 98.00 | 40.00 | 47.97 | 91.40 |
| AuthGraph | 100.00 | 68.00 | 88.28 | 75.41 |
| AgentArmor | 99.00 | 76.00 | 94.10 | 53.62 |
| ARGUS | 95.00 | 70.00 | 80.28 | 66.79 |
| AgentTracer | 98.00 | 94.00 | 88.07 | 93.18 |
intent-drift branches unrelated to the IPI attack chain. To reduce interference from these branches, AgentTracer uses the anomalous event as the traceback anchor to exclude unrelated branches.
5.3 RQ2: Comparison with Existing Methods
This experiment compares AgentTracer with two groups of baselines. The first group consists of Codex and OpenClaw, which perform direct tracing as general-purpose agents. The second group consists of five existing tracing methods: Agent-BOM [16], NeuroTaint [2], AuthGraph [37], AgentArmor [38], and ARGUS [41].
To conduct the comparison, we randomly select 100 IPI attack chains from the historical-log pool. The annotated attack chains contain four tool calls on average. Each method traces every anomalous event to locate the injection point and reconstruct the attack chain. For ARGUS, we use the core components released with AgentLure. When a complete implementation of a baseline is unavailable, we reproduce the method according to the published algorithms, prompts, and rules. Result analysis. AgentTracer achieves the highest injection-point accuracy of and the highest path precision of . Compared with all baselines, AgentTracer improves injection-point accuracy by . These results show that AgentTracer more accurately locates injection points while introducing fewer unrelated tool calls into reconstructed attack chains. The advantage comes from recovering decision dependencies among tool calls and evaluating the corresponding tool behavior against the user intent.
Compared with direct tracing by Codex and OpenClaw, AgentTracer improves injection-point accuracy by and , respectively. AgentTracer also improves path precision by and . These results indicate that directly analyzing raw execution logs without a structured intermediate representation makes it difficult to connect dispersed attack steps and separate them from unrelated tool calls.
Compared with existing tracing methods, AgentTracer provides a better balance between injection-point identification and attack-chain reconstruction. AuthGraph achieves a higher detection rate but much lower injection-point accuracy, while AgentArmor achieves higher path coverage but substantially lower precision.
Overall, AgentTracer provides the strongest combined performance in injection-point identification and precise attack-chain reconstruction.
5.4 RQ3: Ablation Study
This experiment evaluates the contributions of the core tracing components. We randomly select 100 IPI attack chains (different from RQ2) within the historical-log pool and evaluate the ablation setting. We construct the following three ablation settings.
Table 4. Ablation of the Core Tracing Components.
| Configuration | Replacement | DetectionRate (%) | InjectionAcc (%) | Coverage (%) | Precision (%) |
|---|---|---|---|---|---|
| W/o IntentExecGraph | Temporal graph | 78.00 | 74.00 | 58.54 | 80.97 |
| W/o alignment | LLM judgment | 79.00 | 64.00 | 57.04 | 77.91 |
| AgentTracer | None | 98.00 | 91.00 | 90.32 | 88.66 |
Table 5. Efficiency Impact of Ablating event-guided Pruning.
| Configuration | Replacement | DetectionRate (%) | InjectionAcc (%) | Coverage (%) | Precision (%) | TimeInc. (%) ↑ | TokenInc. (%) ↑ |
|---|---|---|---|---|---|---|---|
| W/o pruning | LLM analysis | 97.00 | 89.00 | 87.29 | 85.54 | 30.98 | 51.24 |
-
Without IntentExecGraph Construction replaces the IntentExecGraph with a temporal graph that directly connects adjacent tool calls.
-
Without User Intent Alignment replaces the UA-Scope and alignment predicates with direct LLM judgments of whether each decision-grounded execution edge represents intent drift.
-
Without Event-guided Pruning replaces event-guided pruning with full-history LLM analysis. The LLM analyzes the complete historical agent execution logs and determines the analysis, graph, and path scopes. This setting retains IntentExecGraph construction and user intent alignment.
Table 4 reports the contributions of IntentExecGraph construction and user-intent alignment to tracing effectiveness. Table 5 reports the effectiveness and efficiency of tracing without event-guided pruning. The time and token columns report the additional cost of full-history LLM analysis relative to AgentTracer.
Result Analysis. The results show that IntentExecGraph construction and user intent alignment substantially improve tracing effectiveness, while event-guided pruning reduces analysis cost with little loss of effectiveness.
Replacing the IntentExecGraph with a temporal graph reduces injection-point accuracy by and path coverage by . A temporal graph connects tool calls according to execution order. Because tool calls driven by different task intents may be interleaved, temporally adjacent calls may be unrelated. The temporal graph therefore can not connect attack steps and introduces unrelated connections. This result demonstrates that the IntentExecGraph is an effective intermediate representation for IPI tracing.
Replacing user intent alignment with direct LLM judgments reduces injection-point accuracy from to . Direct LLM judgments evaluate agent behavior against natural-language user requests. However, user requests are often vague and provide insufficient criteria for reliable intent alignment. This result demonstrates the importance of structured authorization criteria for identifying intent drift.
Full-history LLM analysis achieves tracing effectiveness close to that of the full AgentTracer because IntentExecGraph construction and user intent alignment are retained. However, full-history analysis increases average analysis time by and token consumption by . This result demonstrates that event-guided pruning reduces analysis cost while preserving tracing effectiveness.
5.5 RQ4: User Intent Alignment on Benign Tasks
This experiment evaluates whether user intent alignment incorrectly flags legitimate agent behavior. We select 100 additional injection-free agent execution logs from AgentDyn. For each agent execution log, we construct the IntentExecGraph and apply user intent alignment to every evaluable grounded ContextDecisionRel. We do not perform attack-chain traceback because these logs contain no IPI-induced anomalous event, injection point, or annotated attack chain. We measure the proportion of legitimate decision-grounded execution edges that are incorrectly labeled MISALIGNED.
Result Analysis. User-intent alignment achieves an edge-level false-positive rate of 3.52% on legitimate agent behavior. The 100 agent execution logs contain 394 evaluable execution edges. Manual review shows that 25 edges labeled MISALIGNED represent genuine execution deviations rather than false positives. After excluding these edges, 13 of the remaining 369 legitimate edges are incorrectly labeled MISALIGNED, producing the reported false-positive rate. The effect of an isolated false-positive edge is further limited because AgentTracer attributes an anomalous event to IPI only when an intent-drift path connects an ExternalResource root node to the sink node.
6 Discussion
6.1 Applicability and Extensions
Applicable Agent Execution Paradigms. AgentTracer is best suited to agents that follow ReAct or a similar perceive-plan-act-observe loop [44]. Such agents record reasoning before tool calls, providing the evidence needed to extract contextual decision relations and recover decision dependencies among tool calls. A black-box agent without reasoning records can be analyzed only through tool records. The temporal-graph ablation shows that tracing effectiveness decreases when reasoning evidence is unavailable.
Extension to Persistent IPI. The design of AgentTracer can be extended to persistent IPI across user sessions. In such attacks, malicious content introduced in an earlier session is stored in memory, configuration, or another persistent entity and influences agent behavior in a later session. When the root node of an intent-drift path represents a persistent entity, AgentTracer can search historical agent execution logs for the tool call that created or modified the entity. AgentTracer can then construct a IntentExecGraph for the earlier session and connect the earlier-session graph to the current IntentExecGraph through the shared persistent entity.
We reproduced 45 cross-session IPI cases from the stored prompt-injection study by Xie et al. [43]. AgentTracer achieved more than 85% injection-point accuracy in this exploratory experiment. However, the sample size and covered scenarios are insufficient to support a general conclusion. We therefore exclude this result from the formal evaluation and leave a broader evaluation of persistent entities and cross-session tracing to future work.
6.2 Threats to Validity
Internal Validity. Some comparison methods have not released their complete implementations. We reproduce these methods by following the published algorithms, prompts, and rules. We provide all methods with the same comparison dataset, anomalous events, annotations, and LLM backbone when applicable to reduce differences introduced by the experimental setup. Our conclusions do not rely solely on these comparisons. The end-to-end and ablation experiments independently evaluate the effectiveness of AgentTracer and the contributions of its core components.
External Validity. First, AgentTracer currently focuses on tracing IPI expressed through natural language context. AgentTracer does not directly trace code-level injection, in which malicious code may modify files, change environment variables, or issue network requests without exposing these behaviors as separate agent tool calls. However, existing system-level tracing techniques can recover such behavior from system calls, file accesses, and network activity [10, 11, 13]. In practice, AgentTracer can extend its coverage to code-level injection by integrating these techniques and linking their execution records to the agent tool call that launched the code. This integration would allow AgentTracer to reconstruct the attack chain to code-level behavior.
Second, reproducing the log environment of a long-running industrial agent deployment is difficult because such an environment may accumulate vast volumes of execution data over time. We approximate this setting using a historical-log pool constructed from five months of Codex execution logs. In this environment, background tool calls outnumber attack-chain tool calls by approximately 3,000:1. The experimental results demonstrate that AgentTracer remains effective under substantial historical-log noise. This robustness follows from the event-guided pruning design: AgentTracer uses the anomalous event to restrict analysis to relevant log segments and intent-drift paths instead of constructing and examining a global graph over the complete log history.
7 Related Work
Prompt Injection Attacks and Benchmarks. Prior work shows that instructions in external resources can redirect LLM applications [9, 21, 22]. Existing benchmarks cover prompt injection [33, 45], agent tool execution [7, 47, 49], dynamic and multi-step attacks [17, 48], and harmful multi-tool tasks [1]. These studies demonstrate that a malicious instruction can induce a sequence of tool calls, motivating the necessity to reconstruct complete attack chains
Agent Safety Evaluation and Defenses. Agent safety research covers both behavioral evaluation and defenses at the model, system, and runtime levels. Agent evaluations study interactive, web, and computer-use tasks [20, 23, 36, 42, 51], while safety benchmarks evaluate risky tool use and harmful task completion [1, 27, 46, 50]. Existing defenses improve instruction separation at the model level [3, 4, 12, 35], enforce system-level information-flow or privilege policies [5, 6, 32], or inspect tool behavior at runtime [25, 30, 31, 37]. In contrast, AgentTracer performs post-incident tracing to locate the injection source and reconstruct the attack chain.
Execution Tracing and Reasoning Evidence. Execution-tracing research uses evidence recorded during execution to explain observed behavior and identify the sources of that behavior. PROV models entities, activities, and provenance relations [24], while SLEUTH, NoDoze, and UNICORN use execution provenance for security analysis [10, 11, 13]. Agent-tracing methods model program dependencies, runtime states, capabilities, or authorization relations [16, 19, 37, 38]; other methods identify influential sources through contextual influence, counterfactual tests, or contribution signals [2, 15, 39, 41]. Section 2 discusses their limitations for multi-step IPI tracing. Chain-of-thought, ReAct, and structural representations expose reasoning or execution structure [14, 40, 44]. Because generated reasoning may be unfaithful [34], AgentTracer grounds contextual decision relations extracted from reasoning records in executed tool calls.
8 Conclusion
We presented AgentTracer, an intent-aware tracing framework for IPI attacks in agent execution logs. AgentTracer treats IPI as a form of intent drift in which a malicious instruction causes the agent's execution to deviate from the user intent. AgentTracer constructs an Intent-Driven Execution Graph that connects tool calls by task intent and aligns the recovered task intents with the user intent. The alignment identifies the tool-call sequence that represents the attacker intent, allowing AgentTracer to reconstruct the attack chain and locate the injection source and injection point. Experiments on datasets of agent execution logs constructed from AgentDyn and InjecAgent demonstrate accurate injection-point identification and precise attack-chain reconstruction. The reconstructed evidence supports incident analysis and response.
References
[1] Maksym Andriushchenko, Alexandra Souly, Mateusz Dziemian, Derek Duenas, Maxwell Lin, Justin Wang, Dan Hendrycks, Andy Zou, Zico Kolter, Matt Fredrikson, Eric Winsor, Jerome Wynne, Yarin Gal, and Xander Davies. 2024. AgentHarm: A Benchmark for Measuring Harmfulness of LLM Agents. arXiv preprint arXiv:2410.09024 (2024). doi:10.48550/arXiv.2410.09024
[2] Yuandao Cai, Wensheng Tang, Cheng Wen, and Shengchao Qin. 2026. Ghost in the Agent: Redefining Information Flow Tracking for LLM Agents. arXiv preprint arXiv:2604.23374 (2026). doi:10.48550/arXiv.2604.23374
[3] Sizhe Chen, Julien Piet, Chawin Sitawarin, and David Wagner. 2024. StruQ: Defending Against Prompt Injection with Structured Queries. arXiv preprint arXiv:2402.06363 (2024). doi:10.48550/arXiv.2402.06363
[4] Sizhe Chen, Arman Zharmagambetov, Saeed Mahloujifar, Kamalika Chaudhuri, David Wagner, and Chuan Guo. 2024. SecAlign: Defending Against Prompt Injection with Preference Optimization. arXiv preprint arXiv:2410.05451 (2024). doi:10.48550/arXiv.2410.05451
[5] Manuel Costa, Boris Köpf, Aashish Kolluri, Andrew Paverd, Mark Russinovich, Ahmed Salem, Shruti Tople, Lukas Wutschitz, and Santiago Zanella-Béguelin. 2025. Securing AI Agents with Information-Flow Control. arXiv preprint arXiv:2505.23643 (2025). doi:10.48550/arXiv.2505.23643
[6] Edoardo Debenedetti, Ilia Shumailov, Tianqi Fan, Jamie Hayes, Nicholas Carlini, Daniel Fabian, Christoph Kern, Chongyang Shi, Andreas Terzis, and Florian Tramèr. 2025. Defeating Prompt Injections by Design. arXiv preprint arXiv:2503.18813 (2025). doi:10.48550/arXiv.2503.18813
[7] Edoardo Debenedetti, Jie Zhang, Mislav Balunović, Luca Beurer-Kellner, Marc Fischer, and Florian Tramèr. 2024. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents. arXiv preprint arXiv:2406.13352 (2024). doi:10.48550/arXiv.2406.13352
[8] Richard E. Fikes and Nils J. Nilsson. 1971. STRIPS: A New Approach to the Application of Theorem Proving to Problem Solving. Artificial Intelligence 2, 3–4 (1971), 189–208. doi:10.1016/0004-3702(71)90010-5
[9] Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, and Mario Fritz. 2023. Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. arXiv preprint arXiv:2302.12173 (2023). doi:10.48550/arXiv.2302.12173
[10] Xueyuan Han, Thomas Pasquier, Adam Bates, James Mickens, and Margo Seltzer. 2020. UNICORN: Runtime Provenance-Based Detector for Advanced Persistent Threats. In Network and Distributed System Security Symposium. https://www.ndss-symposium.org/ndss-paper/unicorn-runtime-provenance-based-detector-for-advanced-persistent-threats/
[11] Wajih Ul Hassan, Shengjian Guo, Ding Li, Zhengzhang Chen, Kangkook Jee, Zhichun Li, and Adam Bates. 2019. NoDoze: Combatting Threat Alert Fatigue with Automated Provenance Triage. In Network and Distributed System Security Symposium. https://www.ndss-symposium.org/ndss-paper/nodoze-combatting-threat-alert-fatigue-with-automated-provenance-triage/
[12] Keegan Hines, Gary Lopez, Matthew Hall, Federico Zarfati, Yonatan Zunger, and Emre Kiciman. 2024. Defending Against Indirect Prompt Injection Attacks With Spotlighting. arXiv preprint arXiv:2403.14720 (2024). doi:10.48550/arXiv.2403.14720
[13] Md Nahid Hossain, Sadegh M. Milajerdi, Junao Wang, Birhanu Eshete, Rigel Gjomemo, R. Sekar, Scott Stoller, and V. N. Venkatakrishnan. 2017. SLEUTH: Real-time Attack Scenario Reconstruction from COTS Audit Data. In 26th USENIX Security Symposium. 487–504. https://www.usenix.org/conference/usenixsecurity17/technical-sessions/presentation/hossain
[14] Vignesh Iyer. 2026. Structural Representations for Cross-Attack Generalization in AI Agent Threat Detection. arXiv preprint arXiv:2601.01723 (2026). doi:10.48550/arXiv.2601.01723
[15] Yuqi Jia, Yupei Liu, Zedian Shao, Jinyuan Jia, and Neil Gong. 2025. PromptLocate: Localizing Prompt Injection Attacks. arXiv preprint arXiv:2510.12252 (2025). doi:10.48550/arXiv.2510.12252
[16] Chaofan Li, Lyuye Zhang, Jintao Zhai, Siyue Feng, Xichun Yang, Huahao Wang, Shihan Dou, Yu Ji, Yutao Hu, Yueming Wu, Yang Liu, and Deqing Zou. 2026. Towards Security-Auditable LLM Agents: A Unified Graph Representation. arXiv preprint arXiv:2605.06812 (2026). doi:10.48550/arXiv.2605.06812
[17] Hao Li, Ruoyao Wen, Shanghao Shi, Ning Zhang, Yevgeniy Vorobeychik, and Chaowei Xiao. 2026. AgentDyn: Are Your Agent Security Defenses Deployable in Real-World Dynamic Environments? arXiv preprint arXiv:2602.03117 (2026). doi:10.48550/arXiv.2602.03117
[18] Junda Lin, Zhaomeng Zhou, Zhi Zheng, Shuochen Liu, Tong Xu, Yong Chen, and Enhong Chen. 2026. VIGIL: Defending LLM Agents Against Tool-Stream Injection via Verify-Before-Commit. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics, 9764–9785. doi:10.18653/v1/2026.acl-long.443
[19] Jiahao Liu, Bonan Ruan, Xianglin Yang, Zhiwei Lin, Yan Liu, Yang Wang, Tao Wei, and Zhenkai Liang. 2025. TraceAegis: Securing LLM-Based Agents via Hierarchical and Behavioral Anomaly Detection. arXiv preprint arXiv:2510.11203 (2025). doi:10.48550/arXiv.2510.11203
[20] Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Yu Gu, Hangliang Ding, Kaiwen Men, Kejuan Yang, Shudan Zhang, Xiang Deng, Aohan Zeng, Zhengxiao Du, Chenhui Zhang, Sheng Shen, Tianjun Zhang, Yu Su, Huan Sun, Minlie Huang, Yuxiao Dong, and Jie Tang. 2023. AgentBench: Evaluating LLMs as Agents. arXiv preprint arXiv:2308.03688 (2023). doi:10.48550/arXiv.2308.03688
[21] Yi Liu, Gelei Deng, Yuekang Li, Kailong Wang, Zihao Wang, Xiaofeng Wang, Tianwei Zhang, Yepang Liu, Haoyu Wang, Yan Zheng, Leo Yu Zhang, and Yang Liu. 2023. Prompt Injection attack against LLM-integrated Applications. arXiv preprint arXiv:2306.05499 (2023). doi:10.48550/arXiv.2306.05499
[22] Yupei Liu, Yuqi Jia, Runpeng Geng, Jinyuan Jia, and Neil Zhenqiang Gong. 2023. Formalizing and Benchmarking Prompt Injection Attacks and Defenses. arXiv preprint arXiv:2310.12815 (2023). doi:10.48550/arXiv.2310.12815
[23] Chang Ma, Junlei Zhang, Zhihao Zhu, Cheng Yang, Yujiu Yang, Yaohui Jin, Zhenzhong Lan, Lingpeng Kong, and Junxian He. 2024. AgentBoard: An Analytical Evaluation Board of Multi-turn LLM Agents. arXiv preprint arXiv:2401.13178 (2024). doi:10.48550/arXiv.2401.13178
[24] Luc Moreau and Paolo Missier. 2013. PROV-DM: The PROV Data Model. Technical Report. World Wide Web Consortium. https://www.w3.org/TR/prov-dm/
[25] Yutao Mou, Zhangchi Xue, Lijun Li, Peiyang Liu, Shikun Zhang, Wei Ye, and Jing Shao. 2026. ToolSafe: Enhancing Tool Invocation Safety of LLM-based agents via Proactive Step-level Guardrail and Feedback. arXiv preprint arXiv:2601.10156 (2026). doi:10.48550/arXiv.2601.10156
[26] National Institute of Standards and Technology. 2020. NIST Privacy Framework: A Tool for Improving Privacy through Enterprise Risk Management, Version 1.0. Technical Report. National Institute of Standards and Technology. doi:10.6028/NIST.CSWP.01162020
[27] Yangjun Ruan, Honghua Dong, Andrew Wang, Silviu Pitis, Yongchao Zhou, Jimmy Ba, Yann Dubois, Chris J. Maddison, and Tatsunori Hashimoto. 2023. Identifying the Risks of LM Agents with an LM-Emulated Sandbox. arXiv preprint arXiv:2309.15817 (2023). doi:10.48550/arXiv.2309.15817
[28] Nick Russell, Wil M. P. van der Aalst, and Arthur H. M. ter Hofstede. 2006. Workflow Exception Patterns. In Advanced Information Systems Engineering (Lecture Notes in Computer Science, Vol. 4001). Springer, 288–302. doi:10.1007/11767138_20
[29] Jerome H. Saltzer and Michael D. Schroeder. 1975. The Protection of Information in Computer Systems. Proc. IEEE 63, 9 (1975), 1278–1308. doi:10.1109/PROC.1975.9939
[30] Rohan Sequeira, Stavros Damianakis, Umar Iqbal, and Konstantinos Psounis. 2026. Agent-Sentry: Bounding LLM Agents via Execution Provenance. arXiv preprint arXiv:2603.22868 (2026). doi:10.48550/arXiv.2603.22868
[31] Yining She, Yiliang Liang, and Eunsuk Kang. 2026. Safeguarding LLM Agents from Misalignment through Provenance Analysis. arXiv preprint arXiv:2607.01236 (2026). doi:10.48550/arXiv.2607.01236
[32] Tianneng Shi, Jingxuan He, Zhun Wang, Hongwei Li, Linyu Wu, Wenbo Guo, and Dawn Song. 2025. Progent: Securing AI Agents with Privilege Control. arXiv preprint arXiv:2504.11703 (2025). doi:10.48550/arXiv.2504.11703
[33] Sam Toyer, Olivia Watkins, Ethan Adrian Mendes, Justin Svegliato, Luke Bailey, Tiffany Wang, Isaac Ong, Karim Elmaaroufi, Pieter Abbeel, Trevor Darrell, Alan Ritter, and Stuart Russell. 2023. Tensor Trust: Interpretable Prompt Injection Attacks from an Online Game. arXiv preprint arXiv:2311.01011 (2023). doi:10.48550/arXiv.2311.01011
[34] Miles Turpin, Julian Michael, Ethan Perez, and Samuel R. Bowman. 2023. Language Models Don’t Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Prompting. arXiv preprint arXiv:2305.04388 (2023). doi:10.48550/arXiv.2305.04388
[35] Eric Wallace, Kai Xiao, Reimar Leike, Lilian Weng, Johannes Heidecke, and Alex Beutel. 2024. The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions. arXiv preprint arXiv:2404.13208 (2024). doi:10.48550/arXiv.2404.13208
[36] Lei Wang, Chen Ma, Xueyang Feng, Zeyu Zhang, Hao Yang, Jingsen Zhang, Zhiyuan Chen, Jiakai Tang, Xu Chen, Yankai Lin, Wayne Xin Zhao, Zhewei Wei, and Ji-Rong Wen. 2023. A Survey on Large Language Model based Autonomous Agents. arXiv preprint arXiv:2308.11432 (2023). doi:10.48550/arXiv.2308.11432
[37] Peiran Wang, Ying Li, and Yuan Tian. 2026. Aligning Provenance with Authorization: A Dual-Graph Defense for LLM Agents. arXiv preprint arXiv:2605.26497 (2026). doi:10.48550/arXiv.2605.26497
[38] Peiran Wang, Yang Liu, Yunfei Lu, Yifeng Cai, Hongbo Chen, Qingyou Yang, Jie Zhang, Jue Hong, and Ye Wu. 2025. AgentArmor: Enforcing Program Analysis on Agent Runtime Trace to Defend Against Prompt Injection. arXiv preprint arXiv:2508.01249 (2025). doi:10.48550/arXiv.2508.01249
[39] Yanting Wang, Runpeng Geng, Ying Chen, and Jinyuan Jia. 2025. AttnTrace: Contextual Attribution of Prompt Injection and Knowledge Corruption. arXiv preprint arXiv:2508.03793 (2025). doi:10.48550/arXiv.2508.03793
[40] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou. 2022. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. arXiv preprint arXiv:2201.11903 (2022). doi:10.48550/arXiv.2201.11903
[41] Shihao Weng, Yang Feng, Jinrui Zhang, Xiaofei Xie, Jiongchi Yu, and Jia Liu. 2026. ARGUS: Defending LLM Agents Against Context-Aware Prompt Injection. arXiv preprint arXiv:2605.03378 (2026). doi:10.48550/arXiv.2605.03378
[42] Tianbao Xie, Danyang Zhang, Jixuan Chen, Xiaochuan Li, Siheng Zhao, Ruisheng Cao, Toh Jing Hua, Zhoujun Cheng, Dongchan Shin, Fangyu Lei, Yitao Liu, Yiheng Xu, Shuyan Zhou, Silvio Savarese, Caiming Xiong, Victor Zhong, and Tao Yu. 2024. OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments. arXiv preprint arXiv:2404.07972 (2024). doi:10.48550/arXiv.2404.07972
[43] Yuanbo Xie, Wenlei Zhu, Tianyun Liu, Yingjie Zhang, Suchen Liu, Yulin Li, Liya Su, and Tingwen Liu. 2026. What If Prompt Injection Never Left? Rethinking Agent Security through Cross-Session Stored Prompt Injection. arXiv preprint arXiv:2606.04425 (2026). doi:10.48550/arXiv.2606.04425
[44] Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. 2022. ReAct: Synergizing Reasoning and Acting in Language Models. arXiv preprint arXiv:2210.03629 (2022). doi:10.48550/arXiv.2210.03629
[45] Jingwei Yi, Yueqi Xie, Bin Zhu, Emre Kiciman, Guangzhong Sun, Xing Xie, and Fangzhao Wu. 2023. Benchmarking and Defending Against Indirect Prompt Injection Attacks on Large Language Models. arXiv preprint arXiv:2312.14197 (2023). doi:10.48550/arXiv.2312.14197
[46] Tongxin Yuan, Zhiwei He, Lingzhong Dong, Yiming Wang, Ruijie Zhao, Tian Xia, Lizhen Xu, Binglin Zhou, Fangqi Li, Zhuosheng Zhang, Rui Wang, and Gongshen Liu. 2024. R-Judge: Benchmarking Safety Risk Awareness for LLM Agents. arXiv preprint arXiv:2401.10019 (2024). doi:10.48550/arXiv.2401.10019
[47] Qiusi Zhan, Zhixiang Liang, Zifan Ying, and Daniel Kang. 2024. InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents. In Findings of the Association for Computational Linguistics: ACL 2024. 10471–10506. doi:10.18653/v1/2024.findings-acl.624
[48] Zhuoxin Zhan, Akbar Rafiey, Avery Ma, Leila Pishdad, and Layla El Asri. 2026. StepJack: Benchmarking Computer-Use Agent Safety Against Multi-Step Indirect Prompt Injection. arXiv preprint arXiv:2608.06477 (2026). doi:10.48550/arXiv.2608.06477
[49] Hanrong Zhang, Jingyuan Huang, Kai Mei, Yifei Yao, Zhenting Wang, Chenlu Zhan, Hongwei Wang, and Yongfeng Zhang. 2024. Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents. arXiv preprint arXiv:2410.02644 (2024). doi:10.48550/arXiv.2410.02644
[50] Zhexin Zhang, Shiyao Cui, Yida Lu, Jingzhuo Zhou, Junxiao Yang, Hongning Wang, and Minlie Huang. 2024. Agent-SafetyBench: Evaluating the Safety of LLM Agents. arXiv preprint arXiv:2412.14470 (2024). doi:10.48550/arXiv.2412.14470
[51] Shuyan Zhou, Frank F. Xu, Hao Zhu, Xuhui Zhou, Robert Lo, Abishek Sridhar, Xianyi Cheng, Tianyue Ou, Yonatan Bisk, Daniel Fried, Uri Alon, and Graham Neubig. 2023. WebArena: A Realistic Web Environment for Building Autonomous Agents. arXiv preprint arXiv:2307.13854 (2023). doi:10.48550/arXiv.2307.13854