Our take
- Activity
- 20
- Community
- 44
- Issues
- 21
- Pull requests
- 21
+2 stars in the last 7 days
Overview
LLM Guard is a Python toolkit that places configurable checks around interactions with large language models. It aims to reduce risks in both user input and model output, including prompt injection, harmful language, and data leakage.
It is relevant to developers building LLM applications who need scanning and sanitization components. The repository is archived and no longer maintained, so it is not a good default for new production deployments without a plan to maintain or replace it.
Key Features
- Scans prompts for prompt injection, secrets, toxicity, and other input concerns.
- Checks generated output for risks including sensitive content, malicious URLs, bias, and toxicity.
- Provides scanners for content rules such as banned topics, substrings, languages, and code.
- Includes output checks for JSON validity, factual consistency, relevance, and URL reachability.
- Supports Python integration and documents deployment as an API.
- Offers optional advanced functionality with additional libraries installed as needed.
Use Cases
- LLM application developers can add input screening before sending user prompts to a model.
- Teams can review model responses for sensitive data, harmful language, or formatting requirements before returning them to users.
- Security engineers can evaluate a set of scanners while prototyping defenses for prompt injection and data leakage.
- Maintainers of existing LLM Guard integrations can consult its documentation and source when assessing migration or maintenance needs.
Getting Started
Install the package:
pip install llm-guard
See the README and documentation for usage details.
Considerations
- The project is archived and its README states that it is no longer actively developed or maintained. Treat it as an unmaintained dependency, particularly in production security workflows.
- Python 3.9 or higher is required, according to the README.
- Some advanced functionality may install additional libraries. Check the relevant scanner requirements before deployment.
- Security scanners can be part of a defense-in-depth approach, but this repository does not establish that any particular configuration will prevent all LLM risks.
Found this useful?
Share it with someone who would like llm-guard.