Rebuff
StaleDescription
An LLM prompt injection detector that combines heuristics, vector similarity, and language model-based detection to identify and block malicious prompt injection attacks.
Key Features
- Multi-layered prompt injection detection with 4 defense strategies
- Heuristic filtering to catch obvious malicious inputs before LLM processing
- LLM-based analysis using a dedicated model to identify sophisticated attacks
- VectorDB-powered recognition of previously seen attack patterns
- Canary token system to detect prompt leakage and prevent data exfiltration
- Self-hardening design that learns from detected attacks to prevent future ones
Use Cases
Categories
Quick Start
1. Install: pip install rebuff
2. Initialize: from rebuff import RebuffSdk
3. Create instance: rb = RebuffSdk(openai_apikey, pinecone_apikey, pinecone_index)
4. Check input: result = rb.detect_injection(user_input)
5. For canary: buffed_prompt, canary_word = rb.add_canary_word(prompt_template)