Skip to main content

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

GitHub stars MIT license Code style: black PyPI version Python 3.10+

What is LLM Guard?

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 --version to 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:

Supported scanners

Prompt scanners

Output scanners

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-anonymizer to ≥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.


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_guardrails_maintained-0.3.18.tar.gz (82.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_guardrails_maintained-0.3.18-py3-none-any.whl (150.9 kB view details)

Uploaded Python 3

File details

Details for the file llm_guardrails_maintained-0.3.18.tar.gz.

File metadata

File hashes

Hashes for llm_guardrails_maintained-0.3.18.tar.gz
Algorithm Hash digest
SHA256 384eb58ab336430adbd589c938c01f4c774037a986e87d83ba5fc73e511e0c3d
MD5 f8c13b6b0c7321422b829710c57c4037
BLAKE2b-256 35a35884676ce24472407f14f28c2c8ad184b6abe885fd7b4abfb2a370986d94

See more details on using hashes here.

File details

Details for the file llm_guardrails_maintained-0.3.18-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_guardrails_maintained-0.3.18-py3-none-any.whl
Algorithm Hash digest
SHA256 b94251379efa83c755e1051fe1ad89da8604d1b38fdefeddb022453b617ce427
MD5 a9a6be8801b87fe6a0b3f4bc1085c61e
BLAKE2b-256 e1507892e352610d15466f61599bdde047ae64294e854ec80e476d2e4685887a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page