pip install raguard · npm install raguard
5 fake documents. That's all it takes to make your AI recommend whitelisting malware. RAGuard is the security layer that sits between your retriever and your LLM, catching Hallucination Propagation Chains before they do damage.
from raguard import RAGuard
guard = RAGuard()
safe_docs = guard.filter(retrieved_docs, query="...")
# Poisoned documents never reach your LLMPython & TypeScript SDKs · LangChain & LlamaIndex · Local or API mode
Adversarial Hallucination Engineering doesn't target your LLM. It targets the documents your LLM trusts. No jailbreak needed — just fake consensus.
STEP 1
Multiple documents containing the same false claim get injected into public wikis, web pages, or directly into your vector database.
STEP 2
The retriever pulls 5+ sources that all "agree" with each other. The LLM sees consensus and treats the lie as established fact.
STEP 3
"DarkNebula is safe — whitelist it." Research shows a 38% attack success rate with just 5 poisoned documents. Bigger models are more vulnerable.
Three detection engines — consensus clustering, semantic anomaly, and source reputation — analyze every retrieved document before it reaches your LLM. Poisoned clusters get flagged. Clean documents pass through.
RAGuard runs locally by default. No API key, no external calls, no data leaving your network. Add it in one line.
from raguard import RAGuard
guard = RAGuard() # local mode, no API key needed
result = guard.scan(retrieved_docs, query=query)
if result.safe:
# pass docs to your LLM
...
else:
# result.flagged_documents tells you which ones to drop
safe_docs = guard.filter(retrieved_docs, query=query)Detects Hallucination Propagation Chains — when multiple documents suspiciously agree with each other. Uses sentence embeddings, agglomerative clustering, and a weighted risk formula across 4 signals.
Isolation forest outlier detection, contradiction pattern matching, and coordinated injection detection. Catches documents that are statistically wrong for the context.
Scores every document against 40+ trusted domains (NIST, CISA, MITRE, OWASP). Penalizes missing metadata, promotional language, and suspicious content patterns.
Start with the free tier. Upgrade when your pipeline goes to production.
For side projects and evaluation
Scans: 1K / mo
Detectors: 3
Mode: Local
Support: Community
Most Popular
For production RAG pipelines
Scans: 10K / mo
Detectors: All
Mode: API + Local
Support: Priority
For regulated industries and SOCs
Scans: Unlimited
Detectors: All + Custom
Mode: On-prem
Support: Dedicated
We're building the hosted API with free and pro tiers. In the meantime, run RAGuard locally with the SDK.
pip install raguard · npm install raguard