LeakDojo : Decoding the Leakage Threats of RAG Systems

Maosen Zhang, Jianshuo Dong, Boting Lu, Wenyue Li, Xiaoping Zhang, Tianwei Zhang, Han Qiu · 2026

Read LeakDojo : Decoding the Leakage Threats of RAG Systems by Maosen Zhang, Jianshuo Dong, Boting Lu, Wenyue Li, Xiaoping Zhang, Tianwei Zhang, Han Qiu (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-05818.txt.

Introduction

A retrieval system's store is an asset, and attackers have learned to pump it out through the chat interface. Maosen Zhang and six co-authors present LeakDojo, a configurable framework for measuring that leakage under set conditions. They benchmark six existing attacks across fourteen language models, four data sets, and varied retrieval setups.

Two factors drive leakage on their own: how queries are made, and the hostile instructions wrapped around them, with total leakage roughly their product. Models that follow instructions better leak worse. The framework lets defenders grade setups before launch rather than after a breach.

Catalog record

CREATORMaosen Zhang, Jianshuo Dong, Boting Lu, Wenyue Li, Xiaoping Zhang, Tianwei Zhang, Han Qiu
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE76 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.05818

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

LeakDojo : Decoding the Leakage Threats of RAG Systems Maosen Zhang, Jianshuo Dong, Boting Lu, Wenyue Li, Xiaoping Zhang, Tianwei Zhang, Han Qiu Abstract Retrieval-Augmented Generation (RAG) enables large language models (LLMs) to leverage external knowledge, but also exposes valuable RAG databases to leakage attacks. As RAG systems grow more complex and LLMs exhibit stronger instruction-following capabilities, existing studies fall short of systematically assessing RAG leakage risks. We present LeakDojo , a configurable framework for controlled evaluation of RAG leakage. Using LeakDojo , we benchmark six existing attacks across fourteen LLMs, four datasets, and diverse RAG systems. Our study reveals that (1) query generation and adversarial instructions contribute independently to leakage, with overall leakage well approximated by their product; (2) stronger instruction-following capability correlates with higher leakage risk; and (3) improvements in RAG faithfulness can introduce increased leakage risk. These findings provide actionable insights for understanding and mitigating RAG leakage in practice. Our codebase is available at GitHub . † † footnotetext: *Corresponding authors. 1 Introduction Retrieval-Augmented Generation (RAG) ( 19 ; 14 ) was proposed to equip Large Language Models (LLMs) with access to external knowledge, thereby mitigating outdated knowledge and addressing factual hallucinations ( 16 ; 12 ; 15 ) . Since then, RAG has become a common practice for applying LLMs in knowledge-intensive domains, such as healthcare ( 40 ; 46 ) , finance ( 32 ) , and legal assistance ( 39 ) . Nowadays, constructing and maintaining high-quality RAG knowledge databases has become increasingly costly ( 38 ) and often requires specialized domain expertise ( 22 ; 31 ) , transforming these databases into high-value digital assets. This economic and practical value incentivizes adversaries to maliciously extract proprietary knowledge through the RAG interface, giving rise to RAG leakage attacks. Recent works ( 29 ; 17 ; 7 ) have validated the feasibility of such attacks, exploiting prompt injection techniques to induce LLMs to leak the retrieved chunks from context ( 42 ) . These attacks exhibit substantial effectiveness against RAG systems with relatively simple designs and limited defensive measures in place. Figure 1: Stronger instruction-following ability may imply higher leakage risk of RAG systems. However, several emerging factors obscure the real-world impacts of RAG leakage attacks. First, RAG systems are evolving toward complex architectures with various enhancement modules like rewriters ( 13 ) and even defense modules ( 1 ; 42 ) . Second, new LLMs show increasingly advanced instruction-following capability, as illustrated in Figure 1 . Given these trends, existing studies fall short of providing a systematic assessment of RAG leakage risks. In this context, we explore how model capability, RAG system design, and attack strategy jointly influence leakage risk . To address this gap, we design LeakDojo , a modular and configurable framework for controlled evaluation of RAG leakage risks. Inspired by 11 , LeakDojo decomposes the RAG systems, attacks, and defenses into independently configurable components. This design enables us to isolate and analyze whether and how each component contributes to the leakage, enabling studies of: (1) the underlying mechanisms of leakage attacks, (2) how RAG architectures influence leakage risks, and (3) the effectiveness of defenses. Its modularity also facilitates extension to new attack strategies and defense mechanisms, as exemplified by our case study (see Section 5 ). Using LeakDojo , we conduct extensive experiments evaluating six primary and eight supplementary LLMs across four datasets. We systematically audit various RAG system configurations with enhancement modules, including reranker ( 13 ) , rewriter ( 23 ) , and summarizer ( 20 ) . Our empirical analysis yields three key observations regarding the mechanisms underlying RAG leakage: (1) The query generator and adversarial instruction contribute independently to leakage, and the overall leakage can be accurately approximated by the product of their individual effects. (2) Instruction-following capability is positively correlated with leakage risk, suggesting that stronger LLMs may inadvertently amplify vulnerability, as shown in Figure 1 . (3) A fundamental trade-off exists between RAG faithfulness and security of leakage: RAG modules or strategies that improve faithful generation may simultaneously increase the leakage risk. Our main contributions are as follows: \bullet We propose LeakDojo , a configurable framework that enables controlled experiments and analysis of RAG leakage risks. The corresponding evaluation toolkit is released concurrently. \bullet We conduct a comprehensive empirical study, benchmarking six existing attacks across diverse LLMs, datasets, and RAG settings. \bullet We provide insights into leakage mechanisms. Our findings offer actionable guidance for practitioners, such as identifying stronger attacks. 2 Preliminaries 2.1 RAG System & Leakage Threats RAG system . Retrieval-Augmented Generation (RAG) is a widely adopted paradigm that augments LLMs with external, up-to-date knowledge. The initial RAG prototype proposed by 19 involves a single retrieval step from an external knowledge base prior to LLM generation. Modern RAG systems, however, have evolved into significantly more complex architectures. As illustrated in Figure 2 , additional components such as rerankers ( 13 ) and rewriters ( 23 ) are commonly integrated to improve retrieval quality and utilization of knowledge. Despite these architectural advances, one aspect remains unchanged: constructing and maintaining the underlying knowledge bases continues to require substantial effort and domain expertise, making RAG systems costly to build and operate. Figure 2: Modern RAG systems are increasingly complex in their structural designs. In this paper, we study how the integration of a reranker, rewriter, and summarizer impacts leakage risks. RAG leakage threats . Meanwhile, a cost imbalance exists as extracting the retrieved knowledge chunks exposed to LLMs at inference time is relatively easy. This creates an attack surface, known as RAG leakage attacks, where attacks aim to extract as many chunks as possible. Prior work exploits LLM vulnerabilities to prompt injection ( 29 ) , crafting queries that induce models to reveal verbatim retrieved content, even in black-box settings ( 42 ; 17 ; 7 ) . These attacks demonstrate the practical risk of RAG leakage. Table 1: Comparative analysis of existing related papers across attack design, RAG systems, and defenses. (●) indicates the aspect is explicitly studied in the reference; (◑) shows the aspect is involved but not systematically explored; (○) means the aspect is not meticulously mentioned. The “Advanced” column indicates enhancement modules, including reranker, rewriter, and summarizer. Ref. Attack RAG Defense Query Instruction Retriever Advanced LLM Dataset Input Output TGTB 42 ● ◑ ● ○ ● ◑ ○ ○ PIDE 29 ◑ ● ◑ ○ ● ● ○ ○ DGEA 4 ● ◑ ● ○ ● ◑ ○ ○ RAG-Thief 17 ● ◑ ◑ ○ ● ◑ ○ ○ PoR 7 ● ◑ ● ○ ● ◑ ○ ○ IKEA 38 ● ◑ ● ◑ ● ◑ ● ● Threat model . Following the previous studies ( 17 ; 7 ; 38 ) , we summarize the threat models of existing RAG leakage attacks as follows. \bullet Attacker’s goal : The attacker aims to maximize the number of unique chunks leaked from the knowledge database under N interaction rounds. \bullet Attacker’s capability : The attacker can only interact with the RAG system solely by sending queries and receiving the final responses through a black-box RAG interface for limited rounds. \bullet Attacker’s knowledge : The attacker does not know the RAG structure or configurations.

Read the complete text