arXiv(opens in a new tab)cs.CRAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.30041

Reachability-Based Capability Confinement for LLM Agents under Indirect Prompt Injection

Wujie Xiong, Rabimba Karanjai, Yang Lu, Weidong Shi, Lei Xu

Wujie Xiong¹, Rabimba Karanjai², Yang Lu³, Weidong Shi³, and Lei Xu¹

¹ Kent State University

² PayPal AI Labs

³ University of Houston

Abstract. Large language model agents place outputs from external skills into their execution context, allowing attacker-controlled data to influence later privileged actions. Existing defenses mainly classify untrusted content or authorize the proposed operations. They do not directly address how an agent's future authority should change after untrusted data enter its state. We present SkillGuard, a harness-level enforcement layer that treats this event as contamination and restricts future capabilities to disconnect the resulting state from deployer-defined forbidden states. Given sound skill summaries and policies, SkillGuard represents security-relevant transitions with a Skill Impact Graph, specifies admissible control over skill parameters through steerability signatures, and mediates invocations with an inline reference monitor. Following contamination, it computes weighted capability restrictions using binary, fractional, or fractional-flow strategies without auxiliary language-model inference. We evaluate SkillGuard on four AgentDojo suites with two backend LLMs, Gemini 2.5 Flash and Llama3.3-70B, against an LLM-only No Defense baseline and three defenses operating at different system layers: Spotlighting, CaMeL, and AttriGuard. We further construct a compositional attack benchmark in which each attack requires combining observations that are individually insufficient to induce the target violation and evaluate the same baselines on it. Under AgentDojo's Tool Knowledge attacks, SkillGuard eliminates attack success on three of the four suites for both backends and reduces it to 4.8% and 14.3% on Slack. Against compositional attacks, it outperforms every baseline on Llama and matches the strongest baseline on Gemini at a higher benign utility. Fractional-flow restriction preserves substantially more capabilities than binary restriction at the same attack success rate. Across both settings, SkillGuard adds no model calls or token overhead.

1 Introduction

Large language models (LLMs) are increasingly being deployed as agents that act rather than only providing text answers. Given a user request, an agent invokes external skills, such as retrieval endpoints, code executors, databases, and application APIs, and acts based on the results [34, 25, 23]. Each invocation returns an observation that is appended to the model context and shapes the next action. This loop enables an agent to perform various tasks, including reading a booking confirmation and then issuing a payment, or reading a shared document and then posting a summary to a channel.

Although this architecture enables many legitimate applications, it also introduces a new attack surface. Skill outputs originate outside the harness's trust boundary but are incorporated into the agent's context alongside the user's request. An adversary who controls content returned by a skill—such as a web page, document, or database record—can embed instructions that redirect the agent's behavior and cause it to act with the user's authority [24, 9, 20]. This is a form of the confused-deputy problem [10]: the privileged agent is not directly compromised, but is induced to misuse its authority on the adversary's behalf. Because current models do not reliably distinguish instructions from untrusted data [38], indirect prompt injection is a structural risk at the skill-invocation boundary rather than a flaw in any particular skill.

Existing defenses. Existing defenses operate broadly at two levels. Model-level defenses aim to reestablish the boundary between instructions and data: prompting techniques explicitly delimit untrusted content [13], training-based approaches separate or align instruction and data channels [3, 4], and detectors screen content before it reaches the model [21]. The effectiveness of these approaches thus depends on recognizing and safely handling untrusted content before it can influence the model's decisions.

System-level defenses instead enforce security policies within the trusted runtime. CaMeL derives control-and data-flow constraints from the trusted user request [7]; AgentArmor reconstructs program dependencies from the observed execution trace [33]; and AttriGuard uses counterfactual replay over the observation history to evaluate proposed invocations [12]. Although these systems reason over prior execution steps, they primarily address a per-action authorization question: whether a proposed operation is justified by the user's request. We address a complementary reachability question: once untrusted data has entered the execution state, which capabilities must be restricted to ensure that every permitted continuation avoids a deployer-defined forbidden state?

Two further limitations motivate our study. First, existing prompt-injection benchmarks rarely isolate compositional attacks, in which the adversarial objective emerges only through the combination of multiple observations, none of which is individually sufficient. The robustness of current defenses to such attacks therefore remains poorly understood. Second, runtime defenses can impose substantial inference overhead: in our evaluation, CaMeL and AttriGuard consume up to 15 additional model calls and 69K additional tokens per task.

Our approach. Rather than classifying retrieved content as benign or malicious, we require the deployment policy to identify skill outputs that may contain untrusted data. When the harness commits such an output to the execution state, SkillGuard conservatively marks the state as contaminated and restricts future capabilities so that no permitted continuation can reach a forbidden state. Enforcement is thus based on reachability in a harness-computed transition abstraction, rather than on interpreting the natural-language content that caused the contamination.

We realize this approach in SkillGuard, an enforcement layer within the trusted harness that mediates skill invocations before dispatch. At its core is the Skill Impact Graph (SIG), a labeled transition system whose states encode the capability, trust, provenance, and history information required for enforcement, and whose transitions summarize the effects of registered skills. A deployment policy maps four security requirements—state safety, context integrity, capability non-escalation, and information-flow confidentiality—to forbidden states or transitions in the SIG. Each registered skill also carries a steerability signature that types its parameters and specifies the sources permitted to control them. Before dispatching an invocation, an inline reference monitor verifies that the skill is currently permitted and that the provenance of each argument conforms to its signature. The monitor then validates the skill's output before incorporating it into the agent context and enforcement state.

These local checks are necessary but insufficient: an invocation may satisfy all immediate constraints while still allowing a sequence of subsequent invocations to reach a forbidden state. After each contamination event, SkillGuard therefore solves a weighted restriction problem over the prospective SIG using only harness-computed abstractions, without invoking a language model. Its binary strategy revokes entire capabilities. Its fractional strategy replaces selected revocations with the least-cost, policy-certified tightening of their steerability envelopes. Its fractional-flow strategy jointly selects capability restrictions and certified tightenings over a conservative abstraction of capability flow. By refining whole-capability revocation into parameter-level restrictions, the latter strategies preserve functionality that coarse revocation would otherwise sacrifice.

The resulting reachability guarantee is necessarily conditional on the trusted computing base and the soundness of the abstraction: the harness must faithfully enforce the monitor's decisions; registered skills must conform to their declared transition summaries; the SIG must conservatively cover all security-relevant behavior; and the deployment policy and steerability signatures must correctly specify forbidden states and admissible sources of control. Under these assumptions, eliminating every path from a contaminated state to the forbidden set ensures that no execution represented by the SIG can violate the deployment policy.

Results. We evaluate SkillGuard on AgentDojo [8] using Gemini 2.5 Flash and Llama 3.3-70B as agent backends, and compare it with the No Defense baseline, Spotlighting, CaMeL, and AttriGuard. No Defense is an LLM-only defense in which the agent relies solely on the backend model's inherent ability to resist injected instructions. Against ToolKnowledge attacks, SkillGuard with fractional-flow restriction achieves 0% attack success on the Travel, Banking, and Workspace suites with both backends, whereas the cnon-zeroon methods exhibit non-zero attack success in several corresponding settings. On Slack, its attack success rate is 4.8% with Gemini and 14.3% with Llama. These residual cases expose two boundaries of post-contamination enforcement: some benchmark objectives are satisfied by invocations that SkillGuard treats as contamination events rather than policy violations, whereas others complete before the resulting restrictions take effect.

These security gains do not invariably come at the expense of benign utility. On Llama-Travel, for example, SkillGuard reduces attack success from 4.2% under AttriGuard to 0% while increasing benign utility from 20.0% to 35.0%. Finer-grained restriction also preserves substantially more functionality: on Travel, fractional-flow retains 93.21–94.08% of capabilities, compared with 76.25–79.29% under binary restriction, while both strategies achieve 0% attack success. Against compositional attacks, SkillGuard achieves the lowest attack success rate (8.00%) and highest utility under attack (81.82%) with Llama. With Gemini, its attack success rate is within 0.29 percentage points of CaMeL's (14.29% versus 14.00%), while its benign utility is 10 percentage points higher (92.27% versus 82.27%).

SkillGuard requires no auxiliary model inference, adding neither model calls nor tokens for protection. Its protection overhead is at most 10.02 ms per task on Banking, Slack, and Travel, and 7.17–12.56 s on the substantially larger Workspace graphs. In end-to-end measurements on Llama-Travel, SkillGuard reduces latency from 147.40 s under CaMeL to 34.57 s.

Contributions. This paper makes five contributions. (i) We formulate post-contamination security for skill-using agents as a prospective reachability problem over a Skill Impact Graph, and encode four deployment requirements—state safety, context integrity, capability non-escalation, and information-flow confidentiality—over its states and transitions (§2, §3). (ii) We introduce steerability signatures, per-skill specifications that assign a type and an enforceable steerability envelope to each parameter, together with an inline reference monitor that enforces these specifications at the dispatch boundary (§3.3, §3.4). (iii) We develop binary, fractional, and fractional-flow restriction strategies that enforce prospective reachability constraints while balancing policy-defined restriction costs against functionality retained after contamination (§3.5). (iv) We construct and validate a compositional attack dataset spanning four AgentDojo suites, in which no individual observation is sufficient to induce the target violation (§5.4, Appendix A). (v) We evaluate SkillGuard against three representative defenses and the No Defense baseline across two agent backends, demonstrating that it eliminates attack success under Tool Knowledge attacks on three of four suites without auxiliary model inference (§5).

References (37)