Skip to content

Benchmarking Knowledge Extraction Attacks and Defenses in RAGBenchmarking Knowledge-Extraction Attack and Defense on Retrieval-Augmented Generation

arXiv· arXiv:2602.09319· ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2· Zhisheng Qi, Utkarsh Sahu, Li Ma, Haoyu Han, Ryan Rossi, Franck Dernoncourt, Mahantesh Halappanavar, Nesreen Ahmed, Yushun Dong, Yue Zhao, Yu Zhang, Yu Wang·Indexed by this site · 2026-10-12· Originally publishedEvaluation

Quick read

Evaluation and benchmarks

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

The authors present a benchmark for RAG knowledge extraction attacks and defenses, stating that effective extraction requires jointly optimizing retrieval and generation, and that no single defense provides complete protection.

Questions
RAG is used in healthcare, finance, and agent memory, but malicious queries can extract sensitive content from knowledge bases. Existing attacks and defenses have inconsistent data, embedding models, generators, and metrics, making horizontal comparison difficult.
Methods
The authors split attack queries into INFORMATION that guides retrieval and COMMAND that prompts reproduction, and under a unified protocol compare six attacks, defenses at each stage from input to generation, multiple retrievers and generators, and instance, chunk, and graph triplet indices.
Experiments and results
The authors state that DGEA's retrieval extraction is higher than IKEA, explicit reproduction instructions increase generation-side leakage, and Query Block struggles to block IKEA. In the four-dataset average EER, DGEA is 60.9; on Med_Vietnamese, Summary reduces R-TK's EEG_LS to 4.17.
Limitations and future work
The authors set future work as multi-layer diversity optimization, multi-stage defense coordination, and extension to agentic RAG. The appendix states that SAGE is only evaluated on HarryPotter and Pokémon. The paper does not report the Top-K, query budget, or judge model name for the main experiments.
Experimental setupGPT-4o、GPT-4o-mini et al. · HealthCareMagic、Enron et al. · EER、EEG_SS et al.
Evaluated models
GPT-4oGPT-4o-miniLlama3-8B-InstructQwen2.5-7B-Instructall-MiniLM-L6-v2GTE-base-768BGE-large-en-v1.5multilingual-MiniLM
Benchmarks
HealthCareMagicEnronHarryPotterPokémonMed_ChineseMed_Vietnamese
Metrics
EEREEG_SSEEG_LSEE_SSEE_LSASREERtokenRecall
AI summaryThe paper proposes what the authors call the first systematic benchmark for knowledge extraction attacks against RAG systems, covering multiple attack and defense strategies, representative retrieval embedding models, open- and closed-source generators, and graph-based and non-graph-based indexing methods. The benchmark is evaluated across multiple datasets and languages under a unified experimental framework and standardized protocol, aiming to make attack and defense results across different RAG configurations reproducible and comparable. The study notes that knowledge extraction attacks can recover sensitive content in the knowledge base through maliciously crafted queries, posing intellectual property and privacy risks, while prior work has been fragmented across retrieval embeddings, generation models, and evaluation metrics.

The paper proposes what the authors call the first systematic benchmark for knowledge extraction attacks against RAG systems, covering multiple attack and defense strategies, representative retrieval embedding models, open- and closed-source generators, and graph-based and non-graph-based indexing methods. The benchmark is evaluated across multiple datasets and languages under a unified experimental framework and standardized protocol, aiming to make attack and defense results across different RAG configurations reproducible and comparable. The study notes that knowledge extraction attacks can recover sensitive content in the knowledge base through maliciously crafted queries, posing intellectual property and privacy risks, while prior work has been fragmented across retrieval embeddings, generation models, and evaluation metrics.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that existing RAG knowledge extraction attack and defense settings are fragmented, so they provide a unified benchmark.

    RAG knowledge bases can be extracted for sensitive content via malicious queries, but existing attack and defense evaluation settings are inconsistent.

    • Scenario: The authors state that RAG has been used in enterprise chatbots, medical assistants, and agent memory management. Knowledge bases become an extraction channel beyond parameters and training data; successful extraction causes privacy leakage and intellectual property infringement.
    • Existing shortcomings: The authors state that existing experiments are inconsistent in dataset versions, retrieval embeddings, generators, knowledge base construction, attacker and defender capability assumptions, and metrics (Table 1), making comparison difficult.
    • Core setup: Queries consist of INFORMATION that guides retrieval and COMMAND that prompts the generator to reproduce. The authors state that stealth matters only when defenses are present, so they do not list it as a separate attack design dimension.
    • This paper's approach: The authors state they provide the first systematic benchmark for RAG knowledge extraction attacks and defenses, covering random to adaptive attacks, multi-stage defenses, open-source and closed-source generators, graph and non-graph indexes, and evaluating with a unified protocol on multilingual data. The authors state they also release a reproducible pipeline.
    • Threat model:
      • Goal: Increase the amount of extracted knowledge and maintain stealth when defenses are present; cover the target subset D*, while suppressing irrelevant leakage to the complement.
      • Knowledge: The paper calls the diagonal configuration where the attacker and retriever use the same embedding model white-box, and cross-embedding configurations black-box.
      • Capabilities: The attacker can use the query–response loop to submit T rounds of queries continuously and accumulate content. T=1 is single-round, D* equal to D is non-targeted extraction.
      • Victim system: The retriever fetches instances from the external knowledge base based on the query, and the generator answers by combining the query and retrieved content.
  2. What related research exists?

    The paper situates itself in the RAG security and extraction attack literature, and uses Table 1 to compare with existing experimental setups.

    The paper's related discussion focuses on three categories: RAG applications, system security, and extraction attacks, and uses Table 1 to compare existing experimental settings.

    RAG and Applications

    • Retrieval-augmented generation: Lewis et al. (2020) and subsequent work use external knowledge to support downstream generation. The authors state that RAG can reduce hallucination, support knowledge updates, domain specialization, and personalization.
    • Agent memory: The authors state that RAG has become a memory component for agents to retrieve, update, and reason over external knowledge in multi-step decision-making.
    • High-risk deployments: The paper lists medical decision-making, cybersecurity, critical infrastructure, finance, and scientific discovery.

    RAG Security

    • Knowledge base poisoning: Injecting malicious content into the corpus to manipulate LLM agent behavior.
    • Memory profiling and surveillance: User profiling and surveillance arising from persistent memory.
    • Hardware fault injection: Local faults affecting end-to-end processes through multi-turn interactions. The paper lists user-side knowledge extraction as a fourth category and declares that this paper only addresses this category.

    Extraction Attacks

    • Model and data extraction: Model extraction distills model behavior; data extraction reconstructs training data. Examples named by the paper include Liang et al. (2024), Carlini et al. (2021).
    • RAG knowledge extraction: Zeng et al. (2024), Cohen et al. (2024), Jiang et al. (2025), Wang et al. (2025) use adversarial queries to extract sensitive information from retrieved content. The authors state that these evaluations are scattered across non-standardized settings, hindering fair comparison.

    Baselines and Datasets

    • Baseline methods: RandomText (R-TT), RandomToken (R-TK), RandomEmb (R-EB), DGEA, CopyBreak, IKEA. Except for IKEA, they use the same COMMAND to isolate the effect of INFORMATION.
    • Existing settings: Table 1 summarizes configurations from previous papers themselves, not results rerun in this paper. Data includes Enron, different versions of HealthCareMagic, HarryPotter, and Pokémon; generators, retrievers, Top-K, and metric formulations are also inconsistent.

    The authors position this paper as: a systematic comparison of extraction attacks and defenses under unified threat assumptions, metrics, and protocols.

  3. How does the paper address this problem?

    The benchmark splits queries into INFORMATION and COMMAND, and uniformly compares attacks, defenses, and evaluation metrics.

    The authors bring architecture, query construction, staged defenses, and decomposed metrics into the same design space. Attacks do not jointly optimize retrieval and generation but follow the decoupled implementations of existing work.

    Problem Setting

    • Pipeline: Knowledge base D contains several instances. At round t, the query goes through the retriever to get R_t, which is then concatenated with the query into a prompt, and the generator outputs A_t.
    • Query Structure: Q_t is the concatenation of INFORMATION I_t and COMMAND C. The former pushes retrieval toward target content, and the latter prompts the generator to reproduce the retrieved content.
    • Objective: For target subset D*, maximize answer coverage and penalize coverage of the complement. The paper writes I∗,C∗=argmaxϕ(∪t=1TAt,D∗)−λϕ(∪t=1TAt,D∖ D∗). φ is the coverage function, λ is the trade-off coefficient; the paper does not give λ.
    • Scope: T=1 is single-round, D* equal to D is non-targeted. Knowledge base construction supports Original instances, fixed-length Chunking, and Graph Triplet.

    Attack Sides

    • Retrieval side: Optimize I so that retrieved content falls more in D*. Token-level includes R-TK and DGEA; sentence-level includes R-TT, CopyBreak, and IKEA.
    • Embedding optimization: R-EB samples target embeddings from an external corpus disjoint from the target library (e.g., WikiText), then greedily replaces tokens to increase cosine similarity. DGEA selects target embeddings far from already extracted snippets and does the same greedy alignment.
    • Language-driven: CopyBreak alternates between distant exploration and local rewriting around already extracted snippets, with frequency denoted N; the paper does not give N. IKEA samples domain anchors and adjusts weights based on answer success, making queries look like ordinary information seeking.
    • Generation side: Except for IKEA, they share the same COMMAND to compare INFORMATION. The benchmark supports various instructions from direct reproduction to role and format constraints. Appendix A.1 gives construction details for INFORMATION.

    Four Main Pipeline Defenses

    • Threshold: Adds a minimum similarity on top of Top-K to filter out low-relevance candidates. The authors state that an overly strict threshold may exclude moderately relevant knowledge, creating a safety-utility trade-off.
    • System Block: Injects a system prompt at generation time requiring avoidance of raw private information in retrieved documents, leaning toward refusal.
    • Summary: Requires summarizing the retrieved content, and the summary only needs to be sufficient to answer the question. The authors state that when the query and retrieved content are almost unrelated, the generator gives an empty summary.
    • Query Block: Uses a zero-shot LLM intent classifier to give YES or NO for the query; if judged malicious, no retrieval or generation. The authors state it relies on malicious intent being visible in the query text. The classifier name is not specified in the paper.

    Evaluation Protocol

    • Decomposition: The protocol splits extraction into retrieval, generation, and joint layers to avoid mixing retrieval diversity with generation reproduction.
    • EER: The size of the intersection of the target set and all retrieval results, divided by the sum of retrieved items per round, i.e., EER=ϕ(∪t=1TRt,D∗)(∑t=1T|Rt|)−1.
    • EEG and EE: EEG compares answers with paired retrieved content. Lexical EEG_LS uses ROUGE-L, semantic EEG_SS uses embedding cosine similarity. Joint EE only counts retrieved content judged as reproduced and belonging to D*; the threshold θ value is not given in the paper.
    • ASR and Alignment: ASR is the proportion of successful queries. It must satisfy both: the unnamed LLM-as-a-Judge labels the output as informative, and that round's retrieval intersects D*. When there is a one-to-one correspondence, align by item; when there is no COMMAND, concatenate retrieved content first. Refusal alignment scores are 0. Cross-index comparison additionally uses token-normalized EERtoken, details in Appendices A.2, A.3.
  4. What experiments did the paper conduct?

    The main text does not give the bar heights for Figure 3; verifiable numbers come from Figure 4, Table 2, and Table 3.

    Experimental Setup

    • Attacks and Defenses: The six attacks are R-TK, R-EB, R-TT, DGEA, IKEA, CopyBreak. The main pipeline defenses are Query Block, Threshold, System Block, Summary. Appendix A.4 additionally evaluates SAGE and VAGUE-GATE.
    • Data: The four English sets are HealthCareMagic, Enron, HarryPotter, Pokémon. The instance counts listed in Table 4 are 112K, 517K, 26K, 1.3K. Cross-lingual sets are Med_Chinese and Med_Vietnamese. Figure 3 uses knowledge instance indices and averages over the four datasets.
    • Retrievers: all-MiniLM-L6-v2, GTE-base-768, BGE-large-en-v1.5, denoted in the text as Small, Medium, Large. Cross-lingual experiments replace with multilingual-MiniLM, other settings unchanged.
    • Generators: Llama3-8B-Instruct, Qwen2.5-7B-Instruct, GPT-4o-mini, GPT-4o. COMMAND variants are SMPL, MED, JAILBREAK, CPLX.
    • Judging: ASR uses LLM-as-a-Judge. The paper does not give the model name or report the number of repetitions.
    • Budget: The paper does not report the Top-K and number of query rounds for the main experiments. The cost analysis fixes the query budget at 200 and is written on HarryPotter.

    Main Results

    Figure 3 compares six attacks, four defenses, and five metrics; transparent bars are no defense, but the main text does not list bar heights. The table below is the EER from Figure 4 on Enron; S, M, L correspond to MiniLM, GTE-base, BGE-large. The diagonal is white-box where the attacker and retriever share the same embedding model.

    Swipe horizontally to read the table

    Retriever-AttackerDGEAIKEACopyBreak
    S-S90.520.8332.33
    S-M40.3323.6743.0
    S-L43.532.1736.17
    M-S35.6731.3328.0
    M-M69.3338.520.67
    M-L38.6745.522.0
    L-S25.532.526.67
    L-M33.3335.1732.83

    The omitted L-L is DGEA 62.17, IKEA 45.0, CopyBreak 22.5 (Figure 4).

    • No-defense retrieval: The authors state that DGEA's EER is higher than IKEA and CopyBreak; among random baselines, R-EB is highest and R-TT lowest. The reasons given are explicit separation of query–chunk distance, topic diversity not equal to query diversity, and narrower query distribution under the same prompt.
    • Generation side: The authors state that attacks with explicit COMMAND have higher EEG; IKEA does not use explicit instruction repetition, so sensitive leakage is less. The authors state that the EELS trend in the figure is consistent with EESS, so EELS is omitted.
    • Four defenses: The authors state that Query Block blocks most explicit extraction queries but not IKEA; Threshold is stronger against R-EB and DGEA, while CopyBreak and IKEA are filtered less due to higher similarity; System Block reduces EEG and ASR in most settings, with IKEA as an exception; Summary reduces verbatim reproduction for all attacks. In Figure 5(b), the authors state that retrieval scores for CopyBreak and IKEA are around 0.4, and for R-EB and DGEA around 0.2.

    Retrieval Threshold

    • Setting: Cosine similarity threshold varies from -1 (no filtering) to 0.7. Figure 5(b) Top-K score distribution is on HealthCareMagic; the dataset caption for Figure 5(a) is not separately specified.
    • EER: The authors state that EER is unchanged from -1 to 0; when raised to 0.3, R-TK, R-TT, R-EB, DGEA decrease more noticeably, while CopyBreak and IKEA are less affected; when raised to 0.5 or 0.7, EER for almost all baselines approaches zero. The main text does not give EER values for each threshold.
    • Utility: The authors state that recall decreases as the threshold rises from 0.3 to 0.7. The main text does not give recall values.

    Cross-lingual, Indexing, and Rewriting Defenses

    • Cross-lingual (Table 3): On Med_Vietnamese without defense, R-TK's EEG_LS is 100.00, and under Summary it is 4.17; DGEA's EER drops from 39.50 to 19.50 under Threshold. On Med_Chinese, IKEA's EEG_LS without defense is 0.23. The authors state that Summary still significantly reduces verbatim reproduction, IKEA is harder to detect but also harder to induce verbatim reproduction, and the trend is consistent with the English domain.
    • Indexing (Figure 7): On HealthCareMagic and Enron, the authors state that fixed-length chunking (20% overlap) has the worst extraction performance, and Graph Triplet increases the per-token extraction ratio by compressing content into fewer tokens. The main text does not give bar heights.
    • SAGE and VAGUE-GATE: Figure 9 averages over all attacks on HarryPotter and Pokémon. The authors state that SAGE reduces EEG_SS to 53.1 and outperforms Summary and System Block; VAGUE-GATE provides weaker protection. In Table 4, SAGE rewriting Enron is estimated at 22.6B tokens, $6,096.8, and over 10 days.

    Other Ablations and Analyses

    • Query diversity (Table 2, average EER over four datasets): No-defense Original is R-TK 20.3, R-EB 56.9, R-TT 11.7, DGEA 60.9, IKEA 24.5, CB 26.5; Diversity is 25.1, 71.8, 12.4, 67.2, 35.5, 27.7. Under Threshold, Original is 11.2, 28.7, 6.00, 24.0, 31.3, 22.4, and Diversity is 14.3, 36.8, 7.70, 30.4, 36.5, 23.4.
    • Generators (Figure 6): The authors state that explicit COMMAND attacks have higher EEG_SS on closed-source generators; IKEA's open-source and closed-source results are similar. The main text does not give bar heights.
    • COMMAND (Figure 6): The authors state that ASR from high to low is CPLX, JAILBREAK, SMPL, MED. IKEA's ASR remains stable across COMMANDs. The main text does not give bar heights.
    • Cost (Figure 8, HarryPotter, budget 200): Section 5.4.4 states that DGEA, R-EB, R-TT have zero token cost, IKEA and CopyBreak are higher due to repeated LLM calls, and R-TK calls once per query. Appendix A.1 describes whether R-TT and R-TK call LLMs differently. The main text does not give specific token counts.
    • Time: The authors write the greedy search for non-LLM attacks as O(E×T×P) and state that DGEA is slower than R-EB, and R-TK's runtime overhead is negligible. The paper does not report the values of E, T, P.
  5. What are some points that can be further explored?

    The authors set future work as diversity optimization, multi-stage defense coordination, and agentic RAG.

    Limitations and Future Directions Noted by the Authors

    • Future directions (Section 6): The authors list future work including multi-layer diversity optimization, multi-stage defense coordination, and extending the benchmark to agentic RAG architectures.
    • Cost of rewriting defenses (Appendix A.4): The authors state that preprocessing costs of rewriting-based defenses like SAGE are high, limiting practicality for large-scale deployment.
    • SAGE experimental scope (Appendix A.4): The authors specify that evaluation is limited to HarryPotter and Pokémon because the cost of offline rewriting the entire corpus makes experiments on larger datasets too expensive.

    Experimental Coverage

    • Main comparison: Six attacks, four main pipeline defenses, five metrics; Figure 3 is the average over four datasets and knowledge instance indices. The text does not list the values of the bars in Figure 3.
    • Models: Generators are Llama3-8B-Instruct, Qwen2.5-7B-Instruct, GPT-4o-mini, GPT-4o; retrieval embeddings are all-MiniLM-L6-v2, GTE-base-768, BGE-large-en-v1.5; cross-lingual retriever is multilingual-MiniLM.
    • Data subsets: English datasets are HealthCareMagic, Enron, HarryPotter, Pokémon. Table 3 only reports R-TK, DGEA, IKEA on Med_Chinese and Med_Vietnamese under None, Threshold, Summary. Figure 4 is on Enron; Figure 5(b) is on HealthCareMagic.
    • Appendix defenses: The average EEG_SS for SAGE and VAGUE-GATE comes from all attacks on HarryPotter and Pokémon.
    • Not reported in the paper: Top-K in main experiments, query budget in main experiments, model names for LLM-as-a-Judge and Query Block classifier, number of repetitions, and the values of θ in EE and λ in the objective function.
  6. Summarize the main content of the paper

    A unified benchmark compares RAG knowledge extraction attacks and defenses; the authors state that both retrieval and generation need optimization, and no single defense can fully protect.

    The authors provide a unified benchmark for comparing RAG knowledge extraction attacks and defenses.

    • Problem: External knowledge bases can be extracted for sensitive content through multi-round queries, but existing experiments have inconsistent data, models, capability assumptions, and metrics.
    • Method: Queries are split into INFORMATION that guides retrieval and COMMAND that prompts reproduction. The benchmark implements six attacks and defenses at input, retrieval, and generation stages, and uses EER, EEG, joint EE, and ASR to separate retrieval and generation.
    • Retrieval numbers: On Enron, DGEA has an EER of 90.5 when the attacker and retriever are both MiniLM, 62.17 when both are BGE-large, and 25.5 for an L retriever against an S attacker (Figure 4). The four-dataset average EER for DGEA without defense is 60.9; with query diversity, R-EB is 71.8 (Table 2).
    • Defenses and cross-lingual: The authors state that Threshold filters low-similarity queries, but recall decreases as the threshold rises; Query Block struggles to block IKEA, which does not use explicit reproduction instructions. On Med_Vietnamese, Summary reduces R-TK's EEG_LS from 100.00 to 4.17 (Table 3). On HarryPotter and Pokémon, SAGE's average EEG_SS is 53.1 (Figure 9).
    • Authors' conclusions: Effective extraction requires optimizing both retrieval and generation. Defenses at each stage have complementary effects, but no single defense provides complete protection. The authors also state that insufficient diversity among queries causes repeated exploration, embedding-based attacks transfer weakly across models, and both the generator's instruction following and the knowledge base indexing method affect extraction.

Related papers

Show 3 more papers
Read originalACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2