SafeRAG: first Chinese benchmark showing subtle data-injection attacks that bypass retrievers, filters, and generators

January 28, 20257 min

Overview

Decision SnapshotReady For Pilot

The benchmark provides a concrete dataset and multi-stage tests with human validation; it is practical for pipeline hardening but limited to single‑modal Chinese news data and data-injection threat types.

Citations1

Evidence Strength0.80

Confidence0.85

Risk Signals8

Trust Signals

Findings with numeric evidence: 5/5

Findings with evidence refs: 5/5

Results with explicit delta: 1/4

Reproducibility

Status: Code + data available

Open source: Partial

At A Glance

Cost impact: 45%

Production readiness: 60%

Novelty: 60%

Authors

Xun Liang, Simin Niu, Zhiyu Li, Sensen Zhang, Hanyu Wang, Feiyu Xiong, Jason Zhaoxin Fan, Bo Tang, Shichao Song, Mengwei Wang, Jiawei Yang

Links

Abstract / PDF / Code / Data

Why It Matters For Business

RAG pipelines used in products can be quietly manipulated by injected texts that bypass retrievers, filters, or LLMs; this risks wrong answers, hidden ads, or unwarranted refusals—test and harden the whole pipeline, not only the model.

Who Should Care

Summary TLDR

SafeRAG is a Chinese benchmark and dataset that tests RAG (retriever → filter → generator) pipelines against four data-injection attacks: silver noise (partial answers), inter-context conflict, soft ad (implicit toxic/advertising text), and white DoS (false safety-warning refusal). The authors build a 100-question news-based base dataset, craft attacks primarily by human annotators with LLM help, and run systematic experiments across 14 retrievers/filters/generators. Results show RAG systems are broadly vulnerable: attacks are most effective when injected into filtered or retrieved contexts, some compressors or filters worsen results, and certain retrievers (Hybrid-Rerank) and generators (Ba

Problem Statement

Retrieval-augmented generation (RAG) systems combine external documents with LLMs, but attacker-supplied texts can be injected at indexing, retrieval, or filtering and mislead the system. Existing benchmarks use attack types that are often blocked by retrievers or simple filters, so we lack a realistic evaluation that exposes subtle, bypassing attacks across the full RAG pipeline.

Main Contribution

Define four improved attack types against RAG: silver noise, inter-context conflict, soft ad, and white DoS.

Construct SafeRAG: a mainly human-curated Chinese dataset built from 100 news Q–context pairs and targeted attack texts.

Key Findings

RAG systems are vulnerable to subtle injection attacks (noise, conflict, toxicity, DoS) at multiple pipeline stages.

Numbersevaluated 14 RAG components; attacks reduce F1(avg) and AFR across tasks

Practical UseTest your full retrieval+filter+generation pipeline with targeted injections, not just prompts.

Evidence RefAbstract; Sections 5.2–5.3

Attack effectiveness is highest when injected into filtered or retrieved contexts rather than the raw knowledge base.

Numbersranking: filtered context > retrieved context > knowledge base

Practical UseFocus defenses on post-retrieval filtering and generator input sanitization.

Evidence RefSection 5.3

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
Number of evaluated RAG components14 retrievers/filters/generatorsSafeRAG experiments (Section 5.1)Section 5.1 lists 14 components evaluatedSection 5.1
Dataset size (base)100 comprehensive question–context pairsSafeRAG base datasetSection 3.2: curated 100 question-contexts pairsSection 3.2

What To Try In 7 Days

Run SafeRAG tests (or replay attacks) against your retriever+filter+generator stack.

Simulate silver-noise and white-DoS injections into filtered contexts to check end-to-end behavior.

Compare hybrid-rerank versus DPR/BM25 retrieval for your domain and prefer hybrid rerankers if noise is a problem.

Reproducibility

Code AvailableYes
Data AvailableYes
Open Source StatusPartial
LicenseUnknown

Risks & Boundaries

Limitations

Attack coverage focuses on data-injection attacks and does not include model-level backdoors.

Benchmark targets single-modal text RAG (news); it does not evaluate multimodal or structured knowledge RAG.

When Not To Use

Assessing model-level backdoors or attacks that modify model weights.

Evaluating multimodal (image/audio/graph) RAG systems without adaptation.

Failure Modes

Benchmark may reveal attack patterns that adversaries could adapt to (risk of method disclosure).

Human-constructed conflicts are realistic but cannot cover all real-world manipulations or domains.

Core Entities

Models

DeepSeekGPT-3.5-turboGPT-4GPT-4oQwen-7BQwen-14BBaichuan-13BChatGLM-6BDPRBM25HybridHybrid-Rerankbge-base-zh-v1.5bge-reranker-base

Metrics

AccuracyF1(correct)F1(incorrect)F1(avg)Attack Success Rate (ASR)Attack Failure Rate (AFR)

Datasets

SafeRAG (Chinese RAG security evaluation dataset)base news Q–context dataset (100 pairs, Aug–Sep 2024)

Benchmarks

RGBRAG BenchLRIIRECALLPhantomMARPoisonedRAGClashEval