Manuscript Offprint

arXiv:2611.02741

ATrust: Adaptive Trust Boundary Expansion for Securing LLM Agents

Xu Zhang, Zhichao Lu

ABSTRACT

As large language model (LLM) agents take on more complex tasks with greater autonomy, security has become a major obstacle to their broader deployment. Unlike in attacks that require complex exploitation of operating system vulnerabilities, attackers can easily hijack agents through indirect prompt injection (IPI), leading to privacy leakage, financial loss, and destructive operations. However, existing defenses often make security decisions based on limited static trusted evidence or assess observations in isolation. Such rigid trust assumptions can cause task-essential information to be unnecessarily discarded, resulting in over-defense and degraded agent functionality. To address this problem, we propose ATrust, a defense mechanism that adaptively expands the trust boundary during agent runtime. Starting from the user query as the root trust anchor, ATrust evaluates external observations against the current trust boundary and execution state, progressively admitting task-essential information as new trust anchors. This preserves necessary environmental feedback while excluding irrelevant content, whether benign or malicious, from subsequent decision-making, thereby limiting unnecessary exposure to external environment. We evaluate ATrust on AgentDojo and AgentDyn, where it achieves the strongest overall security–utility trade-off among existing defenses. With GPT-4o as the engine model, ATrust reduces the attack success rate on AgentDyn from 37.80% to 4.37% while enhancing utility by 10.00%, outperforming AuthGraph, the state-of-the-art defense, by 12.33%. These results demonstrate the effectiveness and practicality of ATrust. Code is available here.

1 INTRODUCTION

Large language models (LLMs) are increasingly used as autonomous agents that interact with external tools and environments to complete complex user tasks. By calling APIs, reading documents, browsing websites, and operating software interfaces, tool-augmented agents have enabled a wide range of applications, including software development (Anthropic, 2025), personal assistance (OpenClaw, 2025), and web navigation (OpenAI, 2025). However, the interaction loop also exposes agents to untrusted external environment, such as webpages, emails, and documents. These observations may contain indirect prompt injection (IPI) attacks, where adversarial instructions are embedded in external data rather than issued directly by the user. Once retrieved by the agent, such content can influence planning and tool use, causing the agent to deviate from the user's intent and potentially leading to privacy leakage, financial loss, or destructive operations. As LLM agents become more widely deployed in real-world workflows, IPI has become a central security challenge and has been identified as the top agent security threat by OWASP 2026 (OWASP, 2026).

To mitigate this threat, prior work has explored both model-level defenses (Li et al., 2025; Chen et al., 2025b;c), which improve the robustness of the underlying LLM through safety alignment or auxiliary detection models, and system-level defenses (Debenedetti et al., 2025; Shi et al., 2025a; Li et al., 2026a), which secure agent execution through security policies, privilege control, or isolation mechanisms. Despite their different implementations, these defenses share a common limitation: their security decisions are grounded in a narrow and largely static trust boundary. They typically

†Corresponding author.

Figure

Figure 1: The user asks the agent to book a table on a website using credentials stored in a local file, while the visited webpage embeds an injected instruction. Each panel shows the trust domain, i.e., the evidence the defense relies on when checking the agent's input_to_webpage call. ① Trusting only the user query leaves the email and password read from my_info.txt unverified, so the call is blocked. ② Rejecting the whole webpage removes the injection but also the web content the call depends on, again blocking the call (over-defense). ③ ATrust expands the trust domain step by step, admitting task-essential web content while excluding the injection, so the call is allowed.

rely on only a small set of predefined trusted entities, such as the user query or the sequence of executed tool names, or assess individual tool outputs in isolation (see Figure 1). For example, CaMeL derives security policies primarily from the user query, which is assumed to be benign under the IPI threat model. Building on this assumption, DRIFT incorporates the names of executed tools as additional evidence for determining whether an action aligns with the user's intent. Meanwhile, defenses such as PromptArmor and PIGuard assess tool outputs without fully considering the surrounding execution context. Such designs discard contextual semantics that are essential for determining whether an external instruction is task-relevant or malicious. In agent systems, the trustworthiness of an external instruction depends heavily on the user's intent, prior interactions, and the current execution state. Consequently, relying on limited and static trusted evidence can lead to inaccurate security decisions, particularly over-defense that rejects task-essential information and substantially degrades agent functionality. This limitation is especially evident on AgentDyn, an open-ended benchmark whose external sources frequently contain benign, task-essential instructions that existing defenses struggle to distinguish from malicious injections. These defenses all suffer severe utility loss on this benchmark; such as CaMeL, a representative system-level defense, even drops to zero utility across all suites. See Appendix A for more related work.

To address this limitation, we propose ATrust, an adaptive trust-boundary mechanism that dynamically establishes a task-adaptive trust boundary for the defense module to make security decisions about subsequent tool calls. We define the collection of information that the defense mechanism can rely on and use for decision-making as the trust domain of the agent system. Each information unit within this domain is a trust anchor. At the beginning of a task, the trust domain contains only the user query because the agent has not yet interacted with the environment. During task execution, ATrust participates in agent–environment interactions based on the latest trust domain. In each round of observations, it identifies information whose trustworthiness is unknown and incorporates only task-essential information into the trust domain, thus establishing an evolving trust boundary. This design is fundamentally different from filtering-based defenses, which identify and isolate malicious instructions in observations. ATrust does not focus on whether a particular segment contains harmful intent that would cause the agent to deviate from the initial user query. Instead, it focuses on environmental feedback that is essential for completing the task, such as receiving a verification code for authentication. The advantage of this approach is that the system's trust domain is updated in real time as the task status changes, avoiding the drawbacks of static trust boundaries. Among information from third-party sources, task-relevant information is retained, while irrelevant content, whether benign or malicious, neither enters the system's trust domain nor affects subsequent actions. This confines the attack surface for indirect injection to the minimum necessary scope while preventing the loss of important information.

We evaluate ATrust on two end-to-end agent security benchmarks, AgentDojo (Debenedetti et al., 2024) and AgentDyn (Li et al., 2026b), covering both standard multi-tool tasks and more challenging long-horizon executions. Compared with prompting-based, filtering-based, and system-level defense baselines, ATrust achieves the strongest overall security-utility trade-off. The improve-ments are especially pronounced on harder long-horizon tasks with dynamically injected malicious instructions, where static defenses sacrifice utility by discarding necessary observations, whereas other under-conservative defenses fail to provide effective protection. With GPT-4o-mini (OpenAI, 2024b) as the agent backbone, ATrust reduces the attack success rate from 50.19% to 3.61%, while achieving 46.20% utility under attack and introducing only 1.67% benign utility degradation.

References (53)