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 | Original Project | Getting Started

GitHub stars MIT license Code style: black PyPI - Python Version Downloads Downloads

Join Our Slack Community

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:

# Coming soon to PyPI as llm-guardrails
pip install llm-guard

Or install from source:

git clone https://github.com/Nikhilsinghbora/llm-guardrails.git
cd llm-guardrails
pip install -e .

Getting Started

Important Notes:

  • LLM Guard Rails is designed for easy integration and deployment in production environments. While it's ready to use out-of-the-box, please be informed that we're constantly improving and updating the repository.
  • Base functionality requires a limited number of libraries. As you explore more advanced features, necessary libraries will be automatically installed.
  • Ensure you're using Python version 3.10 or higher. Confirm with: python --version.
  • We fully support Python 3.10, 3.11, 3.12, 3.13, and 3.14.
  • Library installation issues? Consider upgrading pip: python -m pip install --upgrade pip.

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.

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.17.tar.gz (81.8 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.17-py3-none-any.whl (150.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llm_guardrails_maintained-0.3.17.tar.gz
Algorithm Hash digest
SHA256 0791af5b4a7d6c17db34c24564833d7a00363594d08793e99c69c3d4270aece7
MD5 4fe49677c757fad865240ba7e7d79c73
BLAKE2b-256 0a29a5b4add75a690679ea28b3a9db8f08b3f1bc86450547264713f6c74d9f3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llm_guardrails_maintained-0.3.17-py3-none-any.whl
Algorithm Hash digest
SHA256 bc676f96e9c2d7ab883611d46bef876f84b2ffaf83f29712c1753cacf5352c23
MD5 881f43b19fefd6b25388c11e29d7f52e
BLAKE2b-256 5bb63a667c47133be4d40ab10037d9b6714fd1c48302b60c2fa759236308500e

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