Skip to content

VIGIL: defending LLM agents against tool-flow injection with "verify before submit"VIGIL: Defending LLM Agents Against Tool Stream Injection via Verify-Before-Commit

arXiv· arXiv:2601.05755· ACL 2026· Junda Lin, Zhaomeng Zhou, Zhi Zheng, Shuochen Liu, Tong Xu, Yong Chen, Enhong Chen·Indexed by this site · 2026-10-12· Originally publishedDefenses

Quick read

Defenses

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

VIGIL defends against tool-flow injection with pre-commit verification; Qwen3-max tool-flow overall ASR is 8.13% (Table 2).

Threat modelStandard black-box: the trust boundary includes system instructions and private memory; the external environment is untrusted. Attackers have no weights or internal state, can only manipulate information retrieved during interaction; as compromised third-party tool providers, they can inject constraints into tool definitions during planning and forge feedback during execution, causing user intent to yield to malicious instructions.

Questions
LLM agents in open environments must ingest untrusted external data. The authors state that forged definitions and runtime feedback in tool flows are treated as binding constraints, so strongly aligned models prioritize executing injected rules; plan-then-execute cuts off the feedback needed for correction.
Methods
VIGIL first generates an abstract flow and immutable constraints from the user query, and rewrites tool descriptions and feedback into objective facts. Speculative reasoning expands multiple trajectories in a sandbox, which are submitted only after passing two levels of checks: invariant compliance and semantic entailment; failures trigger backtracking, and successful paths are cached. SIREN contains 959 tool-flow injection cases and 949 data-flow baselines.
Experiments and results
On Qwen3-max and Gemini-2.5-pro, Table 2 shows VIGIL's tool-flow overall ASR is 8.13% and 11.99%, UA 27.53% and 18.46%. The authors state reductions relative to dynamic defenses exceed 22%, and attacked utility more than doubles on Qwen3-max.
Limitations and future work
The authors note that large hypothesis spaces incur computational overhead, and immutable constraints struggle to adapt to tasks where subgoals emerge from retrieved data; future work includes pruning, lightweight verification, dynamic constraints, multimodal interfaces, and training-time alignment. Experiments use two backbones, temperature=0; the paper does not report repetitions or the models used for each module.
Experimental setupQwen3-max、Gemini-2.5-pro · SIREN、AgentDojo · ASR、UA et al.
Evaluated models
Qwen3-maxGemini-2.5-pro
Benchmarks
SIRENAgentDojo
Metrics
ASRUABU
AI summaryVIGIL defends LLM agents against tool-flow injection with a "verify-then-commit" protocol, combining speculative hypothesis generation with intent-anchored verification to balance reasoning flexibility and safety control. The authors also propose the SIREN benchmark, containing 959 tool-flow injection cases that simulate threats with dynamic dependencies. Experiments show that VIGIL reduces attack success rate by more than 22% compared to the state-of-the-art dynamic defense, and more than doubles utility under attack relative to a static baseline.

VIGIL defends LLM agents against tool-flow injection with a "verify-then-commit" protocol, combining speculative hypothesis generation with intent-anchored verification to balance reasoning flexibility and safety control. The authors also propose the SIREN benchmark, containing 959 tool-flow injection cases that simulate threats with dynamic dependencies. Experiments show that VIGIL reduces attack success rate by more than 22% compared to the state-of-the-art dynamic defense, and more than doubles utility under attack relative to a static baseline.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Tool-flow injection can hijack execution, while static isolation can cut off adaptive recovery.

    Indirect prompt injection in tool flows hijacks execution, while static isolation cuts off the feedback needed for correction.

    • Scenario: The authors state that agents in open environments must process sensitive workflows from email to critical infrastructure maintenance, requiring ingestion of untrusted external data, and thus face Indirect Prompt Injection. Unlike passive content in web pages or databases, models treat tool definitions and runtime feedback as binding operational instructions.
    • Two types of failure: Figure 1 highlights Alignment-Driven Vulnerability and Static Defense Fragility. The authors state that strong reasoning models, due to strict alignment, prioritize injected rules over user intent; weak models often fail benignly due to insufficient semantic parsing. In plan-then-execute, permissions are frozen before execution, and after forged error returns, recovery is impossible; the authors state that task completion rates collapse.
    • Idea: Replace restrictive isolation with verify-before-commit, using verification constraints anchored to user intent to speculatively explore, separating reasoning flexibility from irreversible actions.
    • Proposed objects: The framework VIGIL (Verifiable Intent-Grounded Interaction Loop), and the benchmark SIREN. SIREN contains 959 tool-flow injection cases across five vectors, plus a 949-case data-flow baseline adapted from AgentDojo; the environment has 496 competing tools and dynamic dependencies.
    • Threat model:
      • Knowledge: Standard black-box. Attackers have no model weights or internal state.
      • Boundary: The trust boundary includes system instructions and private memory; the external environment is untrusted.
      • Capability: Can only manipulate information retrieved during interaction. As a compromised third-party tool provider, the attacker can inject malicious constraints into tool definitions during planning and forge feedback during execution.
      • Goal: Mimic authoritative system commands to make the agent prioritize executing malicious instructions over user intent under seemingly legitimate tool use.
  2. What related research exists?

    The paper positions itself as distrusting both data flow and tool flow simultaneously.

    Tool-flow attacks

    • Data-flow IPI: Malicious instructions are placed in static contexts such as web pages (Liao et al., 2024; Xu et al., 2024) or databases (Su et al., 2024; Li et al., 2025b).
    • Tool flow: model context protocol (Hou et al., 2025) brings function definitions and runtime feedback into context; Wang et al. (2025) and Yang et al. (2025) examine tool risks on open protocols. The paper states that forged descriptions or deceptive errors can bypass context-level defenses and directly manipulate decisions, citing Jiang et al. (2025) and Jing et al. (2025).

    Defense architectures

    • Early filtering: Hines et al. (2024)'s Spotlighting and Rahman et al. (2024) use heuristic prompt engineering or external detection modules to filter malicious inputs. The paper states these empirical methods often fail against adaptive attacks.
    • Static isolation: Rosario et al. (2025) discuss plan-then-execute; ACE (Li et al., 2026) and CaMeL (Debenedetti et al., 2025) generate immutable plans before interaction and isolate permissions. The paper states they are effective in deterministic environments but freeze control flow, cut off feedback, and struggle with complex tasks or recovery from unexpected errors.
    • Dynamic policies: DRIFT (Li et al., 2025a) updates safety policies during interaction; MELON (Zhu et al., 2025) uses masked re-execution to detect tool-call anomalies. The paper states they mainly sanitize data flow and assume tools are reliable, making them vulnerable to mimicry attacks that mistake injected instructions for system constraints.

    Safety evaluation

    • Stateful environments: AgentDojo (Debenedetti et al., 2024) and Agent Security Bench (Zhang et al., 2024a) evaluate multi-step interactions. The paper states these benchmarks assume tools are complete, evaluate almost exclusively data-flow attacks like malicious emails, ignore executable tool sets, and cite Evtimov et al. (2025) and Levy et al. (2024).
    • Tool-flow benchmarks: MCPTox (Wang et al., 2025) and MCPSecBench (Yang et al., 2025) expose tool-flow vulnerabilities. The paper states existing evaluations still treat data risk and tool risk as orthogonal vectors, or cover only scenarios with limited reasoning complexity.

    Baseline methods are Spotlighting, DeBERTa-Classifier, Tool-Filter, CaMeL, MELON, DRIFT, and undefended Vanilla ReAct (Yao et al., 2022). Benchmark/dataset is self-built SIREN, with the data-flow portion using 949 content injections from AgentDojo.

    The authors state VIGIL explicitly distrusts both data flow and tool flow, using verify-before-commit and speculative reasoning to handle safety constraints and complex problem-solving simultaneously; SIREN places dual-flow threats and reasoning dependencies in the same evaluation.

  3. How does the paper address this problem?

    VIGIL generates hypothetical trajectories and only submits actions after intent-constraint verification.

    VIGIL changes direct action selection to first generating hypothetical trajectories and committing only after verification passes. A standard policy maps query q with potentially injected data Dδ and feedback Fδ directly to actions. The committed object comes from verified trajectories: τ∗=select(τi∈H | V(τi,C,q)=true). C is a constraint anchored to user intent and not rewritten during execution; H is the set of hypothetical trajectories.

    Problem Setup and Verification Decomposition

    • Five components: Intent Anchor synthesizes C from q; Perception Sanitizer cleans inputs; Speculative Reasoner generates H; Grounding Verifier implements V; Validated Trajectory Memory adapts based on verification results. Figure 2 shows this pipeline.
    • Two-step verification: V(τi,C,q)=Vcompliance(Mτi,C)∧Ventailment(τi,q). First, check whether action metadata satisfies invariants; then judge whether the trajectory is necessary to complete q. The authors state that decomposing reduces cognitive load and narrows the decision space, thereby reducing the risk of hijacking compared to a single execution prompt.
    • Implementation roles: Anchoring and verification are performed by role-based LLMs; the anchoring role is configured as a security analyst. Appendix C provides full prompts for the four modules. The paper does not state whether modules use different models from the backbone, nor the number of branches or probability thresholds.

    SIREN Environment and Vectors

    • Reconstruction: Built on AgentDojo, adding semantic tool redundancy and randomized runtime feedback. The tool library expands to 496 tools with overlapping embeddings but different parameter specifications; random failures and forged state information force agents to handle exceptions and replan.
    • Planning phase (Table 1): Explicit Directive 174 cases, placing mandatory constraints in docstrings, corresponding to Compliance Bias, with benign/malicious/same-domain tool counts 0/68/0. Dependency Trap 184 cases, forging prerequisite tools, corresponding to Causal Reasoning, 0/67/52. Feature Inducement 179 cases, using attractive feature descriptions to cause same-domain confusion, corresponding to Semantic Confusion, 53/54/54.
    • Execution phase: Runtime Hijacking 272 cases, placing adversarial instructions in return values, corresponding to State Tracking, 53/22/22. Error Hijacking 150 cases, using blocking errors paired with malicious procedures to exploit exception handling, corresponding to Exception Handling, 53/21/21. Total across five categories: 959 cases.
    • Data-flow baseline: 949 content injections from AgentDojo, with injection surfaces in user data such as email or web pages, corresponding to Context Distraction, tool counts 53/0/0. Appendices A–B and Tables 4–6 give construction details and examples; injection texts are not reproduced here.

    Intent Anchoring and Input Sanitization

    • Root of trust: The anchoring function derives from q only an abstract process sketch and query-specific logical invariants, not generic safety rules. Example: travel planning can yield scope limited to Travel, transaction type MERCHANT. The verifier uses these conditions to prune violating paths early.
    • Objective rewriting: The sanitizer separates propositional content from illocutionary force, removing manipulative modifiers like imperatives or urgency, preserving functional semantics. Example: descriptions with mandatory invocation instructions are rewritten as factual statements of purpose before being passed to downstream reasoning, to avoid triggering compliance bias during reasoning.

    Speculative Reasoning and Commitment

    • Sandbox exploration: At each step, multiple candidate branches are expanded using sanitized tool information. Each trajectory is a sequence of actions; a profiling function extracts metadata such as operation type and information flow for each action. The process occurs in a hypothetical sandbox; nothing is committed until verification passes.
    • Approval conditions: Compliance checking treats consistency of metadata with hard constraints as a narrow-domain classification. Example: peer-to-peer transactions are rejected for violating predefined transaction type constraints. Those passing undergo semantic entailment judgment to see if the trajectory is necessary to fulfill user intent. Approval requires both stages to pass.
    • Backtracking and caching: Verification failure triggers reflective backtracking; successful trajectories are written to memory for reuse in subsequent reasoning.
  4. What experiments did the paper conduct?

    Table 2: VIGIL tool-flow overall ASR is 8.13% for Qwen3-max and 11.99% for Gemini-2.5-pro.

    Experimental Setup

    • Benchmark: All 959 SIREN tool-flow injections, plus 949 data-flow cases adapted from AgentDojo; tool library of 496 tools.
    • Backbones: Qwen3-max and Gemini-2.5-pro, all models at temperature=0. The paper does not report the number of repetitions.
    • Baselines: Input-side: Spotlighting and DeBERTa-Classifier; static isolation: Tool-Filter and CaMeL; dynamic defenses: MELON and DRIFT; lower bound: undefended Vanilla ReAct. Seven in total.
    • Metrics: BU is task completion rate in non-adversarial environments. ASR is the proportion of cases where the attacker successfully executes malicious goals. UA requires simultaneously completing the user task and neutralizing malicious instructions; the authors call this a strict standard.
    • Evaluation: The paper does not specify LLM judges, thresholds, or human agreement; it states it follows protocols from Zhu et al. (2025) and Debenedetti et al. (2024).
    • Internal models: VIGIL's anchoring and verification are written as role-based LLMs. The paper does not name models different from the backbone.

    Main Results

    The table below shows SIREN tool-flow Overall, in %. The table note states this column is the macro-average of the five vectors. From Table 2.

    Swipe horizontally to read the table

    MethodQwen ASRQwen UAGemini ASRGemini UA
    Vanilla ReAct73.8315.9558.9212.93
    Spotlighting63.6120.3350.8911.57
    DeBERTa47.2410.6433.2610.32
    Tool-Filter20.135.1118.567.19
    CaMeL25.3411.6827.8410.74
    MELON36.7019.5032.6413.87
    DRIFT32.6414.6033.0615.85
    VIGIL8.1327.5311.9918.46
    • The authors state VIGIL breaks the rigidity-utility trade-off. Figure 3 is a UA–ASR plot for both models; the authors state VIGIL lies in the lower-right quadrant; the figure text does not give coordinates for each point. The authors state that relative to CaMeL, tool-flow average ASR drops from over 25% to about 8% for Qwen3-max and about 12% for Gemini-2.5-pro; relative to DRIFT, the reduction is 22% to 24%. The abstract says over 22%, the contributions list says over 18%. The introduction states tool-flow average ASR is about 8–12%.
    • The authors state Tool-Filter and CaMeL have tool-flow UA below 12%, and that VIGIL more than doubles task completion rate on Qwen3-max compared to such static baselines. On data flow, the authors state parity with strict whitelisting: Qwen3-max ASR for VIGIL is 0.32%, Tool-Filter 0.11%, CaMeL 0.00%; DRIFT's data-flow UA is 59.75%, higher than VIGIL's 40.57% (Table 2).
    • BU: On Qwen3-max, VIGIL is 74.49%, Vanilla ReAct 79.59%, DeBERTa 43.88%, CaMeL 46.79%. On Gemini-2.5-pro, VIGIL is 40.82%, Vanilla ReAct 65.31%, Tool-Filter 48.98%, CaMeL 30.84%. The authors state the trade-off on Gemini comes from a conservative verifier, and claim it still outperforms strict isolation methods; in Table 2, Tool-Filter's BU is higher than VIGIL's.

    Component Ablation

    • Setup: Table 3 removes Anchor, Sanitizer, Reasoner, Verifier individually on SIREN. The paper does not specify the backbone model; Full System's data-flow 40.57/0.32 and tool-flow 27.53/8.13 match the VIGIL row for Qwen3-max in Table 2.
    • Numbers: Removing Verifier yields tool-flow ASR 45.05%, data-flow ASR 6.95%. Removing Reasoner drops tool-flow UA from 27.53% to 9.07%, with ASR 8.45%. Removing Sanitizer gives tool-flow ASR 24.19% and data-flow ASR 12.33%; removing Anchor gives tool-flow ASR 15.33%.
    • Authors' interpretation: The authors state that removing any module worsens safety or utility, and that all modules must coexist.

    Scale and Attack Density

    • Tool scale: 100 consecutive tasks. Standard scale is 496 tools; large scale expands to 3,074 same-domain tools. The authors state that at large scale, initial verification costs are higher, but average overhead converges to a constant, attributed to trajectory memory caching safe paths. Figure 4(a)(b) x-axis is Number of Tasks, ticks 0, 25, 50, 75, 100; text does not give curve endpoint values.
    • Attack density: Benign-to-malicious ratio from 1:1 to 1:8. The authors state ASR remains low, UA gradually declines but does not collapse. Figure 4(c) y-axis is Percentage (%), ticks 0, 20, 40, without readings for each ratio.

    Other Ablations and Analyses

    • Explicit Directive: On Qwen3-max, VIGIL's ASR/UA is 16.09%/17.24%, CaMeL 44.83%/23.56% (Table 2).
    • Dependency Trap: VIGIL's ASR is 1.09% (Qwen3-max) and 1.63% (Gemini-2.5-pro) (Table 2).
    • Feature Inducement: VIGIL's ASR is 24.02% and 37.99%; on Gemini-2.5-pro, CaMeL is 37.43%, Tool-Filter 22.91% (Table 2).
    • Runtime Hijacking: VIGIL's ASR is 0.00% on both models (Table 2).
    • Error Hijacking: VIGIL's ASR is 3.33% and 2.67%, CaMeL 0.00% for both; UA is 14.67%/12.67% vs. 2.00%/1.33% (Table 2).
    • Data flow: VIGIL's ASR is 0.32% and 0.21%, UA 40.57% and 39.30%; DRIFT's UA is 59.75% and 47.63% (Table 2).
  5. What are some points that can be further explored?

    The authors point out the overhead of the hypothesis space and the adaptation issues of immutable constraints, and write down future directions.

    Limitations and Future Directions Noted by the Authors

    • Computational overhead: Exploring large hypothesis spaces incurs computational overhead; future work could use lightweight verifiers or further pruning (Limitations). Conclusion and Future Work also mentions pruning to improve the computational efficiency of the speculative reasoner.
    • Immutable constraints: Safety anchoring on immutable constraints from the initial user query may limit adaptation to open tasks, as subgoals emerge dynamically from retrieved data; future work could study dynamic constraint evolution (Limitations).
    • Multimodality: verify-before-commit could extend to multimodal agents to handle injection surfaces in visual interfaces (Conclusion and Future Work, citing Cao et al., 2025).
    • Training-time alignment: Could combine with training-based alignment techniques for defense in depth (Conclusion and Future Work).

    Experimental Coverage

    • Tested backbones are Qwen3-max and Gemini-2.5-pro, temperature=0 (§5.1).
    • Main experiments use SIREN's five tool-flow categories totaling 959 cases, 949 data-flow cases, and seven baseline defenses (Table 1, Table 2).
    • Ablations remove Anchor, Sanitizer, Reasoner, Verifier (Table 3); scale experiments use 100 consecutive tasks, 496 and 3,074 tools; attack density from 1:1 to 1:8 (§5.3, Figure 4).
    • The paper does not report repetitions or query counts, nor whether the models implementing anchoring, sanitization, and verification differ from the backbone (§4, §5).
    • The paper does not report statistical tests, nor agreement of ASR, UA, BU with human judgment; §5.1 states metrics follow existing protocols.
  6. Summarize the main content of the paper

    VIGIL handles tool-flow injection with intent-constrained pre-commit verification.

    VIGIL uses verify-before-commit to handle tool-flow injection in agents, and comes with the SIREN benchmark.

    • Problem: In open environments, forged tool definitions and runtime feedback can hijack execution. The authors state that strong alignment makes models prioritize obeying injected rules, while defenses that freeze plans before execution lose the ability to complete tasks under forged errors.
    • Approach: Only generate a flow sketch and immutable constraints from the user query, and rewrite tool descriptions and feedback into objective facts. Speculative reasoning expands multiple trajectories in a sandbox, which are submitted only after passing invariant compliance and semantic entailment checks; failures trigger backtracking, and successful paths are cached. SIREN has 959 tool-flow cases, five vector types, and 949 data-flow baselines, with a tool library of 496 tools.
    • Threat model: Standard black-box. Attackers have no weights or internal state, and act as compromised third-party tool providers manipulating retrieved tool definitions and runtime feedback.
    • Results: Backbones are Qwen3-max and Gemini-2.5-pro, temperature=0. In Table 2, VIGIL's tool-flow overall ASR is 8.13% and 11.99%, and UA is 27.53% and 18.46%. The authors state that ASR reduction relative to dynamic defenses exceeds 22%, and the contribution list writes over 18%; they also state that on Qwen3-max, attacked utility is more than doubled compared to the static baseline. Qwen3-max's BU is 74.49% versus 79.59% undefended; Gemini-2.5-pro's BU is 40.82% versus 65.31% undefended. Without the verifier, Table 3's tool-flow ASR is 45.05%.
    • Authors' conclusion: The authors state that decoupling speculative exploration from irreversible execution can preserve both safety and reasoning flexibility in open environments. The authors also point out the computational cost of the large hypothesis space and the adaptation issues of immutable constraints for open tasks; future directions include pruning, dynamic constraints, multimodal interfaces, and training-time alignment.

Related papers

Show 3 more papers
Read originalACL 2026