RAGShield is a security research and red-teaming framework for Retrieval-Augmented Generation pipelines. It provides an intentionally instrumented test environment with modular attack vectors (Corpus Poisoning, Indirect Prompt Injection, Tool Hijacking, Latent Backdoors) alongside defensive mitigation layers.
- Corpus Integrity Verification: Semantic hash chaining and provenance tracking on ingested knowledge chunks.
- Perplexity & Token Anomaly Filters: Detects high-entropy injected instructions embedded in retrieved passages.
- Tool-Call Guardrails: Validates that LLM tool invocations conform to strict schema boundaries and authorization scopes.
# Run security red-teaming benchmark against standard RAG pipeline
python main.py --benchmark --defenses activepytest tests/ -v