Is My Data in Your Retrieval Database? Membership Inference Attacks Against Retrieval Augmented Generation
Open accessThe DOI matches its Crossref record; 12 of the 12 references it cites were found in a registry or an index.
Abstract
Retrieval Augmented Generation (RAG) systems have shown great promise in natural language processing. However, their reliance on data stored in a retrieval database, which may contain proprietary or sensitive information, introduces new privacy concerns. Specifically, an attacker may be able to infer whether a certain text passage appears in the retrieval database by observing the outputs of the RAG system, an attack known as a Membership Inference Attack (MIA). Despite the significance of this threat, MIAs against RAG systems have yet remained under-explored. This study addresses this gap by introducing an efficient and easy-to-use method for conducting MIA against RAG systems. We demonstrate the effectiveness of our attack using two benchmark datasets and multiple generative models, showing that the membership of a document in the retrieval database can be efficiently determined through the creation of an appropriate prompt in both black-box and gray-box settings. Moreover, we introduce an initial defense strategy based on adding instructions to the RAG template, which shows high effectiveness for some datasets and models. Our findings highlight the importance of implementing security countermeasures in deployed RAG systems and developing more advanced defenses to protect the privacy and security of retrieval databases.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The source backs part of the claim, not all of it — or backs it for a different population, condition or comparison.
In the citing paper
“Therefore, some outstanding RAG MIA methods proposed by Naseh et al. [15] and Anderson et al. [1] may not work well in our setting, since they rely on multiple judgment queries (e.g., yes/no questions) to directly ask the model about the membership of the target item, which could be easily predicted or inferred with other memory units.”
From MRMMIA: Membership Inference Attacks on Memory in Chat Agents (2026) · cites this paper as [1]
Experimental — accuracy not yet measuredThe cited source says what the claim attributes to it.
In the citing paper
“However, existing research indicates that RA-LLMs can be maliciously manipulated [38] to leak private information from the retrieval database [17], [18], [19], [28], [39], [40].”
From External Data Extraction Attacks Against Retrieval-Augmented Large Language Models (2026) · cites this paper as [39]
In the citing paper
“Past work [1, 11, 12, 15, 17] has shown that carefully designed prompts can extract specific information from a language model system, such as finetuned LLMs and RAG systems.”
From MRMMIA: Membership Inference Attacks on Memory in Chat Agents (2026) · cites this paper as [1]
In the citing paper
“existing MIAs against RAG [39] can be applied as a further check on document membership.”
From External Data Extraction Attacks Against Retrieval-Augmented Large Language Models (2026) · cites this paper as [39]
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
The publisher hasn’t deposited this paper’s reference list.
Research works printed but not linked: 18
- Amin, K., Bie, A., Kong, W., Kurakin, A., Ponomareva, N., Syed, U., Terzis, A., and Vassilvitskii, S. (2024). Private prediction for large-scale synthetic text generation. arXiv preprint arXiv:2407.12108 . · arXiv
- Carlini, N., Chien, S., Nasr, M., Song, S., Terzis, A., and Tramer, F. (2022). Membership inference attacks from first principles. In 2022 IEEE Symposium on Security and Privacy (SP) , pages 1897-1914. IEEE.
- Galli, F., Melis, L., and Cucinotta, T. (2024). Noisy neighbors: Efficient membership inference attacks against llms. arXiv preprint arXiv:2406.16565 . · arXiv
- Guo, R., Luan, X., Xiang, L., Yan, X., Yi, X., Luo, J., Cheng, Q., Xu, W., Luo, J., Liu, F., et al. (2022). Manu: a cloud native vector database management system. Proceedings of the VLDB Endowment , 15(12):3548-3561.
- Hu, Z., Wang, C., Shu, Y., Zhu, L., et al. (2024). Prompt perturbation in retrieval-augmented generation based large language models. arXiv preprint arXiv:2402.07179 . · arXiv
- Li, H., Guo, D., Li, D., Fan, W., Hu, Q., Liu, X., Chan, C., Yao, D., Yao, Y., and Song, Y. (2024a). Privlmbench: A multi-level privacy evaluation benchmark for language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pages 54-73.
- Li, Y., Liu, G., Wang, C., and Yang, Y. (2024b). Generating is believing: Membership inference attacks against retrieval-augmented generation. arXiv preprint arXiv:2406.19234 . · arXiv
- Liu, Y., Jia, Y ., Geng, R., Jia, J., and Gong, N. Z. (2024). Formalizing and benchmarking prompt injection attacks and defenses. In ArXiv . USENIX Security Symposium.
- Lyu, K., Zhao, H., Gu, X., Yu, D., Goyal, A., and Arora, S. (2024). Keeping llms aligned after fine-tuning: The crucial role of prompt templates. arXiv preprint arXiv:2402.18540 . · arXiv
- Majmudar, J., Dupuy, C., Peris, C., Smaili, S., Gupta, R., and Zemel, R. (2022). Differentially private decoding in large language models. In NAACL 2022 Second Workshop on Trustworthy Natural Language Processing (TrustNLP) .
- Panda, A., Tang, X., Nasr, M., Choquette-Choo, C. A., and Mittal, P. (2024). Privacy auditing of large language models. In ICML 2024 Workshop on Foundation Models in the Wild .
- Reynolds, L. and McDonell, K. (2021). Prompt programming for large language models: Beyond the few-shot paradigm. In Extended abstracts of the 2021 CHI conference on human factors in computing systems , pages 1-7.
- Shejwalkar, V., Inan, H. A., Houmansadr, A., and Sim, R. (2021). Membership inference attacks against nlp classification models. In NeurIPS 2021 Workshop Privacy in Machine Learning .
- Shokri, R., Stronati, M., Song, C., and Shmatikov, V. (2017). Membership inference attacks against machine learning models. In 2017 IEEE symposium on security and privacy (SP) , pages 3-18. IEEE.
- Tramer, F., Carlini, N., Brendel, W., and Madry, A. (2020). On adaptive attacks to adversarial example defenses. Advances in neural information processing systems , 33:1633-1645.
- Tseng, W.-C., Kao, W.-T., and Lee, H.-y. (2021). Membership inference attacks against self-supervised speech models. arXiv preprint arXiv:2111.05113 . · arXiv
- Zhang, J., Sun, J., Yeats, E., Ouyang, Y ., Kuo, M., Zhang, J., Yang, H. F., and Li, H. (2024). Min-k%++: Improved baseline for detecting pre-training data from large language models. arXiv preprint arXiv:2404.02936 . · arXiv
- Zhong, Z., Huang, Z., Wettig, A., and Chen, D. (2023). Poisoning retrieval corpora by injecting adversarial passages. arXiv preprint arXiv:2310.19156 . · arXiv
Cited by
A Comprehensive Survey in LLM(-Agent) Full Stack Safety: Data, Training and DeploymentPreprint
Wang, K., Zhang, G., Zhou, Z., Wu, J., Yu, M., Zhao, S., Yin, C., Fu, J., Yan, Y., Luo, H., et al. (2025) · arXiv · doi:10.48550/arxiv.2504.15585 · Cited by 202
Trustworthiness in Retrieval-Augmented Generation Systems: A SurveyPreprint
Zhou, Y., Zhang, W., Shao, J., Liu, Y., Li, X., Jin, J., Qian, H., Liu, Z., Li, C., Zhang, C., et al. (2024) · arXiv · doi:10.48550/arxiv.2409.10102 · Cited by 237
“Specifically, we use the following prompt format: Question: { question } Context: { context } Please answer the following question, and you can refer to the provided information.”
Glue pizza and eat rocks - Exploiting Vulnerabilities in Retrieval-Augmented Generative Models
Tan, Z., Zhao, C., Moraffah, R., Li, Y., Wang, S., Li, J., Chen, T., & Liu, H. (2024) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2024.emnlp-main.96 · Cited by 82
On the Trustworthiness Landscape of State-of-the-art Generative Models: A Survey and Outlook
Fan, M.-Y., Wang, C.-Y., Chen, C., Liu, Y., & Huang, J. (2023) · International Journal of Computer Vision · doi:10.1007/s11263-025-02375-w · Cited by 24
“Carlini et al. [23] suggested two initialization strategies for prefixes: random prefixes and common prefixes crawled from the Internet.”
Nazary, F., Deldjoo, Y., & Noia, T. D. (2025) · Lecture notes in computer science · doi:10.1007/978-3-031-88717-8_18 · Cited by 37
Metadata
- Authors
- Anderson, M., Amit, G., & Goldsteen, A.
- Affiliations
- IBM Research - Haifa (IL)
- Venue
- Proceedings of the 11th International Conference on Information Systems Security and Privacy
- Published
- 2025
- Pages
- 474-485
- OpenAlex
- W4407938156
- Semantic Scholar
- 21dc5aa608721f7e8a09e7dd9de8e48a71d9f0c9
- Cited by
- 20
- References
- 0
- Citations by year
- 2026: 9 · 2025: 11
- FWCI
- 18.97
- Type
- conference paper
- Language
- en
- Open access
- hybrid
- doi.org
- Licence
- cc-by-nc-nd
- Locations
- International Conference on Information Systems Security and Privacy (ICISSP) (publishedVersion, cc-by-nc-nd)
- arXiv (Cornell University) (submittedVersion, cc-by)
- arXiv (Cornell University) (cc-by)
- Funders
- Government of the United Kingdom
- UK Research and Innovation
- European Commission (101094323)
- HORIZON EUROPE Framework Programme
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
- Physical Sciences › Computer Science › Artificial Intelligence › Privacy-Preserving Technologies in Data
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Keywords
- membership inference attacks, retrieval-augmented generation, data privacy, large language models, privacy attacks
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.