LLM Guard
0.3.14 open-sourceThe section your link pointed to isn't on LLM Guard's page any more, so we've brought you to the top.
LLM Guard is a security toolkit for LLM interactions offering sanitization, harmful language detection, data leakage prevention, and prompt injectionprompt injectionAn attack where text the model reads, such as a web page, file or tool result, carries instructions that override the user's. It is the main security risk for agents with tools. resistance.
from llm_guard.scanners import BanCode
scanner = BanCode()
sanitized_prompt, scores, result = scanner.scan(prompt)
curl -X POST http://localhost:8000/scan/prompt -d '{"prompt": "user input"}'
gunicorn -w 4 app:app
from llm_guard.input_scanners import Gibberish
scanner = Gibberish()
sanitized_prompt, result, score = scanner.scan(prompt)
from llm_guard.input_scanners import Anonymize
scanner = Anonymize(patterns=[{"name": "credit_card", "pattern": r'\d{4}-\d{4}-\d{4}-\d{4}'}])
sanitized_prompt, result, score = scanner.scan(prompt)
from llm_guard.input_scanners import Anonymize
scanner = Anonymize(model_path="/local/path/to/model")
sanitized_prompt, result, score = scanner.scan(prompt)
NoRefusal(match_type="sentence")
auth:
type: basic
username: admin
password: secret
rate_limit:
enabled: true
max_requests: 100
result = Anonymize(text, languages=["zh"])
llm-guard scan --tool deanonymize --device cuda
scanner = PromptInjection(use_onnx=True)
from llm_guard.output_scanners.regex import Regex
scorer = Regex(r'\d{4}-\d{4}-\d{4}-\d{4}')
from llm_guard.input_scanners.code import Code
scorer = Code(threshold=0.85)
scanner = InvisibleText()
result = scanner.scan_input(prompt)
Summary
LLM Guard is an open-source Python library, MIT-licensed, that scans prompts and LLM outputs for prompt injection, harmful language, and data leakage before they cause damage, and it's installed via pip and called directly from application code rather than run as a standalone service. It's aimed at developers building LLM-powered applications who need to sanitize inputs and outputs at the point of integration, and it fits the broader category of guardrail and content-filtering layers that sit between an application and its model provider. The project, maintained by Protect AI, has drawn 25 contributors since its first commit in 2023, but its README now carries an archive notice stating it is no longer under active development, so while the package remains installable, anyone evaluating it should treat it as frozen rather than a going concern.
LLM Guard is a security toolkit for LLM interactions offering sanitization, harmful language detection, data leakage prevention, and prompt injection resistance.
How LLM Guard helps
Which prompts in my application are attempting a jailbreak or injection before they reach the model?
scans each incoming prompt against its injection and jailbreak detectors and flags or blocks the ones that match, at the point the prompt enters application code
Is a piece of user input trying to smuggle out or extract sensitive data through the model?
runs the input through its data-leakage and sensitive-content scanners and reports which pattern triggered, before the call is sent to the provider
Does this model's response contain toxic or harmful language before it reaches my users?
passes the generated output through its harmful-language and toxicity scanners and returns a verdict the calling code can act on before displaying it
Is my customer's personal or secret data leaking out through the model's answer?
checks outbound responses against its data-leakage detectors and flags matches so the application can redact or block them before returning the response
Should I keep building my sanitization layer on this library?
the README carries an archive notice stating the project is no longer under active development, so the package still installs but new detectors or fixes will not appear
Languages
Command line
No command matches.
| option | found in | since | description |
|---|
Values are placeholders taken from each option’s declared default. Nothing is executed here — the output shown is a recording of a run that already happened.
Score card
-
Shipping velocity releases a month, last 12 months
-
Documentation quality release-notes rubric, 0–100
-
Breaking-change discipline how rarely a release breaks users, and notice given
-
Maintenance risk quiet time against its own cadence, maintainers
-
Innovation & surface new capabilities, API and MCP surface
- Community health
-
Contributor trend distinct committers, this year against last
-
Maintainer concentration bus factor now against a year ago
-
Issue backlog trend issues closed per issue opened, 12 months
-
Responsiveness median time to a maintainer’s first reply
Nine scores for LLM Guard, each built from the releases, notes and API history this site tracks — and, on Researcher and Business, where it stands among every measured tool in its category and how that has moved.
Score cards are part of every paid plan.
See plans → Already subscribed? Sign in →Trajectory
Blank means never measured; nothing here is a filled-in zero.
Peer standings are included with Researcher and Business. See how this tool ranks against its competitors, using data we don't publish anywhere else.
See plans →Each score is 0–100 on a published rubric, derived from data this site already shows. A dimension we cannot measure says so — it is never scored 0 and never enters a rank.
How this is scored
- Shipping velocity — releases a month over the last 12 months, on a log scale where 16 a month scores 100. Needs 3 releases in the window.
- Documentation quality — the release-notes rubric published on the analytics page, unchanged.
- Breaking-change discipline — the share of releases carrying a breaking change (none scores 100, half or more scores 0). Only projects that label breaking changes are measured: a clean record cannot be told from an unlabelled one.
- Maintenance risk — quiet time measured against the tool's own release cadence (quiet longer than 90 days and three typical gaps scores 0), plus the number of active maintainers and whether contributors are growing, where known. Higher is lower risk.
- Innovation & surface — new capabilities in the feature ledger this year, API and MCP operations added, and the share of commits that are features: the mean of whichever we hold.
- Community health (open-source tools only) — each is a direction, not a size: contributors this year against last, the bus factor now against a year ago, and issues closed per issue opened, where steady scores 50, doubled 100 and halved 0; plus the median time to a maintainer's first reply (an hour scores about 100, a month or more 0). A commercial card has no repository and carries none of the four.
- Documented delivery (commercial tools) — when a vendor's documented new capabilities have slowed against its own baseline, that counts against the overall standing as heavily as two low dimensions. Steady delivery, or too little history to judge, leaves the standing alone; it is never a sixth score.
- Open-source tools are scored on repository signals; commercial tools on their published changelog. Ranks compare tools within one category and one profile and need at least five measured peers; the overall standing needs three ranked dimensions. Best-in-breed or consolidator is a shape, not a quality, and is never scored.
Release-note detail over time
See how much detail LLM Guard puts in its release notes, quarter by quarter, and compare it with tracked tools in the same category. This history uses up to ten retained, reviewed notes per tool; sparse or blank older quarters may reflect that limit.
Checking release-note history…
Releases
15 entries
No entries match these filters.
- June 20241
- April 20241
- March 20241
- February 20241
- December 20231
- November 20232
- October 20232
- September 20233
- August 20232
- January 20231
Project health
Issue, contributor and maintainer activity in protectai/llm-guard, 2023-10 – 2026-09, as of 2026-09-25. Twelve-month figures first; the trend lines run the whole window.
- Contributors 1 −7 vs prior 12 months
- Maintainers 0 +0 joined · −2 left, last 12 months
- Bus factor 0 committers behind half the commits
- Community-filed 100% of issues opened, last 12 months
- Median time to close 193 days first maintainer reply 22 days
- Open backlog 12 of 116 issues ever filed
- Issues opened / month 0 · 0 communitymaintainers
- Open backlog 12
- Contributors / month 0
- Commits / month 0
- Stars 3,205
- other 100%
Counts from the project's public repository and git history; no individuals are identified. Maintainers are the committers covering 80% of the last year's commits. how we measure this
Add the badge to your README
Maintain this project? The badge links readers straight to this page, so they can follow every release here.