Skip to content

Crossing the Retrieval Threshold: Indirect Prompt Injection Against LLM Systems in Real-World ScenariosOvercoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systems

arXiv· arXiv:2601.07072· USENIX Security 2026· Hongyan Chang, Ergute Bao, Xinjian Luo, Ting Yu·Indexed by this site · 2026-10-12· Originally publishedSelected AttacksSelectedAttention42

Quick read

Attacks

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

Black-box CEM prefix guarantees malicious text retrieval; on Enron email, GPT-4o multi-agent Fusion leak ASR is 0.80±0.07.

Threat modelBlack-box: only one malicious document is injected, the corpus content is unknown, the retriever or LLM parameters cannot be accessed, and embeddings are only available through the API. The goal is, for any natural query q and a given attack segment Dadv, to construct a prefix x such that x∥Dadv enters the top-K (K=5 in experiments) and is executed by the system.

Questions
Under natural queries, retrieval-augmented LLMs rarely retrieve unoptimized indirect prompt injections, so the attack cannot begin. The authors aim to get any attack snippet into the top-K under black-box embedding APIs and with only one document injected.
Methods
Split the injected text into a trigger snippet and an attack snippet. Use a cross-entropy method to maintain a position-wise decomposed sampling distribution over the vocabulary, and iteratively select a short prefix using only cosine similarity from the embedding API.
Experiments and results
On 11 BEIR corpora, the average Recall@5 at n=10 is 94.1%, and 0 without a prefix (Table 3). On Enron with GPT-4o, the multi-agent code execution Fusion ASR is 0.80±0.07 (Table 2). Retrieval-side defenses such as query rewriting can be bypassed adaptively.
Limitations and future work
The authors say the evaluation is limited to embedding retrieval and retrieval-stage defenses, with hybrid retrieval and reranking not evaluated; cross-architecture transfer is not guaranteed, and the algorithm is said to be adapted from CEM. Experiments cover 11 BEIR corpora, 8 embedding models, and an Enron email agent.
Experimental setupGPT-4o、GPT-4o-mini et al. · BEIR、MSMARCO et al. · Recall@5、MRR@5 et al.
Evaluated models
GPT-4oGPT-4o-minigte-modernbert-basecontriever-msmarcoQwen3-Embedding-0.6BQwen3-Embedding-4BQwen3-Embedding-8Btext-embedding-3-smallvoyage-3.5-litetext-embedding-v4 (Qwen-v4)Qwen3-0.6BQwen3-1.7BQwen3-4BQwen3-8BQwen3-11BQwen3-32BLlama3-3BLlama3-3B-InsLlama3-8BLlama3-8B-Ins
Benchmarks
BEIRMSMARCOTREC-COVIDNFCorpusNatural QuestionsHotpotQAFiQA-2018ArguAnaDBPediaSCIDOCSFEVERSciFactEnronMS COCO
Metrics
Recall@5MRR@5nDCG@5ASRSIM
AI summaryand selection rationaleThe paper proposes splitting injected text into a trigger fragment that guarantees retrieval and an attack fragment that carries the attack goal, constructing the trigger fragment with a black-box CEM algorithm that requires only an embedding model API. On OpenAI embedding models, each target query costs as little as $0.21, achieving near-100% retrieval rates across 11 retrieval benchmarks and 8 embedding models. The authors claim this is the first indirect prompt injection attack with end-to-end validation under natural queries and real corpora: a single poisoned email can make GPT-4o leak SSH keys in a multi-agent workflow, with a success rate exceeding 80%. Evaluation of three defenses—query rewriting, perplexity filtering, and token masking—shows that none is sufficient to prevent malicious text from being retrieved.

The paper proposes splitting injected text into a trigger fragment that guarantees retrieval and an attack fragment that carries the attack goal, constructing the trigger fragment with a black-box CEM algorithm that requires only an embedding model API. On OpenAI embedding models, each target query costs as little as $0.21, achieving near-100% retrieval rates across 11 retrieval benchmarks and 8 embedding models. The authors claim this is the first indirect prompt injection attack with end-to-end validation under natural queries and real corpora: a single poisoned email can make GPT-4o leak SSH keys in a multi-agent workflow, with a success rate exceeding 80%. Evaluation of three defenses—query rewriting, perplexity filtering, and token masking—shows that none is sufficient to prevent malicious text from being retrieved.

Why it was selectedThe paper locates the bottleneck of indirect prompt injection in the retrieval stage and provides a method for constructing trigger fragments that requires only a black-box API, which can be used to evaluate retrieval-surface risks in RAG and agent systems.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Under natural queries, malicious text cannot enter retrieval results, so indirect prompt injection cannot begin.

    Under natural queries, malicious instructions in the corpus often do not enter the retrieval results, so indirect prompt injection cannot begin.

    • Scenario: A retrieval-augmented system embeds the query, retrieves documents from an external corpus, and then has an LLM answer or act. The authors state that hidden instructions after retrieval can alter behavior without the user seeing them; they also state that prompt injection is listed in the top 10 LLM application risks, and there have been poisoning email leakage incidents.
    • Existing limitations: The authors state that prior work mostly assumes the malicious text is already in the context, e.g., placing poisoned text in the "latest email" and having the user mention it, having only one malicious text in the corpus, or requiring the query to contain a white-box trigger token. Unoptimized text is never retrieved on BEIR natural queries (Figure 2).
    • Core assumption: The injected text is split into an attack snippet Dadv and a trigger snippet x. The former encodes an arbitrary attack goal; the latter is a short token sequence serving only retrieval. The authors believe the bottleneck is constructing x so that any Dadv is retrieved.
    • Proposed method: A black-box algorithm, CEM Attack, that only calls the embedding API to generate compact trigger snippets, with end-to-end experiments on RAG and single/multi-agent systems. The authors state that, to their knowledge, this answers whether IPI can succeed under a real retrieval pipeline.
    • Threat model:
      • Goal: Given any natural query q and an attacker-specified Dadv, construct a prefix x so that x∥Dadv enters the top-K, causing the system to execute the goal described by Dadv.
      • Knowledge: black-box. The content of corpus D is unknown; the retriever or LLM parameters are inaccessible; only embedding vectors can be obtained through standard APIs.
      • Capability: Only one malicious item is injected. The authors state this simulates a covert attack and applies to sources writable by unverified parties. How Dadv is written is not studied.
      • Victim system: A retrieval-augmented LLM operating on query-retrieval-action, with experiments covering RAG and agents that can call tools. Similarity uses cosine similarity, and K=5 in experiments.
  2. What related research exists?

    Related work mostly assumes malicious text is already in context; the main black-box retrieval baseline is Query+.

    Indirect Prompt Injection

    • In-context evaluation: A class of setups where a fixed tool always returns a malicious item, or lets the user name the "latest email," or uses white-box access to the retriever to optimize trigger tokens in the query. The authors say these designs look at what happens after retrieval, blurring the distinction between direct and indirect injection.
    • Email heuristic: Worm prepends a benign company introduction to the poisoned email to boost retrieval. The authors say that under their setup, this heuristic's retrieval rate is effectively zero.
    • Backdoored retriever: Other work implants a backdoor into the retriever and then fine-tunes it. The paper groups this with the above setups as proof-of-concept designs and gives no numerical comparison with this paper.

    RAG Poisoning

    • Knowledge contamination: Injecting adversarial documents into the knowledge base to bias answers toward misinformation, refusal, predetermined text, answering a different question and thereby causing leakage, or outputting a specific viewpoint. The authors say these works address knowledge poisoning in single-LLM RAG, which is narrower than IPI that can also hijack tools, spread worms, or trigger code execution.
    • Combined with repetition strategies: The authors say that combining strategies like repeated queries with IPI yields low end-to-end ASR; when used for RAG poisoning, it is no better than directly copying the poisoned text.

    Adversarial Retrieval Optimization

    • Ranking only: Another line of work constructs malicious text that ranks high for a specific query, without considering the end-to-end objective of IPI.
    • Black-box and white-box: Query+ prepends the query to the malicious text. The authors say it is reported as the strongest black-box heuristic but only modestly improves similarity. HotFlip and gradient-based methods require embedding parameters and do not apply to API-only deployments.

    Defenses After Entering Context

    • Segment-level methods: Several works perform detection or mitigation after the attack segment has already entered the context. The authors say that since the prefix optimization in this paper can lift out any suffix, suffix-level defenses are out of scope for this study.

    Baselines and benchmarks: Retrieval comparisons use Vanilla (empty prefix) and Query+; the agent also has Ideal, which assumes the attack segment is always retrieved. Corpora are 11 test sets from BEIR, Enron emails, and NQ, MS-MARCO, and HotpotQA for knowledge poisoning.

    The authors position this paper at the retrieval bottleneck: using black-box optimization to handle whether content is retrieved under natural queries, then examining downstream effects in full RAG and agent pipelines.

  3. How does the paper address this problem?

    Using CEM to optimize a short trigger prefix on a black-box embedding API to bring any attack segment into the top-K.

    CEM Attack does not rewrite the attack segment; it only optimizes a short trigger prefix before it to increase the embedding cosine similarity between the concatenated text and the target query, thereby squeezing into the top-K.

    Problem Setup

    • Pipeline: Each item in corpus D is a token sequence. Embedding model E maps sequences of length at most n* to d dimensions; the paper gives contriever-msmarco as an example with a maximum of 512 tokens. After query embedding, the top-K is taken by cosine similarity, and the base model then answers or calls tools.
    • Decomposition: The malicious item is written as x∥Dadv. x only increases the retrieval rate; Dadv encodes the instructions to be executed once in context and is given by the attacker.
    • Retrieval condition: x∥Dadv entering the top-K is equivalent to f(x) being higher than the similarity of all but at most K competitors in the corpus. Experiments use K=5; when K=1, the right-hand side is the maximum similarity in the corpus.
    • Approximate objective: The adversary cannot see the corpus in advance, so the threshold is unknown. The authors say that finding x satisfying the inequality is NP-hard (Appendix D.1). They therefore instead search for an ε-optimal prefix in the vocabulary space of length n. The authors say that increasing the token budget n raises the chance of retrieval.

    The core score is the cosine similarity between the query embedding and the concatenated text embedding: f(x)=sim(E(q),E(x∥ Dadv))

    CEM Prefix Search

    • Distribution: Sequences of length n use a fully factorized distribution, sampling each position independently, represented by an n-by-vocabulary-size matrix, avoiding storing the joint distribution as the vocabulary size to the power of n. The initial distribution is uniform.
    • Four steps per round: Sample N sequences, score with f, take the top λ proportion as the elite set, then compute token frequencies per position in the elite, and mix with the old distribution using smoothing coefficient α. Total accesses satisfy NT not exceeding budget B.
    • Output: After T rounds, return the highest-scoring sequence as the trigger prefix.
    • Theory: If f can be written as a sum of per-position scores, Theorem 1 states that when T is O(log|V|) and per-round samples are O(log 1/δ), it returns an ε-optimal solution with probability at least 1-δ. Black-box accesses are O(log|V| log 1/δ), lower than greedy's n|V| and brute force's |V| to the power of n. The authors say that sentence embedding pooling makes results less sensitive to word order, so they adopt this independent linear structure, and say it can explain some experimental phenomena.

    Default Parameters and Variants

    • Default: n=10, 5000 samples per round, T=30, λ=0.2, α=0.55. Under default settings, embedding accesses are at most 150000. The implementation is based on BEIR and FAISS, and experiments run on H100.
    • Prefix variants: The same Dadv with an empty prefix (Vanilla), the original query (Query+), or the CEM result. The agent also has Fusion, which concatenates the CEM prefix, the user query, and the attack segment.
    • Parts not in the optimization: The wording of the attack segment follows the direct prompt injection literature. Appendix A.3 gives the user prompt and attack segment for the email scenario; its syntactic constraints are not restated here.

    Success Criteria

    • Retrieval: Whether a single malicious item appears in the 5 results, recorded as Recall@5, then averaged over queries. The appendix also uses MRR@5 and nDCG@5, defined in Appendix A.1.1.
    • RAG: ASR is the proportion of queries where the clean corpus does not output the target phrase and the poisoned corpus does; cases where the clean system already outputs the phrase are excluded. The attack segment used in retrieval experiments requires the model to return only the predetermined word Yes.
    • Agent: Per task, records whether the specified answer is given, whether the email contains a phishing link, whether it carries self-replication instructions, whether it is sent to all contacts, and whether a Python script that exfiltrates a secret key is executed. The single agent is AutoGen with four MCP tools covering email retrieval, sending, contacts, and Python execution; the multi-agent is Magentic-One, where an Orchestrator assigns tasks to FileSurfer, Coder, or Computer Terminal, plus a retriever with three email tools.
  4. What experiments did the paper conduct?

    Average Recall@5 across 11 BEIR corpora at n=10 is 94.1%; GPT-4o multi-agent leakage ASR is 0.80±0.07.

    Experimental Setup

    • Embedding models: Default gte-modernbert-base (ModernBERT, 139M, 768-dim). Also text-embedding-3-small, voyage-3.5-lite, text-embedding-v4 (referred to as Qwen-v4 in the paper), contriever-msmarco (BERT-Base, 110M, 768-dim), and Qwen3-Embedding-0.6B/4B/8B (output dims 1024/2560/4096).
    • Generation models: RAG Figure 9 includes Qwen3-0.6B, 1.7B, 4B, 8B, 11B, 32B, Llama3-3B, Llama3-3B-Ins, Llama3-8B, Llama3-8B-Ins, Vicuna-7B, Vicuna-13B. The text says Qwen3 is 0.8B–32B, inconsistent with the figure's 0.6B; the figure is authoritative here. Knowledge poisoning uses LLaMA-2-7B. Agent backbones are GPT-4o and GPT-4o-mini. FAQ generated by Claude Sonnet 4. Appendix image retrieval uses OpenCLIP's ViT-B-32. Perplexity uses GPT-2, query rewriting uses chatgpt_paraphraser_on_T5_base.
    • Data: BEIR 11 test sets, 100 queries sampled per set, 1 malicious item injected per query. Table 1 gives scale, e.g., MSMARCO 8.8M documents, average query length 6.0 words, ArguAna average query length 193.0 words, NFCorpus 0.036M documents. Enron takes one user with at least 50 sent and received emails each, 10 FAQs. MS COCO has 25,000 candidate captions, 20 query images.
    • Baselines: Vanilla and Query+; agents also have Ideal. The authors cite prior work that Query+ performs similarly to white-box gradient attacks, and white-box requires embedding parameters, so this paper does not run white-box attacks.
    • Metrics and repetitions: Main retrieval metric Recall@5. ASR for RAG and agents is determined by task rules; the paper does not use an LLM judge nor report agreement with human judgment. RAG and agents each use 5 random seeds. The ± in Table 3 comes from different random seeds for generated prefixes; the paper does not state the number of seeds.
    • Defenses: Query rewriting, perplexity filtering, token masking, all with adaptive or control settings (Section 6, Appendix B).

    Main Results

    Retrieval results with default embedding, 1 malicious document per query, prefix n=10 (per Table 3).

    Swipe horizontally to read the table

    DatasetRecall@5MRR@5nDCG@5
    MSMARCO74.0±13.6%0.55±0.100.60±0.10
    ArguAna77.5±8.0%0.40±0.030.49±0.04
    TREC-COVID87.6±11.8%0.69±0.120.74±0.12
    FiQA-201897.8±3.9%0.87±0.010.90±0.02
    NQ98.6±2.8%0.83±0.030.87±0.02
    FEVER99.8±0.4%0.63±0.030.72±0.02
    HotpotQA100.0±0.0%0.90±0.040.93±0.03
    11-set average94.1%0.780.82

    Omitted NFCorpus, DBPedia, SCIDOCS, SciFact, whose Recall@5 are all 100.0±0.0%, MRR@5 are 0.97±0.02, 0.97±0.03, 0.88±0.02, 0.92±0.01 respectively.

    • In the same table, average Recall@5 for n=3 and n=5 are 28.4% and 63.0%. Appendix A.1.1 text says n=10 average Recall@5 is 95.6%, MRR@5 0.79, inconsistent with Table 3's 94.1% and 0.78; the table is authoritative here. Abstract says near-100%, but MSMARCO and ArguAna in the table are below that summary.
    • Vanilla is not retrieved on any dataset. The authors claim CEM outperforms Query+ at the same prefix length; on ArguAna, Query+ recall is only about 20%, and gains from longer tokens are smaller than CEM.
    • The authors claim no observable correlation between corpus size and attack performance. The authors define corpus competition using the similarity of the 5th clean document: NFCorpus about 0.64 with no failures; on MSMARCO failed queries, this value can reach 0.82, higher than the successful query average of 0.75 (Figure 3).

    Embedding Models, Transfer, and Position

    • 8 embedding models on FiQA: Figure 4 bar-top numbers from left to right are 100, 100, 100, 100, 100, 100, 90, 100. The x-axis order in the figure is discernible as GTE, Contriever, Q3-0.6B, Q3-4B, Q3-8B, Voyage, OpenAI, Qwen-v4, so 90% corresponds to OpenAI. The authors claim larger, newer, or proprietary embedding models do not provide resistance.
    • Cross-model: Figure 5, Qwen family transfers internally; prefixes crafted with Qwen3-Embedding-0.6B achieve 10% retrieval on OpenAI. Prefixes crafted with OpenAI embeddings have average recall of 74% across targets, 7 of 8 exceed 60%, except Contriever. The authors believe successful IPI may require knowing or guessing the target embedding architecture.
    • Position, shuffling, segment swapping: After optimizing at position 0 and inserting elsewhere, most models have cross-position Recall@5 above 50%. OpenAI drops from 80% at front to near 0% at position 20; optimizing directly at the end gives 60%. After random shuffling, averaged over 10 times, GTE and Q3-4B exceed 90%, Q3-8B, Voyage, Qwen-v4 exceed 80%, OpenAI is 6% (Figure 7). When swapping attack segments, the authors claim similarity rises from about -0.1 to a maximum of 0.76 (Figure 8).

    RAG and Agent End-to-End

    • Fixed answers: Figure 9 covers 11 LLMs and 11 datasets. The authors claim a single malicious document often pushes ASR close to 1; without prefix, ASR is 0. MS-MARCO average ASR is lower, consistent with its lower Recall@5. The authors claim instruction-tuned models follow malicious instructions more, and larger models do not provide protection. In the plain text, Figure 9's grid column alignment is unreliable; beyond the trends in the text, do not copy numbers cell by cell.
    • Knowledge poisoning: Table 4, LLaMA-2-7B, NQ, 2-token trigger ASR is 0.58, R@5 is 1.0; Baseline is ASR 0.58, R@5 0.99. 1-token ASR 0.50, R@5 0.86. On HotpotQA, incorrect knowledge without trigger segment already has R@5 1.0, ASR 0.66, higher than Baseline's 0.64. Without attack, the proportion of correct answers across the three datasets is 0.62, 0.77, 0.67 respectively.
    • Enron agent: Table 2, 10 FAQs, 5 repetitions. On GPT-4o, CEM's R@5 is 1 in listed tasks; Query+ on phishing worm task has R@5 0.56, SIM 0.70. Multi-agent code execution: GPT-4o Ideal 0.58±0.18, CEM 0.72±0.16, Fusion 0.80±0.07; same task single-agent CEM/Fusion only 0.04±0.05 and 0.02±0.04. Abstract says over 80%, and the authors claim nearly 40 times single-agent. Exception is GPT-4o-mini multi-agent code execution: Query+ 0.56±0.21, CEM 0.42±0.08, Fusion 0.36±0.09. On targeted answers, retrieval success does not equal execution: GPT-4o CEM ASR 0.02±0.04, Fusion 0.16±0.11. GPT-4o worm self-replication ASR, CEM 0.00±0.00, Fusion 0.18±0.13, while phishing links are 0.66±0.17 and 0.84±0.11 respectively. The authors claim GPT-4o is more conservative with clearly harmful strings but more willing to complete routine emails, hence higher tool misuse; GPT-4o-mini is more willing to execute injected segments.

    Defense Evaluation

    • Query rewriting: Figure 11, most datasets Recall@5 drops less than 10%, NQ, FEVER, FiQA, DBPedia, SciDocs, SciFact, NFCorpus, HotpotQA still above 90%; TREC-COVID and MSMARCO drop to about 44% and 67.9% respectively. After joint optimization against multiple rewrites, SciDocs goes from 95.8% to 97.6%, MSMARCO to 79.1%, higher than the no-defense baseline of 69.8% in that experiment. The authors claim rewriting provides almost no protection. This 69.8% is not the same cell as Table 3's 74.0±13.6%.
    • Perplexity: On FiQA, clean documents average 46.6, malicious text at 1x is 154.1; in the figure, 2x, 3x, 4x are 14.4, 6.0, 3.9 respectively (Figure 12). The authors claim after repetition it falls below clean documents, filtering fails.
    • Token masking: FiQA, n=10, randomly masking 10 tokens still Recall@5 is 100%. Precisely masking trigger tokens reduces recall. The authors claim trigger tokens can be placed anywhere; on FiQA the most common is business (Figure 14).

    Other Ablations and Analysis

    • Figure 10 (MSMARCO, n=10): Increasing iteration count T or samples per round improves similarity; smaller elite ratio λ is generally better, but gains weaken after too small; smoothing coefficient α is relatively stable. The text does not give values for each point.
    • Cost: voyage-3.5-lite or text-embedding-3-small is $0.21 per target query, text-embedding-v4 up to $0.76. Contriever 1.6 minutes, GTE 2.3 minutes, Qwen3-0.6B 7.6 minutes (single H100), time mainly in embedding computation.
    • MS COCO image-to-text (Table 5, ViT-B-32, 20 images): n=2 Recall@1/5/10 is 10%/40%/40%; n=3 is 60%/100%/100%; n=5 all three are 100%.
    • Single-agent code execution Ideal: GPT-4o 0.02±0.04, GPT-4o-mini 0.04±0.05; mini's end-to-end CEM is 0.26±0.09. The authors claim "already in context" evaluations sometimes underestimate, sometimes overestimate risk.
    • Tool misuse: GPT-4o Ideal on Sent and Phishing both 1±0.00; GPT-4o-mini Ideal 0.47±0.19 and 0.44±0.18, Fusion 0.84±0.05. Fusion's tool misuse R@5 on GPT-4o is 0.98, not 1.
    • Targeted answers on GPT-4o-mini, Ideal, Query+, CEM ASR all 0.00±0.00, Fusion 0.04±0.05.
  5. What are some points that can be further explored?

    The authors say hybrid retrieval and reranking were not evaluated, and cross-architecture transfer is not guaranteed.

    Limitations and Future Directions Noted by the Authors

    • Evaluation scope: Section 8 states that the evaluation is strictly limited to LLM agents' embedding retrieval systems, and defense evaluation is also limited to the retrieval stage.
    • Hybrid retrieval and reranking: Section 8 states that hybrid pipelines and reranking were not evaluated, that these mechanisms could potentially mitigate the attack, and acknowledges this gap.
    • Cross-architecture transfer: Sections 8 and 4.2 state that transferability is not guaranteed when the reference model and target embedding architecture differ; further narrowing this gap is left as future work.
    • Algorithm source: Section 8 states that Algorithm 1 builds on existing cross-entropy methods, with the contribution being adaptation to IPI, and does not claim the algorithm's originality as its own.
    • Scenario: Section 5.2 states that the attack can generalize to different settings; this paper focuses on email for in-depth analysis, with other settings left as future directions.

    Experimental Coverage

    • Retrieval experiments cover 11 test sets from BEIR, with 100 queries per set and 1 malicious item per query, across 8 embedding models; defaults are K=5, n=10, T=30, 5000 samples per round (Section 4, Table 1, Table 3).
    • End-to-end coverage includes 11 LLMs and 11 datasets in Figure 9 (5 seeds), plus AutoGen single-agent and Magentic-One multi-agent on Enron with GPT-4o and GPT-4o-mini as base models, 10 FAQs, 5 runs per experiment (Section 5, Table 2).
    • Defense experiments include query rewriting, perplexity filtering, and token masking, with adaptive variants; the appendix also covers MS COCO image-to-text retrieval (Section 6, Appendix B, Appendix C).
    • The paper states that hybrid pipelines and reranking were not evaluated (Section 8). White-box gradient attacks were not run; the authors' stated reason is that they require embedding parameters, and Query+ performed similarly in prior work.
    • Trigger prefixes are obtained by CEM directly querying the embedding API; the paper does not separately report the generative model used for attacks. Success is determined by retrieval ranking or task rules; the paper does not report agreement with human judgment, nor the number of random seeds for retrieval experiments.
  6. Summarize the main content of the paper

    Retrieval is the bottleneck for IPI; a black-box short prefix can cause malicious text to be retrieved under natural queries and drive downstream behavior.

    The authors address indirect prompt injection in retrieval-augmented LLMs, treating whether malicious text can be retrieved under natural queries as the condition for the attack to begin. The authors say that, to their knowledge, this is the first end-to-end result showing IPI can succeed under a real retrieval pipeline.

    The attacker is black-box: only one document is injected, the corpus content is unknown, and only the embedding API can be called. The malicious text is split into an attack segment carrying the goal and a trigger segment responsible only for increasing cosine similarity. The trigger segment is optimized with a cross-entropy method that updates the sampling distribution per position, with defaults of 10 tokens, 30 rounds, and 5000 samples per round.

    • On 11 BEIR test sets with the default gte-modernbert-base, the average Recall@5 at n=10 is 94.1%; MSMARCO is 74.0±13.6%, ArguAna is 77.5±8.0%, and several other datasets are 100.0%. Without a prefix, retrieval is 0 (Table 3, Figure 2). The abstract's near-100% coexists with the lower values in the table.
    • On FiQA, 7 of the 8 bar tops in Figure 4 are 100% and 1 is 90%; by axis order, the 90% corresponds to text-embedding-3-small. Prefixes built with OpenAI embeddings give an average recall of 74% across targets (Figure 5).
    • On Enron emails with GPT-4o and multi-agent code execution, Fusion's ASR is 0.80±0.07 and CEM's is 0.72±0.16; for the same task with a single agent, Fusion is 0.02±0.04 (Table 2). The abstract says over 80%. Retrieval success does not mean every downstream item executes: the ASR for targeted answers and GPT-4o's worm replication remains low.
    • Query rewriting, perplexity filtering, and random token masking cannot prevent retrieval after joint optimization, repeated text, or longer trigger segments. The cost for OpenAI and Voyage embeddings is $0.21 per target query.

    The authors conclude that retrieval is the decisive bottleneck; under their decomposition, a black-box algorithm can construct trigger prefixes that bring attack goals into RAG and agent pipelines that include retrieval, so both retrieval and system-level components need to be examined. The authors also state that hybrid retrieval, reranking, and cross-architecture transfer have not been addressed, and the algorithm itself is adapted from existing cross-entropy methods.

Related papers

Show 3 more papers
Read originalUSENIX Security 2026