Skip to main content

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.

Metadata

Release files for llm-guardrails-maintained 0.3.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-guardrails-maintained 0.3.18
File Size Uploaded
llm_guardrails_maintained-0.3.18.tar.gz 82.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-guardrails-maintained 0.3.18
File Interpreter ABI Platform
llm_guardrails_maintained-0.3.18-py3-none-any.whl Python 3 none any Details

Total release size: 233.5 kB

Release files / llm_guardrails_maintained-0.3.18.tar.gz

Download URL llm_guardrails_maintained-0.3.18.tar.gz
Size 82.6 kB
Tags Source
SHA-256 checksum
How to use checksums
384eb58ab336430adbd589c938c01f4c774037a986e87d83ba5fc73e511e0c3d
BLAKE2b-256 checksum
How to use checksums
35a35884676ce24472407f14f28c2c8ad184b6abe885fd7b4abfb2a370986d94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / llm_guardrails_maintained-0.3.18-py3-none-any.whl

Download URL llm_guardrails_maintained-0.3.18-py3-none-any.whl
Size 150.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b94251379efa83c755e1051fe1ad89da8604d1b38fdefeddb022453b617ce427
BLAKE2b-256 checksum
How to use checksums
e1507892e352610d15466f61599bdde047ae64294e854ec80e476d2e4685887a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.3.18 This release

2 release files

0.3.17

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page