Secure Retrieval-Augmented Generation against Poisoning Attacks

Zirui Cheng, Jikai Sun, Anjun Gao, Yueyang Quan, Zhuqing Liu +2 more
10/28/2025
cs.CRcs.IRcs.LG

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) have transformed natural language processing (NLP), enabling applications from content generation to decision support. Retrieval-Augmented Generation (RAG) improves LLMs by incorporating external knowledge but also introduces security risks, particularly from data poisoning, where the attacker injects poisoned texts into the knowledge database to manipulate system outputs. While various defenses have been proposed, they often struggle against advanced attacks. To address this, we introduce RAGuard, a detection framework designed to identify poisoned texts. RAGuard first expands the retrieval scope to increase the proportion of clean texts, reducing the likelihood of retrieving poisoned content. It then applies chunk-wise perplexity filtering to detect abnormal variations and text similarity filtering to flag highly similar texts. This non-parametric approach enhances RAG security, and experiments on large-scale datasets demonstrate its effectiveness in detecting and mitigating poisoning attacks, including strong adaptive attacks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{cheng2025secure,
  title  = {Secure Retrieval-Augmented Generation against Poisoning Attacks},
  author = {Zirui Cheng and Jikai Sun and Anjun Gao and Yueyang Quan and Zhuqing Liu and Xiaohua Hu and Minghong Fang},
  year   = {2025},
  eprint = {2510.25025},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.25025v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.25025.svg)](https://codeofpaper.com/paper/2510.25025)

Discussion