LLM Guard Rails - An actively maintained security toolkit for Large Language Model interactions. Features advanced sanitization, harmful language detection, data leakage prevention, and prompt injection resistance with continuous improvements and enhancements.
Project description
LLM Guard Rails - Comprehensive Security Toolkit for LLM Interactions
About: This is an actively maintained fork of the original LLM Guard project by Protect AI. We maintain enhancements and improvements beyond the original project, ensuring continuous updates and feature development.
LLM Guard Rails is a comprehensive security toolkit designed to fortify the safety and security of Large Language Model (LLM) interactions. It provides robust protection against various attack vectors and malicious inputs with actively maintained enhancements.
Documentation | PyPI Package | Original Project | Getting Started
What is LLM Guard?
By offering sanitization, detection of harmful language, prevention of data leakage, and resistance against prompt injection attacks, LLM-Guard ensures that your interactions with LLMs remain safe and secure.
Installation
Begin your journey with LLM Guard Rails by downloading the package:
pip install llm-guardrails-maintained
Or install from source:
git clone https://github.com/Nikhilsinghbora/llm-guardrails.git
cd llm-guardrails
pip install -e .
Getting Started
Requirements & Notes:
- Python: 3.10, 3.11, 3.12, 3.13, or 3.14 (
python --versionto verify) - Production-Ready: Designed for easy integration in production environments with continuous improvements
- Minimal Dependencies: Base functionality requires minimal libraries; advanced features auto-install as needed
- Troubleshooting: If you encounter installation issues, upgrade pip:
python -m pip install --upgrade pip
Quick Examples:
- OpenAI Integration - Secure ChatGPT interactions
- LangChain Integration - LLM protection with LangChain
- API Deployment - Deploy as a service
- More Examples - Amazon Bedrock, Google Gemini, and streaming examples
Supported scanners
Prompt scanners
- Anonymize
- ATRScanner ⭐ NEW
- BanCode
- BanCompetitors
- BanSubstrings
- BanTopics
- Code
- Gibberish
- InvisibleText
- Language
- PromptInjection
- Regex
- Secrets
- Sentiment
- TokenLimit
- Toxicity
Output scanners
- ATRScanner ⭐ NEW
- BanCode
- BanCompetitors
- BanSubstrings
- BanTopics
- Bias
- Code
- Deanonymize
- JSON
- Language
- LanguageSame
- MaliciousURLs
- NoRefusal
- ReadingTime
- FactualConsistency
- Gibberish
- Regex
- Relevance
- Sensitive
- Sentiment
- Toxicity
- URLReachability
Community, Contributing, Docs & Support
LLM Guard Rails is an open source solution maintained as an active fork of the original LLM Guard project. We are committed to a transparent development process and highly appreciate any contributions. Whether you are helping us fix bugs, propose new features, improve our documentation or spread the word, we would love to have you as part of our community.
How We Differ
- Active Development: We maintain and release updates more frequently than the original project
- Feature Requests Welcome: We actively review and implement community feature requests
- Responsive Maintenance: Issues and PRs receive timely reviews and updates
Recent Improvements & Updates
Security & Bug Fixes:
- ✅ Fixed CVE-2026-26007: Updated
presidio-anonymizerto ≥2.2.362 - ✅ Fixed critical transformers vulnerability (GHSA-phhr-52qp-3mj4)
- ✅ Fixed Anonymize scanner to properly respect language parameter (#337)
- ✅ Fixed PromptInjection tokenizer initialization bug (#331)
- ✅ Fixed MaliciousURLs missing top_k parameter TypeError (#318)
New Features & Enhancements:
- ✅ Python 3.13+ Support: Full compatibility with Python 3.13 and 3.14
- ✅ ATRScanner: New Agent Threat Rule scanner with 10+ built-in detection patterns
- ✅ ThresholdMixin: Dynamically adjust scanner sensitivity without model reloading
- ✅ Model.from_local(): Factory method for locally-downloaded HuggingFace models
- ✅ Improved dependency management for better compatibility
Get Involved
- Give us a ⭐️ github star ⭐️ on the top of this page to support what we're doing, it means a lot for open source projects!
- Read our docs for more info about how to use and customize LLM Guard Rails, and for step-by-step tutorials.
- Post a Github Issue to submit a bug report, feature request, or suggest an improvement.
- To contribute to the package, check out our contribution guidelines, and open a PR.
Support & Contact
We're eager to provide personalized assistance and discuss feature requests or improvements.
- Send Email ✉️ - Open to feature requests, improvements, and collaboration
- GitHub Issues - Report bugs or request features
- GitHub Discussions - Ask questions and share ideas
Acknowledgments
This project is a maintained fork of the excellent LLM Guard by Protect AI. We maintain this fork to provide:
- Active Security Updates: Prompt patches for CVEs and security vulnerabilities
- Regular Bug Fixes: Community-reported issues resolved quickly
- New Features: Enhancement requests implemented with community feedback
- Continuous Support: Regular releases and dependency updates
The original LLM Guard project by Protect AI deserves recognition for building this solid foundation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_guardrails_maintained-0.3.18.tar.gz.
File metadata
- Download URL: llm_guardrails_maintained-0.3.18.tar.gz
- Upload date:
- Size: 82.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
384eb58ab336430adbd589c938c01f4c774037a986e87d83ba5fc73e511e0c3d
|
|
| MD5 |
f8c13b6b0c7321422b829710c57c4037
|
|
| BLAKE2b-256 |
35a35884676ce24472407f14f28c2c8ad184b6abe885fd7b4abfb2a370986d94
|
File details
Details for the file llm_guardrails_maintained-0.3.18-py3-none-any.whl.
File metadata
- Download URL: llm_guardrails_maintained-0.3.18-py3-none-any.whl
- Upload date:
- Size: 150.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b94251379efa83c755e1051fe1ad89da8604d1b38fdefeddb022453b617ce427
|
|
| MD5 |
a9a6be8801b87fe6a0b3f4bc1085c61e
|
|
| BLAKE2b-256 |
e1507892e352610d15466f61599bdde047ae64294e854ec80e476d2e4685887a
|