Skip to content

Study reframing indirect prompt injection as a test-time search problemRethinking Indirect Prompt Injection as a Test-Time Search Problem

arXiv: Agent & MCP Security· arXiv:2609.04495· Duong M. Nguyen, Joon Sik Kim, Blazej Manczak, Vaikkunth Mugunthan·Indexed by this site · 2026-10-01· Originally publishedAttacks

Quick read

Attacks

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

The authors frame indirect prompt injection as an agent searching the attack surface at test time, and state that increasing the attacker's token budget raises ASR.

Threat modelWhite-box: the environment is visible to the attacker; the authors state this setting is expected to transfer to black-box but at higher computational cost, with systematic evaluation left to future work. The attacker places payloads in third-party data so that the victim agent executes the injection task while completing the user task.

Questions
The exploitable channels of indirect prompt injection vary with the user task, attack goal, and environment; existing benchmarks mostly treat it as a static evaluation and do not characterize how attack effectiveness scales with test-time compute.
Methods
The authors formalize indirect prompt injection as test-time search over task-relevant latent attack surfaces, and use an agentic attacker with a search framework for environment reconnaissance, strategy and history management, and adaptive evaluation using victim agent feedback.
Experiments and results
On Workspace and Retail, ASR rises as the attacker's token budget increases; the authors state GPT-5.5 is more exploitable than Opus-4.8. After removing reconnaissance and search tools, GPT-5.5's ASR on Retail plateaus after about 100K tokens.
Limitations and future work
The authors note that only white-box evaluations on two synthetic suites have been conducted so far, the model set is preliminary, a limited token budget may truncate search before convergence, and the cost of repeated victim evaluations limits the number of independent runs and the quantification of statistical variation.
Experimental setupClaude Opus 4.8、GPT-5.5 · Workspace task suite、Retail task suite · ASR@T、security score et al.
Evaluated models
Claude Opus 4.8GPT-5.5
Benchmarks
Workspace task suiteRetail task suite
Metrics
ASR@Tsecurity scoreutility score
AI summaryThe paper frames indirect prompt injection as test-time search over an attack surface jointly induced by the environment, the user task, and the injection task. On this basis, the authors construct an agentic attacker with a dedicated search framework that performs environment reconnaissance, structured reasoning over attack strategies, and adaptive evaluation using feedback from the victim agent. Across diverse heterogeneous tasks, increasing the attacker's test-time compute improves vulnerability discovery and exploitation; ablations show that explicit strategy management is important for avoiding repeated searches and sustaining gains under larger compute budgets. The authors argue that agent safety evaluation should characterize both the attacker's search process and compute budget, rather than treating attack success rate as a budget-independent property of the victim, and note that the attacker's adaptive search over the system attack surface is an important but understudied security risk in tool-calling agents.

The paper frames indirect prompt injection as test-time search over an attack surface jointly induced by the environment, the user task, and the injection task. On this basis, the authors construct an agentic attacker with a dedicated search framework that performs environment reconnaissance, structured reasoning over attack strategies, and adaptive evaluation using feedback from the victim agent. Across diverse heterogeneous tasks, increasing the attacker's test-time compute improves vulnerability discovery and exploitation; ablations show that explicit strategy management is important for avoiding repeated searches and sustaining gains under larger compute budgets. The authors argue that agent safety evaluation should characterize both the attacker's search process and compute budget, rather than treating attack success rate as a budget-independent property of the victim, and note that the attacker's adaptive search over the system attack surface is an important but understudied security risk in tool-calling agents.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Indirect prompt injection is treated as a static evaluation, and the authors reformulate it as a search problem that scales with test-time compute.

    Existing benchmarks treat indirect prompt injection as a static evaluation independent of compute budget; the authors aim to characterize how attack effectiveness varies with the attacker's test-time search and compute budget.

    • Scenario: The authors argue that LLM-based agents complete tasks through system prompts, user instructions, tool retrieval of external content, planning, and tool invocation. The model directly processes text returned from external channels and tools, lacking a formal mechanism to separate instructions from contextual data. Indirect prompt injection writes malicious instructions into third-party data, allowing external attackers to act on behalf of the user and invoke tools; the consequences the authors list include exfiltration of user data and execution of arbitrary code.
    • Existing shortcomings: The authors argue that the vulnerability is not fixed but depends on the user task, the attack objective, and the attacker's capabilities. Each user task corresponds to a benign tool-use trajectory that exposes different exploitable channels, forming a task-dependent attack surface. Existing benchmarks usually treat this as a static evaluation, ignoring task-dependent vulnerabilities from different interaction trajectories, and generally do not characterize how attack effectiveness scales with test-time compute. The authors argue that evaluations with a fixed attacker compute budget may underestimate the susceptibility of agent systems to adaptive, search-based attacks.
    • Core observation: The authors frame indirect prompt injection as a search over an attack surface jointly induced by the user task and the injection task. The attack surface remains largely latent even when the payload wording and injection vectors are known, and the authors choose to have the agent interact with the environment to implicitly identify and explore it, rather than explicitly constructing it with domain knowledge.
    • This paper proposes: The authors propose three points: (1) they claim this is the first study of indirect prompt injection through scaling test-time compute; (2) an agentic attack protocol with a structured search framework for adaptively exploring the attack space; (3) preliminary results showing that scaling attacker test-time compute improves vulnerability discovery and exploitation.
    • Threat model:
      • Objective: Place an injection payload in untrusted data so that the victim agent executes the attack objective while still completing the user's original task. Success is determined by environment state changes: security being true means the injection task is completed, utility being true means the user task is completed; the attacker is required to achieve both simultaneously.
      • Knowledge: This paper focuses on white-box, with the environment visible to the attacker. The authors state that this setting is expected to transfer to black-box, but at higher compute cost, with systematic evaluation left as future work. In the appendix, the attacker also receives gray-box knowledge of the victim agent's available tools, automatically filled in by the environment.
      • Capabilities: The attacker controls the state elements selected as placeholders for malicious content, i.e., the injection vectors; can perform environment reconnaissance, maintain strategy and history through the search framework, and invoke evaluation tools to run the victim agent in a temporary environment, obtaining its responses, tool traces, and utility and security scores.
      • Victim system: An LLM agent with tools. In the experiments, victims are Claude Opus 4.8 and GPT-5.5, both using high reasoning effort; the attacker is GLM-5.2, served via Together AI, also with high reasoning effort. The environments are two synthetic suites: Workspace (email, calendar, cloud drive) and Retail (retail marketplace assistant).
  2. What related research exists?

    The authors place this work in adaptive agent red-teaming and reframe it as studying how attack effectiveness scales with test-time compute.

    Appendix C divides related work into three groups, and the introduction also names several static benchmarks.

    Indirect prompt injection

    • Greshake et al. (2023): the authors state that indirect prompt injection occurs when malicious instructions are embedded in external content that is later retrieved and executed by an LLM application, so the attacker does not need to directly control the user prompt.
    • InjecAgent and AgentDojo: the authors state that these early benchmarks established broad vulnerabilities in tool-integrated agents and tasks over external content. Later work extends evaluation to more realistic web environments and studies detection and runtime defenses.
    • LivePI, large-scale public red-teaming competitions, StepJack: the authors state that newer benchmarks extend the threat model to near-production agent workflows, large-scale public red teaming, and multi-step injections spanning agent trajectories, and they consider indirect prompt injection to remain an ongoing risk as agents encounter more diverse untrusted environments.

    Agent red teaming

    • InjecAgent, AgentDojo, Agent Security Bench, WASP: the authors state that early benchmarks evaluate attacks on more realistic tool-use environments and tasks.
    • Adaptive search and optimization: the authors summarize later work as black-box fuzzing and MCTS-based attack generation, adaptive attacks against defenses, and automated black-box and white-box prompt optimization.
    • Methods that improve attacks from execution feedback: the authors list a series of works that refine attacks using learned or trajectory-aware attackers and execution feedback, including UDora, Learning to inject, MUZZLE, T-MAP, SkillJect.

    Adaptive prompt injection

    • Gap between static and adaptive evaluation: the authors state that recent work shows prompt injection defenses degrade markedly when the attacker adapts to the target system; one work highlights the gap between static and adaptive evaluation.
    • Stronger optimization and search: the authors state that Nasr et al. show that stronger optimization and search can bypass existing defenses.
    • AutoDojo: the authors state that it studies adaptive black-box attacks against defenses against indirect prompt injection in agents by extending AgentDojo. The authors consider these results to support evaluating prompt injection as an adaptive adversarial process rather than using fixed attack templates.

    Baselines and benchmarks

    • AgentDojo: the Workspace suite is taken from this benchmark, containing 40 user tasks and 6 injection tasks; the evaluation follows its method of determining task completion by changes in environment state, and the main metric ASR is also defined per that work as the proportion of safety cases where the attacker achieves its goal.
    • Test-time compute scaling: the introduction cites work showing that increasing test-time compute improves frontier model performance on reasoning tasks, to argue that fixed attacker budgets may underestimate susceptibility. The Retail user task generation is inspired by Prime-style environment generators.

    The authors state that this work advances the agent red-teaming direction, but frames agent red teaming as a dynamic test-time compute problem, studying how attack effectiveness and search behavior scale with the attacker's available compute budget.

  3. How does the paper address this problem?

    Using a search framework with reconnaissance, strategy management, and victim feedback evaluation, perform test-time search over task-relevant attack surfaces.

    The authors turn indirect prompt injection into test-time search over a latent attack surface, using an agentic attacker with a Search Harness to adaptively explore under different compute budgets.

    Problem setup and formalization

    • Evaluation target: Following AgentDojo, the benchmark includes an environment, available tools, and environment state. The environment defines the application domain, and the state stores data accessible to the agent; selected state elements serve as placeholders for malicious content.
    • User task: A benign request given to the victim agent as a natural language prompt. Completion is judged by a binary utility score, based on the final agent output and resulting environment state changes.
    • Injection task: The attack objective given to the attacker agent with the search framework. The attacker searches over the attack surface induced by the environment and the task. Unlike static benchmarks, the authors state that this framework allows the attacker to adapt to the victim agent and the attack surface. The injection task is also verified by environment state changes, with a binary security score indicating whether the victim agent completed the task.
    • Attack surface: Induced by the interaction of the environment and the user task; the authors state it is usually latent, even when salient dimensions such as payload wording and injection vectors are known in advance.

    Three components of the search framework

    • Explore Environment: Two types of reconnaissance tools. Environment knowledge tools provide context and domain information about the target system and task; injection vector knowledge tools describe the context and constraints of each candidate injection location. The authors state that both help the attacker judge what vulnerabilities may exist and where adversarial payloads can be placed. Full tools are in Appendix F.1.
    • Reasoning and Searching: Because the latent attack surface can be very large, the attacker must identify promising subspaces under the user task and injection task conditions. Strategy organizes proposed strategies into a hierarchical semantic structure; History records a fine-grained trace of the search process. The authors state that both support iterative identification and pruning of subspaces. Full description is in Appendix F.2.
    • Evaluation and Feedback: The Evaluate tool explicitly gives the attacker feedback from the victim agent. After the attacker selects a candidate payload and injection vector, each call instantiates that attack configuration in a temporary environment, runs the victim agent, and returns its responses, tool-use traces, utility score, and security score. The authors state that making evaluation an explicit tool allows the attacker to adaptively allocate tests based on existing evidence and current search state. Appendix F.3 has further details.

    How the attacker uses budget and feedback

    • Search axes: The appendix prompt treats each evaluate_injection as a probe, searching over payload content and phrasing, which vector carries it, which vectors the victim agent actually reads, and the order and combination across vectors. Each probe carries a strategy label and a short framing label, and results are automatically recorded in strategy_archive.
    • Near-miss typing: After a probe, a deterministic cross-strategy prompt is returned without an additional LLM call. The prompt includes tried strategies and phrasings, recent near misses, untried phrasings, and suggested next steps. Near misses fall into three categories: WRONG_ARGS (action pair, wrong arguments), ATTACK_ONLY (security true but utility false), BENIGN_FAILED (tools invoked but neither objective achieved).
    • Budget constraints: The prompt requires that when the budget is low, the attacker prioritize finding payloads likely to succeed rather than mapping the whole environment; and requires calling evaluate_injection early. The attacker must not copy sensitive values from the environment into the payload, but must let the victim agent fetch them itself.
    • Stopping condition: The attacker is required to stop only when security and utility are both true on the same payload. Security true but utility false is marked as needing further utility fixes.

    Task suites and success determination

    • Workspace: Taken from AgentDojo, 40 user tasks, 6 injection tasks. User tasks and injection tasks are paired independently, yielding 240 test pairs. Tools cover email, calendar, and cloud drive.
    • Retail: Generated by a Prime-style environment generator, 17 user tasks, 8 injection tasks, independently paired to yield 136 test pairs. Appendix E starts from seed tasks: the seed stage does not use LLMs, only normalizing trusted seeds into an initial database, callable tools, natural language instructions, gold-standard tool-call traces, and task-specific validators. Then the generator proposes candidates, which are admitted to the corpus only after import code, replay of gold-standard calls, validator checks, and a set of deterministic gates. Gates include structural validity, unique primary keys, tool use and trace length, tool-overlap diversity, unique target entities, public patterns, and the gold-standard path must read injectable public fields.
    • Metrics: The main metric is ASR, the proportion of security cases where the attacker achieves its objective. To reflect the search setting, ASR@T is reported at the attacker's total token usage T. Utility and security are both binary environment-state determinations.
  4. What experiments did the paper conduct?

    On the two synthetic suites, ASR increases as the attacker's token budget grows, and the full search framework sustains improvements more consistently than the variant without tools.

    Experimental Setup

    • Victim models: Claude Opus 4.8 and GPT-5.5, both tool-calling agents with high reasoning effort. The attacker is GLM-5.2, provided via Together AI, with high reasoning effort. Other parameters use provider defaults, accessed via official APIs.
    • Task suites: Workspace has 240 test pairs (40 user tasks × 6 injection tasks); Retail has 136 test pairs (17 user tasks × 8 injection tasks). Both are synthetic environments.
    • Metrics: ASR@T, where T is the attacker's cumulative tokens. security indicates whether the injection goal was completed by the victim agent, and utility indicates whether the user task was completed, both given as binary scores from environment state changes.
    • Ablations: No-Harness removes reconnaissance and search tools; No-Strategy removes only Strategy; Full-Harness is the complete framework. Fig. 5 uses GPT-5.5 as the victim model on Retail.
    • Budget: The main text discusses curves up to 500K tokens; Appendix I.4 discusses the 500k cap. The paper does not report the number of repetitions per curve in the main text; Limitations states that the cost of repeated victim evaluations limits the number of independent runs.
    • Evaluation: Success is determined by the environment verifier; the paper does not report additional LLM-based review or human agreement.

    Main Results

    Fig. 2 shows ASR as a function of test-time compute budget. The main text only states the following endpoints; other curve points are not given specific numbers.

    Swipe horizontally to read the table

    Victim modelSuiteBudgetASRSource
    Opus-4.8Retail500K tokens20.6%Main text for Fig. 2a
    GPT-5.5Workspace100K tokens52.1%Main text for Fig. 2b
    GPT-5.5Retail100K tokens37.5%Main text
    GPT-5.5All runs250k→500k~49.0%→~57.8%Appendix I.4
    • Authors' interpretation: The authors state that ASR increases as the token budget increases. On Retail, the two curves separate, with GPT-5.5 being more exploitable than Opus-4.8; GPT-5.5 begins to degrade noticeably around 50K tokens, and Opus-4.8 reaches an ASR of 20.6% at 500K tokens.
    • Suite differences: The authors state that on Workspace, GPT-5.5 reaches a higher ASR@T faster, at 52.1% at 100K tokens, versus 37.5% on Retail at the same budget. The authors believe Workspace offers more short-path attack opportunities because many tasks inherently require reading runtime artifacts such as to-dos and meeting notes.
    • Attack targets: The authors state that successful attacks concentrate on surfaces adjacent to the task. Fig. 3 and Fig. 4 are reasoning traces of GLM-5.2 in Retail and Workspace, used to illustrate that the attacker places malicious actions in paths the victim agent would read anyway, rather than searching arbitrary payloads.

    Search Framework Ablation

    • What was tested: On Retail with GPT-5.5 as the victim model, comparing Full-Harness, No-Harness, and No-Strategy (Fig. 5). More results are in Appendix H; the conversion text does not provide specific numbers from Appendix H.
    • Results: The authors state that No-Harness plateaus after 100K tokens. No-Strategy can use reconnaissance tools to improve understanding of the environment but lacks explicit strategy management, leading to excessive reconnaissance and repeated attack patterns.
    • Authors' interpretation: The authors state that Full-Harness promotes strategy diversification and systematic improvement across iterations, allowing attack effectiveness to scale with the available search budget; without explicit attack-surface exploration, the benefit of additional test-time compute is limited.

    Search Trajectories and Budget Truncation

    • What was tested: Appendix I uses attacker trajectories from failed and successful task pairs to examine how search shifts from exploration to exploiting near misses as the budget decreases.
    • Results: The authors state that the attacker uses triggered vectors, victim tool trajectories, and failure modes of near misses to decide which dimensions of the attack surface are still worth improving. Several failed pairs hit the 500k cap while still proposing improvements. All unsuccessful task pairs use the full 500k token budget, while the average ASR for GPT-5.5 across all runs rises from ~49.0% to ~57.8% between 250k and 500k.
    • Authors' interpretation: The authors believe that failure at the maximum budget does not necessarily indicate search convergence; the compute cap truncates search that is still improving attack hypotheses. The authors argue this supports attack effectiveness being a function of test-time compute: the budget affects both how long search runs and how compute is allocated across reconnaissance, exploration, and near-miss improvement.

    Other Ablations and Analyses

    • The main text does not provide numbers for other parameter sweeps; Appendix H is cited for more results, but this conversion text has no Appendix H values to reference.
    • The paper does not report query counts, wall-clock time, or adaptive evaluation numbers against specific defenses.
    • Negative results as written by the authors: Opus-4.8 on Retail at 500K tokens has an ASR of 20.6%, which the authors state is more robust than GPT-5.5; No-Harness no longer rises with budget after about 100K tokens.
  5. What are some points that can be further explored?

    The authors leave white-box, synthetic environments, and transfer and statistical variation under limited budgets as future work.

    Limitations and Future Directions Noted by the Authors

    • Scope of setting: In Limitations (Appendix J), the authors state that this work focuses on white-box evaluations on two synthetic task suites, and the attacker and victim model sets are preliminary. Therefore, the observed scaling trends may not directly generalize to black-box access, production environments, other agent architectures or frameworks, and other attack targets and defenses.
    • Budget and statistics: The same section states that a limited token budget may terminate search before convergence; the computational cost of repeated victim evaluations limits the number of independent runs and the ability to comprehensively quantify statistical variation.
    • Future work: The authors state that although prior work suggests attacks obtained under white-box access can transfer to black-box models, systematically evaluating this transfer, broader model coverage, real deployments, and stronger defenses remains important future work. Section 2.1 also leaves systematic black-box evaluation to future work.
    • Scope of use in social impact: Appendix B states that experiments were conducted only in controlled synthetic environments, using synthetic data and isolated tools, not targeting real users or production systems, and encourages future use of the framework for authorized security testing, responsible disclosure, and development of more robust defenses. This is the authors' statement about usage, not a limitation judgment about the method's effectiveness.

    Experimental Coverage

    • Models: The victim models tested are Claude Opus 4.8 and GPT-5.5, and the attacker is GLM-5.2, all using high reasoning effort (Sec. 3.1).
    • Data: Workspace has 240 pairs, Retail has 136 pairs; user tasks and injection tasks are independently paired (Sec. 3.1).
    • Knowledge setting: The experiments are white-box, with the environment visible to the attacker; the attacker's prompt also includes a gray-box list of victim tools (Sec. 2.1, Appendix D).
    • Ablations: Fig. 5 reports Full-Harness, No-Harness, and No-Strategy on Retail with GPT-5.5 as the victim. The paper does not report the number of independent repetitions per condition; Appendix J states that cost limits the number of independent runs and the comprehensive quantification of statistical variation.
    • Evaluation: security and utility are given as binary scores from environment state changes; the paper does not report agreement with human judgment.
  6. Summarize the main content of the paper

    Indirect prompt injection is turned into a search that scales with the attacker's token budget, and ASR rises with budget under the full framework.

    The authors reframe indirect prompt injection on tool-using agents as test-time search: the attack surface is jointly determined by the environment, the user task, and the injection task, rather than being a fixed attack independent of budget.

    • Problem: The victim agent reads text from external channels such as email, cloud drives, or marketplace records, and external parties can place instructions in this data. The authors argue that existing benchmarks mostly do static evaluation, ignoring both the different attack surfaces brought by different task trajectories and how success rates change when the attacker spends more test-time compute.
    • Method: The attacker is GLM-5.2, equipped with a search framework. Reconnaissance tools inspect the environment and candidate injection locations, Strategy and History manage strategy and avoid repeated searches, and Evaluate runs the victim agent in a temporary environment and returns tool traces, utility, and security. The goal is for a single injection to accomplish both the attack objective and the user's original task. The experiments in this paper are white-box.
    • Results: Workspace has 240 task pairs, Retail has 136. Victims are GPT-5.5 and Claude Opus 4.8. The authors state that ASR rises with the attacker's token budget. On Retail, Opus-4.8 has an ASR of 20.6% at 500K tokens; GPT-5.5 becomes more exploitable starting around 50K tokens. At 100K tokens, GPT-5.5 has an ASR of 52.1% on Workspace and 37.5% on Retail. In the appendix, GPT-5.5's average ASR across all runs goes from about 49.0% at 250k tokens to about 57.8% at 500k.
    • Framework: On Retail with GPT-5.5 as the victim, removing the reconnaissance and search tools causes ASR to plateau after about 100K tokens; removing only Strategy leads to excessive reconnaissance and repeated attack patterns. The authors state that explicit strategy management is important for avoiding redundant searches and maintaining gains at larger budgets.
    • Conclusion: The authors argue that the attacker's search process and compute budget should be reported together, rather than treating attack success as a budget-independent property of the victim system; the attacker's adaptive search over the system's attack surface is an under-explored security risk for tool-using agents. The authors also note that these trends come from preliminary white-box evaluations on two synthetic suites, and limited budgets may truncate search before convergence.
Read originalarxiv.org