llm-guard
protectai/llm-guard
The Security Toolkit for LLM Interactions
Overview
LLM Guard is a comprehensive security tool designed to fortify interactions with Large Language Models, providing sanitization, harmful language detection, data leakage prevention, and prompt injection resistance.
Categories
Tags
Similar tools
ollama
ollama/ollama
Get up and running with Kimi-K2.6, GLM-5.1, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
prompts.chat
f/prompts.chat
The world's largest open-source prompt library for AI
transformers
huggingface/transformers
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models
langflow
langflow-ai/langflow
Langflow is a powerful platform for building and deploying AI-powered agents and workflows.
open-webui
open-webui/open-webui
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
awesome-llm-apps
Shubhamsaboo/awesome-llm-apps
100+ AI Agent & RAG apps you can actually run — clone, customize, ship.
Install
pip install llm-guardREADME
LLM Guard - The Security Toolkit for LLM Interactions
LLM Guard by Protect AI is a comprehensive tool designed to fortify the security of Large Language Models (LLMs).
Documentation | Playground | Changelog
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 by downloading the package:
pip install llm-guard
Getting Started
Important Notes:
- LLM Guard 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.9 or higher. Confirm with:
python --version. - Library installation issues? Consider upgrading pip:
python -m pip install --upgrade pip.
Examples:
- Get started with ChatGPT and LLM Guard.
- Deploy LLM Guard as API
Supported scanners
Prompt scanners
- Anonymize
- BanCode
- BanCompetitors
- BanSubstrings
- BanTopics
- Code
- Gibberish
- InvisibleText
- Language
- PromptInjection
- Regex
- Secrets
- Sentiment
- TokenLimit
- Toxicity
Output scanners
- BanCode
- BanCompetitors
- BanSubstrings
- BanTopics
- Bias
- Code
- Deanonymize
- JSON
- Language
- LanguageSame
- MaliciousURLs
- NoRefusal
- ReadingTime
- [FactualConsi
