RAG Poisoning Recovery: Restore an Assistant from Immutable Backups
Chapter 5 of OpenShift AI backup: tutorial and best practices. Lab: OpenShift 4.22, Red Hat OpenShift AI 3.5.1 (vLLM on CPU), Qdrant, Trilio for Kubernetes 5.4.0, Wasabi with Object Lock.
A retrieval-augmented (RAG) assistant answers from a knowledge base, which makes it accurate. It also gives attackers a new target, and RAG poisoning recovery becomes a real operational question. Change the knowledge base and the assistant gives the attacker’s answers, politely and with sources. This chapter of my OpenShift AI backup guide poisons a RAG assistant in my lab. Then I restore only its vector store from an immutable, off-site backup. You will see the restore YAML, the before and after answers, and the exact limits of Object Lock in governance mode. Detection is not covered here; recovery is.
Why RAG poisoning is hard to see
OWASP lists this attack as memory and context poisoning, ASI06, in its Top 10 for agentic applications. Unlike a prompt injection, it persists. The poisoned passage keeps answering until someone removes it. Agents have the same problem with their memory, and the AI agent memory backup chapter recovers a poisoned one.
Nothing crashes when it happens. Pods stay green, latency stays normal, no alert fires. The system is healthy; it is just wrong.
That means you need two things: a way to notice, and a clean copy of the knowledge to go back to. This chapter is about the second one.
The pieces in this RAG assistant
| Piece | What it does here |
|---|---|
| vLLM on OpenShift AI | Serves a small chat model (Qwen2.5 0.5B, CPU) as an InferenceService. |
| Qdrant | The vector database: each knowledge-base passage stored as an embedding. |
| The assistant | A small Gradio app: embeds the question, retrieves the closest passages from Qdrant, answers only from them. |
| Trilio BackupPlan and hook | Backs up the whole project. A pre-hook asks Qdrant for a consistent snapshot first. |
| Wasabi with Object Lock | The backup target. Objects are locked in governance mode until their retention date. |
The model, the app and Qdrant run in one project. The model weights come from a shared S3 bucket. The knowledge lives only in Qdrant’s persistent volume: that is what the attacker changes, and what we need back.
Step 1: a healthy assistant, backed up consistently
The project is backed up to Wasabi. Before the snapshot, this hook asks Qdrant for a full snapshot and checks the answer. Hooks and ignoreFailure are explained in the MLflow and model registry backup chapter.
apiVersion: triliovault.trilio.io/v1
kind: Hook
metadata: {name: qdrant-snapshot, namespace: ds-rag}
spec:
pre:
execAction:
command:
- bash
- -c
- 'exec 3<>/dev/tcp/127.0.0.1/6333; printf ''POST /snapshots?wait=true HTTP/1.1\r\nHost:
localhost\r\nContent-Length: 0\r\nConnection: close\r\n\r\n'' >&3; cat <&3
| grep -q ''"status":"ok"'''
ignoreFailure: false
maxRetryCount: 2
timeoutSeconds: 120
post:
execAction:
command:
- bash
- -c
- cd /qdrant/data/snapshots && ls -1t full-snapshot-*.snapshot | tail -n +2
| while read f; do rm -f "$f" "$f.checksum"; done; true
ignoreFailure: true
maxRetryCount: 1
timeoutSeconds: 60
The hook speaks HTTP to Qdrant through bash’s /dev/tcp, so it needs no extra tools in the image. The post-hook keeps only the newest snapshot so the volume does not fill up.
I restored that backup into an isolated copy of the project, built as in the MLflow and model registry backup chapter. There, the assistant answers five control questions correctly:
| Question | Answer |
|---|---|
| Above what amount does a card transaction raise a fraud alert? | 7,500 EUR |
| What phone number should I call if I lose my card? | +351 210 000 777 |
| From which domain does Northwind contact customers? | northwind-bank.example |
| How many days do I have to dispute a card charge? | 120 days |
| What is the daily wire transfer limit? | 15,000 EUR |
Step 2: poisoning the vector store
A job rewrites four passages in the vector store. A higher fraud threshold, a different phone number, a lookalike domain, an unlimited wire transfer.
The assistant now gets 1 of 5 right, only the dispute window, and quotes its “sources” while doing it. My own checker first reported 2 of 5: it matched “7,500” inside “750,000 EUR”. The screenshot shows the real answers.
Step 3: RAG poisoning recovery from an immutable backup
The backup sits in Wasabi under Object Lock. I tried to delete five specific object versions with the same credentials Trilio uses, without any bypass option. All five returned AccessDenied.
The fix is surgical. I deleted only the poisoned Qdrant volume and its Deployment, and restored only those two objects from the pre-poison backup:
apiVersion: triliovault.trilio.io/v1
kind: Restore
metadata:
name: r3-qdrant-prepoison
namespace: ds-rag-lab
spec:
source:
type: Backup
backup: {name: ds-rag-wasabi-full-1, namespace: ds-rag}
restoreFlags:
skipIfAlreadyExists: true
resourceSelector:
gvkSelector:
- groupVersionKind: {group: "", version: v1, kind: PersistentVolumeClaim}
objects: [qdrant-data]
- groupVersionKind: {group: apps, version: v1, kind: Deployment}
objects: [qdrant]
The model kept serving and the app kept running. When Qdrant came back, the assistant was at 5 of 5 again.
Where immutable backup protection ends
Governance is not compliance. In governance mode, the account root user, or any identity with s3:BypassGovernanceRetention, can delete locked objects with the bypass header. If the key Trilio uses has that permission, a thief holding it can erase your recovery point. Give Trilio a key without it, or use compliance mode when the copy must survive even the account owner.
Retention is also the lock length. On an Object Lock target, Trilio derives each backup’s expiry from the retention policy and the schedule. That expiry becomes the lock date. My first lab policy, keep 20 with a weekly schedule, locked every backup for about 20 weeks. Lowering it later does not shorten locks that already exist.
Takeaways
Back up the vector store with the app, and use the database’s own snapshot hook so the files are consistent. Keep the backup where the attacker cannot reach it: off-site, Object Lock, separate credentials.
Restore small. A selective restore of one volume and its Deployment brings the knowledge back without rolling back everything else.
Rehearse in a copy. I ran all of this in an isolated copy, cut off from the original by network policy, so production never saw the poison.
What this test does not cover
Detection. Trilio restores the knowledge base; spotting the poison is an application check. Control questions like mine are a cheap start.
Answers already given stay given. Customers who called the wrong number before the restore did call it. If the poison came from a changed source document, re-ingesting will poison the assistant again: fix the source too.
Conclusion
RAG poisoning leaves every dashboard green while the answers go wrong. A consistent, immutable backup of the vector store turns recovery into one small restore. Mind the governance bypass permission and choose retention knowing it sets the lock. I would rather restore one volume from a clean, locked copy than rebuild the whole assistant. Rehearse a vector store restore this week.
Thank you for reading! I hope it was useful.
Useful Links
Rodolfo Casás
Rodolfo Casás is the Director of Product at Trilio with a special focus on cloud-native computing and virtualization, sovereign clouds, hybrid cloud strategies, telco and data protection.