skillfed

llm-guard

LLM-Guard is a comprehensive tool designed to fortify the security of Large Language Models (LLMs). 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.

llm-guard v0.3.16 211.8K downloads/30d#9,474 on PyPI3,202
License unclear The MIT License (MIT) Copyright (c) Protect AI. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) Abandoned released

What it is and what it does

LLM Guard is a security toolkit that scans both user inputs (prompts) and model outputs to detect and mitigate threats in Large Language Model interactions. It offers multiple scanning strategies including prompt injection detection, PII anonymization, secret detection, toxicity analysis, and output validation for harmful content, code injection, and factual consistency. The package integrates with popular LLM APIs and is designed for production deployment.

The package depends on 12 runtime libraries spanning NLP (nltk, transformers, tiktoken), data anonymization (presidio-analyzer, presidio-anonymizer, faker), and ML inference (torch). However, the project is now abandoned—its repository is archived and the last commit was 2026-07-08, meaning no new features, bug fixes, or security patches will be released. For teams considering adoption, this means relying on a static codebase for an inherently security-sensitive tool.

Use it for:

  • Scan user prompts before sending to a production LLM API to block prompt injection and data exfiltration attempts
  • Anonymize personally identifiable information in user inputs and deanonymize model outputs to comply with privacy requirements
  • Detect and filter toxic, biased, or harmful language in both prompts and LLM responses
  • Validate LLM outputs for code injection, malicious URLs, and factual consistency before returning to users
  • Enforce organizational policies by banning specific topics, competitors, or substrings in LLM interactions

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

LLM Guard provides input and output scanning for Large Language Models to detect and prevent prompt injection, data leakage, harmful language, and other security threats.

No—not for new projects. While the package is feature-rich and has low install friction, its abandoned status (archived repo, no commits since 2026-07-08) is disqualifying for security-sensitive work. An unmaintained firewall cannot be trusted to defend against evolving threats. Consider it only if you have a specific, time-bounded use case and can fork and maintain it yourself.

Install

llm-guard on PyPI

pip

pip install llm-guard

uv

uv add llm-guard

poetry

poetry add llm-guard

Installing llm-guard

Before you install

Low install friction with a pure-Python wheel, but the package is abandoned as of the latest commit on 2026-07-08. The 12 runtime dependencies include heavy libraries (torch, transformers, tiktoken) that will pull in substantial downloads; base functionality requires fewer, with advanced features auto-installing as needed.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it legally straightforward to adopt—though the abandoned status means no upstream security patches or maintenance.

Quickstart

pip install llm-guard

from llm_guard import scan_prompt
result = scan_prompt("user input here")

Requires Python 3.10 or higher (capped below 3.13). Heavy dependencies like torch and transformers may require significant disk space and download time.

Verify before relying

  • Whether the abandoned status affects real-world security scanning reliability or if the final release remains effective for current threat models
  • Performance characteristics and latency of scanning operations under production load
  • Compatibility of the 12 runtime dependencies with recent versions of torch, transformers, and other ML libraries

Package facts

License The MIT License (MIT) Copyright (c) Protect AI. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) (unclear)
Python support capped below the current Python release (<3.13,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 12 — bc-detect-secrets, faker, fuzzysearch, json-repair, nltk, presidio-analyzer, presidio-anonymizer, regex, tiktoken, torch, transformers, structlog
Maintenance abandoned — 452 days since the last release
Last repo commit (repository archived)
First released
Downloads 211,788/month — #9,474 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: llm_guard-0.3.16-py3-none-any.whl

Keywords: llm, language model, security, adversarial attacks, prompt injection, prompt leakage, PII detection, self-hardening, firewall

Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

llm security scanningprompt injection detectionpii detection for language modelsllm content filteringadversarial prompt defensellm firewallharmful content detection
llm-securityprompt-injectionpii-detection

More Security packages

Further reading