llm-guard

protectai/llm-guard

The Security Toolkit for LLM Interactions

3.2k
Stars
416
Forks
37
Open issues
28
Watchers
Python MITLast pushed Dec 15, 2025

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

Install

pip install llm-guard

README

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

Join Our Slack Community

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

Output scanners