
Indirect Prompt Injection: Protect Retrieved Content
Indirect Prompt Injection: Protect Retrieved Content An assistant may receive a perfectly ordinary request and then read a document containing instructions aimed…
Meet DeepintShield at Bengaluru Tech Summit 2026, 17 to 19 November, BIEC Hall 1, booth H1A106. Book 20 minutes
Platform · RAG Security
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.

Retrieved text arrives inside the model’s context with no author you can check. That makes it an easy way in.
Instructions hidden inside a document, web page or email try to take control of the task.
One planted or altered file can steer every answer that retrieves it, across many users.
Retrieved chunks can carry personal data or secrets that should never appear in an answer.
Your pipeline retrieves as usual; DeepintShield checks what you supply and does not retrieve documents itself.
Chunks are checked for injection, poisoning, personal data, secrets and source trust.
Each chunk is allowed, redacted, rejected, quarantined or passed with a warning.
Context is built only from the returned chunks, so rejected text never reaches the model.
Controls for ingestion, retrieval and response, in the pipeline you already run.
Allow, redact, reject, quarantine or warn on each chunk, with severity levels from low to critical.
guard_retriever() wraps LangChain, LlamaIndex or custom retrievers; guard_embedder() checks content at ingestion.
Set a minimum source trust score and a maximum injection score for each policy you publish.
Apply policies at ingestion, retrieval and response, with an option that requires citations.
Run RAG policies in shadow mode to see decisions on real traffic before they change any context.
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.
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.

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.
python -m pip install --upgrade "deepintshield==3.2.3"Mapped to
Product facts
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.
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.
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.
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.
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.
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.

Indirect Prompt Injection: Protect Retrieved Content An assistant may receive a perfectly ordinary request and then read a document containing instructions aimed…
DeepintShield team · · 5 min read

LLM Hallucination Checks: Grounding and Answer Quality A useful AI answer should address the question and show where its factual claims come…
DeepintShield team · · 5 min read

RAG Re-Ranking: Choose Useful Context for Your LLM Retrieval often returns passages about the right topic without identifying the ones that answer…
DeepintShield team · · 5 min read
Check prompts and responses for injection, jailbreaks, secrets and personal data at the same five stages.
Explore Runtime Guardrails
Score answers with five detectors and an overall risk score, on the Business plan and above.
Explore Hallucination Defense
Keep retrieved text from turning into actions: every tool call needs an exact Allow before it runs.
Explore Agentic Security
Start free and add RAG Security on the Team plan, or book a demo with your own documents.