Secure your
RAG pipelines
Your RAG system retrieves documents from various sources. PromptGuard ensures retrieved content doesn't contain hidden malicious instructions.
Where a RAG pipeline is exposed
- 01
Untrusted-Content Marking
Wrap retrieved chunks in provenance markers before the model reads them, so an instruction inside a document cannot read as an instruction from you. Measured 47-100% reduction in adaptive attack success across six frontier models, at no measurable utility cost. Opt-in, per project.
- 02
Document Scanning
Scan retrieved documents for hidden instructions, invisible text, and other indirect prompt injection techniques.
- 03
Source Validation
Validate document sources and flag content from untrusted or potentially compromised sources.
- 04
Content Sanitization
Clean retrieved content to remove potential threats while preserving useful information.
- 05
Embedding Protection
Protect your vector database from poisoning attacks that could inject malicious content.
- 06
Query Protection
Scan user queries for injection attempts before they reach your retrieval system.
- 07
Response Validation
Ensure LLM responses based on retrieved content don't leak sensitive information.
Why PromptGuard for RAG?
- Specialized indirect injection detection
- Document-level threat scanning
- Vector DB poisoning protection
- Full pipeline security
- Works with any RAG framework
How it works for RAG
- 01
Query
User query comes in. PromptGuard scans for injection attempts before retrieval.
- 02
Retrieve & Scan
Documents are retrieved from your vector DB. Each document is scanned for hidden threats.
- 03
Generate Safely
Clean, validated context is passed to the LLM. Response is validated before returning.
Secure a RAG pipeline
from promptguard import PromptGuard
from langchain.retrievers import VectorStoreRetriever
pg = PromptGuard(api_key="your-api-key")
# Retrieve documents
documents = retriever.get_relevant_documents(query)
# Scan each document for hidden threats
safe_documents = []
for doc in documents:
scan_result = pg.scrape.scan(
content=doc.page_content,
content_type="text/plain"
)
if scan_result.is_safe:
safe_documents.append(doc)
else:
print(f"⚠️ Blocked document: {scan_result.threats}")
# Use only safe documents for generation
response = llm.generate(context=safe_documents, query=query)The controls this sector runs on
Secure your RAG pipeline
Stop indirect prompt injection attacks. Protect your knowledge base and your users.