Skip to content

APEX: proactively defending against indirect prompt injection at the LLM agent execution boundary.APEX: Active Protection at Execution Boundaries for LLM Agents

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.06966· Xinran Zheng, Xin Fan Guo, Zhiqiang Hao, Fan Yang, Xingzhi Qian, Jiawei Du, Jinfeng Xu, Zheng Xing, Shuo Yang, Xingjun WangTsinghua University; Imperial College London; Nanjing University; The Chinese University of Hong Kong; University College London; A*STAR; University of British Columbia; Shenzhen University; The University of Hong KongIndexed by this site · 2026-10-07· Originally publishedSelected DefensesSelectedAttention38

Quick read

Defenses

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

The authors propose the execution-boundary defense APEX, with an ASR of 0% on five of six IPI benchmarks and 0.56% on SkillInject.

Threat modelTrust user tasks, the capability registry and the defense; attackers can inject arbitrary content through registered surfaces, affecting agent behavior or persistent state. The guarantee covers external consequence operations mediated through registered interfaces; effects or state changes that bypass the interfaces are out of scope.

Questions
Indirect prompt injection can enter agents through Tool, MCP, Skill and their combinations. The authors consider that defenses relying on recognizing attack content, local behavior or runtime provenance labels struggle to scale with carriers and combination modes.
Methods
Before execution, APEX compiles the trusted task into an authorization contract; at the execution boundary it uses WRAP to verify effect and parameter authorization, and uses PLANT probes to expose information use not approved by the task; after a refusal, it repairs, replans or aborts.
Experiments and results
On six benchmarks and 13 baselines, APEX has an ASR of 0% on five benchmarks, and SkillInject is 0.56%. On the three adaptive attack subsets in Table 2, ASR is 0% in all cases; removing WRAP or PLANT generally raises ASR.
Limitations and future work
The authors note that vague tasks may generate over-restrictive contracts, and tasks that pre-delegate decisions to external content are also hard to express fully; long tasks still require dedicated benchmark evaluation. The adaptive experiments cover only the applicable subset of each benchmark.
Experimental setupDeepSeek-V4-Flash、GLM-5.2 et al. · AgentDojo、ASB-OPI et al. · BU、AU et al.
Evaluated models
DeepSeek-V4-FlashGLM-5.2GPT-5.6-sol
Benchmarks
AgentDojoASB-OPIMCPToxMCP Security Bench (MSB)SkillInjectSCR-Bench
Metrics
BUAUASRAU−ASRaverage LLM tokens per tasknumber of LLM calls
AI summaryand selection rationaleResearchers propose APEX, shifting indirect prompt injection defense from recognizing attack patterns to checking every action to be executed at the execution boundary, i.e., where the agent converts internal state into external actions or released outputs. APEX compiles the user task into an authorization contract before untrusted content arrives, and reads it with two mechanisms: WRAP only lets through actions and parameters that can be proven authorized based on the contract and runtime evidence, while PLANT places probes on dependency channels endorsed by the contract, so that information not endorsed by the task is exposed when used. The method requires only a single task-agnostic registration per capability unit, and the same mediation logic uniformly applies to Tool, MCP, and Skill calls, including nested calls. Compared against 13 baselines on six benchmarks covering three types of capability units, APEX achieves a 0% attack success rate on five of them, 0.56% on the sixth, and maintains a 0% attack success rate under adaptive attacks targeting all three types of capability units. Code has been released.

Researchers propose APEX, shifting indirect prompt injection defense from recognizing attack patterns to checking every action to be executed at the execution boundary, i.e., where the agent converts internal state into external actions or released outputs. APEX compiles the user task into an authorization contract before untrusted content arrives, and reads it with two mechanisms: WRAP only lets through actions and parameters that can be proven authorized based on the contract and runtime evidence, while PLANT places probes on dependency channels endorsed by the contract, so that information not endorsed by the task is exposed when used. The method requires only a single task-agnostic registration per capability unit, and the same mediation logic uniformly applies to Tool, MCP, and Skill calls, including nested calls. Compared against 13 baselines on six benchmarks covering three types of capability units, APEX achieves a 0% attack success rate on five of them, 0.56% on the sixth, and maintains a 0% attack success rate under adaptive attacks targeting all three types of capability units. Code has been released.

Why it was selectedAPEX shifts indirect prompt injection defense from identifying attack patterns to the execution boundary, using authorization contracts to simultaneously constrain unauthorized actions and unendorsed information usage, and provides evaluation data across Tool, MCP, and Skill.

Related events and news

1 events · 0 news mentions

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Shift IPI defense from recognizing attack patterns to verifying task authorization and information use at the execution boundary.

    Core question: Can indirect prompt injection (IPI) be defended only at the positions that attacks must pass through to cause external consequences, without inspecting the ever-expanding execution space?

    • Scenario and importance: The authors state that agents are composed of capability units such as Tools, MCP servers and Skills, and that units can nest and fuse intermediate results, making injection carriers and trust boundaries more complex. A combination of individually seemingly legitimate steps may also produce harmful results.
    • Shortcomings of existing methods: The paper holds that content-level methods rely on distinguishing trusted instructions from untrusted content; runtime alignment looks only at local behavior, policies constrain only relations expressed by rules, and provenance labels may be lost or diluted in LLM reasoning transformations.
    • Core observation: Regardless of how an injection enters or propagates, external consequences arise only when the agent takes action on the environment or releases output, which the authors call the execution boundary. Boundary risk is divided into unauthorized effects, and authorized effects that adopt information not endorsed by the task.
    • Proposed defense: APEX compiles an authorization contract before untrusted execution, uses evidence gating to prevent WRAP and deceptive exposure, and PLANT checks each proposed effect; the same mediation logic is used for Tool, MCP, Skill and nested calls.
    • Threat model:
      • Goal: Prevent attackers from using injection to influence agent behavior or persistent state, ultimately forming externally harmful operations or outputs.
      • Knowledge and capability: Attackers can inject arbitrary content through registration surfaces; the paper does not uniformly name this white-box or black-box.
      • Trusted parts and victim system: The user task, registry and defense are trusted, and the victim system is an LLM agent executing a trusted user task.
      • Guarantee boundary: Only external-consequence operations mediated through registered interfaces are covered; effects or state changes that bypass interfaces, and Uq where both the effect and the dependency are endorsed but still harmful, are not covered.
  2. What related research exists?

    Related work is organized by attack vector and content, alignment, policy, provenance and deception defenses.

    Agent capability units and IPI attacks

    • Tool and compositional attacks: InjecAgent, AgentDojo and ASB study IPI in tool environments; STAC, Les dissonances, ColluSkill and SCR-Bench study how individually benign-looking tools or Skills combine into harmful behavior.
    • MCP and Skill vectors: MCPTox, MSB and Song et al. study MCP metadata, response and workflow attacks; SkillInject, SkillJect, SkillSafetyBench and PhantomSkill study Skill instruction, resource or code vectors.
    • Adaptive attacks: Zhan et al. (2025), AutoDojo, IterInject and AdapTools adjust payloads or tool selection according to deployed defenses; the paper accordingly incorporates defense-aware attacks into robustness evaluation.

    Content separation and task-alignment defenses

    • Content-level methods: Spotlighting uses delimiters or markers to distinguish content; StruQ, Jatmo, SecAlign and Instruction Hierarchy handle instruction priority through structured queries, fine-tuning or preference optimization, and classifiers and guard models screen inputs. The authors argue that injections disguised as ordinary task-relevant text can bypass the assumption that content is separable.
    • Task-alignment methods: TaskShield checks whether instructions and calls serve the user's goal; MELON replays observations under task-neutral prompts and compares calls; AttriGuard suppresses control signals in observations before judging whether a call appears. The authors criticize that such criteria measure what drives action, which is not equivalent to user authorization.

    Policy and provenance constraints

    • Policy systems: AgentSpec et al. fix rules in advance; Progent generates and updates tool-call policies, ClawGuard derives access constraints from task goals, DRIFT plans function traces and parameter lists, and IPIGuard plans tool dependency graphs. The authors state that DRIFT and IPIGuard also fix the execution shape, and these specifications do not state how allowed parameters are computed from source responses.
    • Provenance and isolation methods: RTBaS and NeuroTaint propagate taint labels; information-flow isolation designs such as CaMeL keep untrusted data away from decision components; AgentArmor, FAVA, AuthGraph, PACT and CXI respectively recover graph structure or verify parameter permissions. The authors argue that the structure that needs to be tracked may still have to be recovered from runtime material already influenced by the attacker.

    Deceptive defenses and this paper's positioning

    • Honeypot-style methods: Spitzner's honeypot idea is applied to agents by Ayzenshteyn et al., AgentShield and HoneyTrap, placing decoys that normal execution need not touch. The authors argue that existing decoy locations are mostly determined heuristically, hits only flag anomalies, and once identified, attackers can switch to real objects.
    • Baselines and benchmarks: The 13 baselines are Spotlighting, Tool Filter, TaskShield, MELON, CaMeL, DRIFT, Progent, AgentShield, MCPGuard, StackOne Defender, Pipelock, ClawGuard and Dynamic Guardian; AgentDojo, ASB-OPI, MCPTox, MSB, SkillInject and SCR-Bench are used.

    The authors position APEX as answering both "is the effect authorized" and "is the information use approved" at the execution boundary based on pre-fixed user authorization, rather than continuing to extend a particular kind of attack signal.

  3. How does the paper address this problem?

    APEX centers on frozen authorization contracts, combined with WRAP, PLANT and safe continuation.

    APEX treats each call with external effects as an independent proposal, checking both authorization and probe adoption before commitment; execution is allowed only if neither check triggers.

    Risk decomposition and trusted registration

    • The paper writes adversarial boundary execution as Eadv=Aauth∪̇Ainfl∪̇Uq: corresponding respectively to unauthorized effects, unendorsed information use within authorized effects, and the residual risk where both are endorsed but still harmful.
    • Each Tool, MCP method or executable Skill interface is registered once, recording the interface, I/O schema, whether it returns visible observations, whether it produces external effects, and the visible runtime surface; registration is task-independent and reused across tasks.
    • MCP treats operations as having external consequences by default unless the name indicates read-only; Skill helpers are registered by the path and digest of the installation package. Nested effects, once exposed through registered interfaces, are likewise mediated separately.

    Compiling the task into an authorization contract

    • Before execution, the task compiler compiles the trusted task q and registry M into a directed acyclic graph contract Cq, and validates and freezes it with the registry; nodes are clauses, edges are task-endorsed dependencies, and no specific execution trajectory is prescribed.
    • Acquire obtains values from registered capabilities; Derive uses relational constraints to compose values from upstream outputs; Conditional uniquely determines a value with a declared operator; Effect declares the authorized action, parameter positions and the justification for each parameter.
    • The contract fixes clauses, dependencies and operators, but runtime values remain open. Table 4 lists Conditional operators such as arithmetic, structured data, sets, selection, predicate gating, time, paths and composition.

    Boundary checks of WRAP and PLANT

    • WRAP: Call receipts record the capability, parameters and return values, but receipts only establish facts and do not grant permissions. WRAP traces backward from the proposal to the Effect clause, then resolves forward from receipts and upstream outputs, requiring that the action, parameter positions and all parameter values can be reconstructed.
    • The refusal condition is written as Rej_{C_q}(R,e)\iff e\not\models\Sigma_u^{in}\lor\nexists c\in C_q:a_e=a_c\land K_e\subseteq K_c\land\forall k\in K_e,v_k\in\llbracket J_{c,k}\rrbracket_{R,x}, i.e., the input schema does not match or no single Effect clause supports all parameters.
    • The script restricts candidate sources, composition modes and exact reconstruction, and the WRAP sub-agent makes semantic choices only among candidates allowed by the script. Appendix B.2 gives an authorization soundness proof under three assumptions: contract fidelity, receipt correctness and semantic binding correctness.
    • PLANT: Observation, dependency and base probes are placed on the dependency path from Acquire to Effect; probe tokens are generated per episode and carrier. Positions must preserve normal task behavior, and when this cannot be confirmed they are discarded and handled by WRAP.
    • Interception triggers when an observation probe appears in parameters or released responses, or when a base probe appears in a confirmed interaction; dependency probes only record and do not gate on their own, because they do not bind clauses, and parameters depending on them will be refused by WRAP.

    Safe continuation and implementation coordination

    • The non-agentic controller preserves verified bindings and invalidates the evidence involved, without interpreting the task or adding clauses. Repair deterministically reconstructs the proposal; when a probe has been adopted or Repair is impossible, a new agent without the original dialogue context Replans; when the same conflict recurs or there is no work that can continue, it Aborts.
    • All repair or replanning proposals pass through the same boundary again, and the contract is unchanged. Algorithm 1 coordinates the three sub-agents: task compiler, WRAP and PLANT; Appendix B.4 states that retries are paired by failure category, parameter and value, and each retry identity allows only one replanning.
  4. What experiments did the paper conduct?

    APEX maintains low ASR on six benchmarks and adaptive attacks; ablations and failure attribution give the conditions.

    Experimental Setup

    • Models and protocol: The task agent and the default defense component are both DeepSeek-V4-Flash, and GPT-5.4 is used for LLM judging; all baselines share the backbone, instances and evaluation protocol. For defense-backbone generalization, GLM-5.2 and GPT-5.6-sol are additionally tested, with the task agent unchanged.
    • Tool benchmarks: AgentDojo contains 97 benign tasks and 629 security cases; ASB-OPI pairs 51 benign tasks with 40 attack tools per domain, forming 2,040 attack cases.
    • MCP and Skill benchmarks: MCPTox contains 357 clean cases and 1,348 attack cases; MSB contains 622 cases. SkillInject has 180 attack cases; SCR-Bench contains CapFlow 150, AuthBlur 116 and TrustLift 401, totaling 667 cases.
    • Baselines: 13 in total, configured by Tool, MCP and Skill threat surface; released implementations and default settings are used, replacing only the model interface required by the public backbone. TaskShield has no public implementation, so the authors reproduced it following the published procedure.
    • Metrics: BU is the proportion of clean tasks completed correctly, AU is the proportion of attack cases in which the original user task is completed correctly, and ASR is the proportion of attack objectives achieved; Figure 5 additionally uses AU−ASR, average LLM tokens per task and number of LLM calls.
    • Judging and reproducibility information: The public data and evaluation programs of each benchmark are used; AgentDojo checks environment state, and MSB's ASR uses 622 cases while utility errors are computed over 415 evaluable cases. The paper does not report a unified number of repetitions, confidence intervals or statistical significance tests.

    Main Results

    The main results are APEX's AU/ASR (%) on six benchmarks, with both the task agent and the defense backbone being DeepSeek-V4-Flash; according to Table 1, Table 3, Table 6 and Figures 3 and 4.

    Swipe horizontally to read the table

    BenchmarkAUASRControl: Undefended AU/ASR
    AgentDojo80.290.0073.77/17.01
    ASB-OPI85.050.0071.23/59.80
    MCPTox75.520.0041.25/36.20
    MSB96.390.0090.60/48.71
    SkillInject78.890.5683.33/28.89
    SCR-Bench99.850.0091.45/86.21
    • Cross-carrier results: The authors state that APEX achieves the lowest ASR on all six benchmarks while maintaining task utility; five of these are 0%, and SkillInject is 0.56%.
    • Tool control: In Table 1, the other defenses on ASB-OPI have ASR of 9.80%–51.13%; APEX's BU is 90.20%. On AgentDojo, both Spotlighting and Tool Filter have ASR of 0.16%, but Tool Filter's BU is only 21.65%.
    • Exception conditions for combined attacks: In Table 8, APEX's ASR on CapFlow, AuthBlur and TrustLift is 0% for all; ClawGuard and Progent did not evaluate AuthBlur, so their SCR summary uses only CapFlow and TrustLift (n=551), while other methods use all three suites (n=667).

    Adaptive Attacks and Defense Backbone

    • Three types of adaptive attacks: AutoDojo, MCP-ITP and SkillJect target Tool, MCP and Skill respectively; GPT-5.4 generates attack artifacts, each artifact is optimized against one evaluated defense and then fixed, and the original attacks and adaptive attacks use the same applicable subset.
    • Table 2 results: APEX's ASR on the ASB-OPI, MCPTox and SkillInject subsets is 0.00% for both original and adaptive attacks, with adaptive AU of 96.00%, 78.46% and 93.18% respectively. Undefended adaptive ASR is 86.25%, 53.85% and 47.73% respectively.
    • Remaining subsets and negative results: In Table 7, APEX's adaptive ASR on the MSB and SCR-Bench subsets is also 0.00%, with AU of 61.32% and 98.00%. The authors additionally state that AutoDojo on the AgentDojo and DeepSeek-V4-Flash combination shows limited improvement over the original attacks, so it was not included in the adaptive stress test.
    • Changing the defense backbone: Table 6 fixes the task agent as DeepSeek-V4-Flash; GLM-5.2 defense has ASR of 2.78% and 1.20% on SkillInject and SCR-Bench, and GPT-5.6-sol has 0.56% and 0.00% respectively. The authors state that low ASR is maintained under different defense backbones, with the main difference in utility.

    Ablation, Overhead and Failure Attribution

    • Primitive ablation: According to Table 3, on ASB-OPI, removing WRAP gives ASR of 57.60%, while removing PLANT still gives 0.00%; on MCPTox, removing PLANT and WRAP gives 6.45% and 4.15% respectively. On SkillInject, removing the two gives 3.33% and 2.22% respectively, while the main text elsewhere writes 2.23% for removing WRAP, an inconsistency between the two places.
    • Continuation ablation: When Continuation is removed, ASB-OPI has AU of 62.20% and ASR of 0.00%, and MCPTox has AU of 48.15% and ASR of 1.11%; on this basis the authors consider that continuation mainly preserves utility after refusal.
    • Overhead: The text of Figure 5 shows that APEX has the highest AU−ASR on ASB-OPI and MCPTox, and is tied for highest on SkillInject; the main text gives APEX as 85.1, TaskShield as 14.9 and Spotlighting as 10.9 on ASB-OPI. The authors state that overhead mainly comes from PLANT and Safe Continuation, and do not give a unified time cost.
    • Utility failures: Table 9 records 813 utility errors among 5,486 attack cases, of which 597 are attributed to task-agent limitation, 34 to contract error, 218 to WRAP false positive and 322 to continuation failure; categories may overlap, and PLANT false positives are 0.
    • The only defense failure: Appendix I.2 attributes SkillInject's 0.56% ASR to one case: both the effect and the information dependency are authorized, but the report-writing tendency is still harmful, belonging to Uq; WRAP has no parameter it can refuse, and PLANT is discarded because there is no probe position that preserves task semantics.

    Other Ablations and Analyses

    • PLANT deployment: In Table 5, 4,397/5,486 attack cases have at least one probe deployed, accounting for 80.1%; MSB is 41.2% and SCR-Bench is 37.5%.
    • Probe triggering: 779/10,193 deployed probes produce a gating witness, accounting for 7.6%; the authors emphasize that the deployment rate measures covered positions and is not equivalent to a protection rate.
    • Discard decisions: Of 38,518 plane checks, 32,043 are discarded, including cache-reuse decisions; the authors state that no probe is placed when benign behavior cannot be confirmed to be preserved.
    • Baseline utility exceptions: In Table 8, ClawGuard on TrustLift has BU, AU and ASR all of 6.48%; Progent and DynamicGuardian both have ASR of 100.00% on that suite.
  5. What are some points that can be further explored?

    The authors discuss contract expression, probe coverage and long tasks; the experiments also have explicit subset boundaries.

    Limitations and future directions noted by the authors

    • Contracts may over-restrict: Section 5 notes that vague or underspecified requests may generate contracts that block legitimate work; the authors believe authorization could be clarified before compilation.
    • Pre-delegation is hard to express: Section 5 notes that tasks that intentionally delegate decisions to external content cannot be fully expressed in advance; future work needs to specify who can provide instructions, which actions can be authorized, and obtain user approval when restrictions change, i.e., controlled re-delegation.
    • Probe coverage depends on deployment: Section 5 notes that other locations may disrupt injection without leaving a witness, and coverage depends on deployment and probe preservation; when benign behavior cannot be maintained, PLANT discards, and the remaining Uq requires task-specific content constraints.
    • Long tasks remain to be evaluated: Section 5 states that APEX can in theory scale to long tasks, but accurate compilation of complex goals, dependencies and conditional branches is a challenge, and long-horizon safety benchmarks in which attacks remain effective against current model-driven agents are needed to further evaluate effectiveness and scalability.
    • Adaptive attack coverage has boundaries: Appendix F notes that observations on AgentDojo apply only to the tested AutoDojo and DeepSeek-V4-Flash combination, and broader evaluation requires attack strategies that can better challenge this setting.

    Experimental coverage

    • Model scope: In the main experiments, the task agent and defense are both DeepSeek-V4-Flash; the defense backbone is additionally tested with GLM-5.2 and GPT-5.6-sol, and GPT-5.4 is used for the judge and adaptive artifact generation (Section 4.1, Appendices C, G).
    • Attack case scale: The six benchmarks total 5,486 attack cases; AgentDojo additionally has 97 benign tasks, and MCPTox additionally has 357 clean cases (Appendix D, Table 5).
    • Adaptive subsets: ASB-OPI is 400/2,040 cases, MCPTox is 455/1,348 cases, MSB is 212/622 cases, SkillInject is 44/180 cases, and SCR-Bench is 150/667 cases; all are filtered by attack surface and automatically scorable targets (Appendix G.2).
    • SkillInject configuration: The obvious-injection configuration is used, with attack capabilities written into the Skill body and auxiliary scripts, without changing the YAML description; 36 scenarios are tested at five insertion positions, totaling 180 cases (Appendix D).
    • Statistical and reproducibility information: The paper does not report the number of repetitions, confidence intervals or statistical significance tests for the main results; the failure attribution categories in Table 9 are not mutually exclusive, and MSB utility errors are calculated only over the 415 evaluable cases.
  6. Summarize the main content of the paper

    APEX enforces task authorization at the execution boundary, with an ASR of 0% on five of six benchmarks.

    APEX is an execution-boundary defense for IPI in LLM agents, covering Tool, MCP, Skill and their combinations, rather than establishing rules for specific injection texts or carriers.

    • Problem: The authors consider that the nesting and combination of capability units expand the attack surface, and that content recognition, local task alignment, fixed policies and runtime provenance recovery all struggle to independently answer "what exactly did the user authorize".
    • Method: Before untrusted content arrives, APEX compiles and freezes the trusted task into an authorization contract. WRAP uses the contract and call receipts to reconstruct action and parameter authorization; PLANT places probes that preserve benign behavior on endorsed dependencies, so that unendorsed information adoption leaves a witness before the effect is committed.
    • Handling after refusal: Safe continuation preserves verified evidence and removes the evidence involved, successively using Repair, Replan without the original dialogue context, or Abort; new proposals must pass the same boundary checks again.
    • Main results: With the default DeepSeek-V4-Flash task agent and defense backbone, APEX's ASR is 0.00% on AgentDojo, ASB-OPI, MCPTox, MSB and SCR-Bench, and 0.56% on SkillInject; the corresponding AU is 80.29%, 85.05%, 75.52%, 96.39%, 78.89% and 99.85% respectively (Table 6).
    • Robustness and ablation: On the three adaptive attack subsets in Table 2, APEX's ASR is 0.00% for both original and adaptive attacks. In Table 3, ASB-OPI after removing WRAP has ASR of 57.60%, and MCPTox after removing PLANT has 6.45%, showing that different benchmarks depend on different boundary mechanisms.
    • Authors' conclusion and boundary: The authors state that a unified execution boundary can maintain low ASR and preserve utility across different capability units and defense backbones. At the same time, contract fidelity is a precondition; the only successful case on SkillInject belongs to Uq, where both the effect and the dependency are endorsed but the content is still harmful, requiring finer user intent or task-specific safety policies.

Related papers

Show 3 more papers
Read originalarxiv.org