Skip to content

Meet DeepintShield at Bengaluru Tech Summit 2026, 17 to 19 November, BIEC Hall 1, booth H1A106. Book 20 minutes

Start For Free

Platform · RAG Security

RAG security: treat every retrieved chunk as untrusted

RAG security protects retrieval-augmented generation from poisoned documents and hidden instructions. DeepintShield scores each retrieved chunk for indirect prompt injection, poisoning, personal data, secrets and source trust, then allows, redacts, rejects or quarantines it before the model reads it. Wrap the retriever you already use with one line of Python.

  • A decision for every chunk
  • LangChain, LlamaIndex or custom retrievers
  • Team plan and above
RAG security illustration: retrieved documents pass a shield check before they reach the model

Retrieval is the new attack surface

Retrieved text arrives inside the model’s context with no author you can check. That makes it an easy way in.

Indirect prompt injection

Instructions hidden inside a document, web page or email try to take control of the task.

Corpus poisoning

One planted or altered file can steer every answer that retrieves it, across many users.

Sensitive data in context

Retrieved chunks can carry personal data or secrets that should never appear in an answer.

How RAG security works

1. Your retriever returns chunks

Your pipeline retrieves as usual; DeepintShield checks what you supply and does not retrieve documents itself.

2. Each chunk is scored

Chunks are checked for injection, poisoning, personal data, secrets and source trust.

3. Policy decides per chunk

Each chunk is allowed, redacted, rejected, quarantined or passed with a warning.

4. The model sees the result

Context is built only from the returned chunks, so rejected text never reaches the model.

RAG security features

Controls for ingestion, retrieval and response, in the pipeline you already run.

Per-chunk decisions

Allow, redact, reject, quarantine or warn on each chunk, with severity levels from low to critical.

One-line retriever guard

guard_retriever() wraps LangChain, LlamaIndex or custom retrievers; guard_embedder() checks content at ingestion.

Trust and injection thresholds

Set a minimum source trust score and a maximum injection score for each policy you publish.

Three policy scopes

Apply policies at ingestion, retrieval and response, with an option that requires citations.

Shadow mode first

Run RAG policies in shadow mode to see decisions on real traffic before they change any context.

Verified provenance for agents

On Business and above, add verified provenance for agents and export evidence and control coverage.

RAG Security checks content, not access rights. Keep document permissions in your retriever.

Per-chunk decisions before the model reads anything

Call shield.rag.filter() or a guarded retriever, and DeepintShield returns the chunks that passed, with redacted copies where policy rewrote them. Build the model’s context from that returned list. A common integration mistake is to log the evaluation and keep using the original chunks, which undoes the protection.

  • Evidence mapped to OWASP LLM Top 10, MITRE ATLAS and NIST AI RMF
  • Live RAG evaluation on Team and above
  • Identify each chunk’s source by ID or name
RAG security pipeline: checkpoints flag and filter retrieved content before it reaches the model

Add RAG security to your existing retriever

Install the Python SDK (Python 3.10 or newer) and wrap the retriever you already use with shield.rag.guard_retriever(). Use guard_embedder() to check content before it is embedded, or call shield.rag.evaluate() and filter() directly for custom pipelines. The same SDK routes model calls through the AI gateway.

Install
python -m pip install --upgrade "deepintshield==3.2.3"

Mapped to

  • OWASP LLM Top 10
  • MITRE ATLAS
  • NIST AI RMF

Product facts

  • Allow, redact, reject, quarantine, warn
  • Ingestion, retrieval and response scopes
  • Shadow mode

RAG security questions

What is RAG security?

RAG security is the set of controls that treat retrieved content as untrusted input to a language model. DeepintShield scores each chunk and applies a per-chunk decision before the model sees it, alongside the prompt and response checks in Runtime Guardrails & PII.

What is indirect prompt injection?

Indirect prompt injection is an instruction hidden in content the model reads, such as a document, web page or tool result, rather than in the user's prompt. The text tries to change the task or trigger an action the user never asked for. See how to protect a RAG assistant.

Does it work with LangChain and LlamaIndex?

Yes. guard_retriever() wraps LangChain, LlamaIndex and custom retrievers in one line, and guard_embedder() covers ingestion. The SDK does not retrieve or embed documents for you; it checks what your pipeline supplies. Read the RAG SDK reference.

Does routing model calls through the gateway check my retrieval?

No, retrieval checks happen where chunks enter your pipeline. The RAG API evaluates the chunks your application submits, so routing inference through the gateway alone does not inspect local retrieval results. Add a guarded retriever, or call shield.rag.filter() before you build the prompt, and test that rejected text never reaches the model.

Does RAG security decide who can read a document?

No, it checks content, not access rights. Keep permission checks in your retriever so a user only receives documents they may read. For agent actions, Agentic Security adds relationship-based authorization with OpenFGA.

Which plan do I need?

Live RAG evaluation needs the Team plan or above. Verified provenance for agents and evidence and control-coverage export need Business or above. Compare plans.

Further reading on RAG security

Stop poisoned context before the model reads it

Start free and add RAG Security on the Team plan, or book a demo with your own documents.

Start For Free