PAGES
← all tools
◆ AI Runtime Defense & Guardrails

LLM Guard

0.3.14 open-source

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.

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

all 21 features, with the evidence for each →

Languages

Not documented

Features

21 capabilities · 3 backed by code, an API document or a real run

Built from LLM Guard's releases, docs, README and our own runs. “Seen” marks the month we first spotted a release the vendor didn't date. Group names and tags are our labels.

Compare with peers →

What LLM Guard offers you

  • ML-based detection2
  • Command-line interface1
  • REST API1
All capabilities 21 capabilities
Configuration file support verified Accepts a path to a configuration file to control tool behaviour. 37 releases · 8 other sources · first seen Jan 2023

release 37 total

  • Adds NoRefusalLight scanner to detect refusal using common phrases 0.3.12 · Apr 2024 · source · release history
  • NoRefusal: Adds match_type parameter (values: sentence, all) to control matching scope 0.3.9 · Feb 2024 · source · release history
  • API: Adds rate limiting configuration via auth section in config 0.3.9 · Feb 2024 · source · release history
  • The Anonymize scanner no longer uses the dbmdz/bert-large-cased-finetuned-conll03-english model. 0.3.4 · Dec 2023 · source · release history
  • Deanonymize scanner now supports configurable matching strategies. 0.3.4 · Dec 2023 · source · release history
  • Adds ONNX runtime support on GPU for the Deanonymize scanner, enabling faster inference. 0.3.4 · Dec 2023 · source · release history

command line

example 7 total

  • Scan prompts allowing only sentence-level refusal matches for finer granularity. NoRefusal(match_type="sentence") 0.3.9 · Feb 2024 · source
  • Enable API authentication with basic auth and rate limiting in config file. auth: type: basic username: admin password: secret rate_limit: enabled: true max_requests: 100 0.3.9 · Feb 2024 · source
  • Run the Deanonymize scanner using the ONNX runtime on a GPU device. llm-guard scan --tool deanonymize --device cuda 0.3.4 · Dec 2023 · source
  • Enable ONNX runtime for faster CPU inference in a specific scanner. scanner = PromptInjection(use_onnx=True) 0.3.1 · Nov 2023 · source
  • Tune the false-positive rate for code snippet detection by setting a custom threshold. from llm_guard.input_scanners.code import Code scorer = Code(threshold=0.85) 0.2.1 · Sep 2023 · source
  • Redact credit card numbers (16 digits) from LLM output using the new Regex scanner capabilities. from llm_guard.output_scanners.regex import Regex scorer = Regex(r'\d{4}-\d{4}-\d{4}-\d{4}') 0.2.1 · Sep 2023 · source
Server deployment configuration shipped Configures the embedded server with advanced options for authentication, rate limiting, caching, WSGI/ASGI servers (Gunicorn/Uvicorn), and resource management. 5 releases · first seen Feb 2024

release

  • Allows custom uvicorn configuration in the API deployment. 0.3.14 · Jun 2024 · source · release history
  • Adds lazy loading of models in the API deployment 0.3.12 · Apr 2024 · source · release history
  • Adds support for gunicorn in the API deployment 0.3.12 · Apr 2024 · source · release history
  • API configuration changes with separate sections for auth, rate_limit and cache 0.3.9 · Feb 2024 · source · release history
  • API: Adds HTTP basic authentication and API key authentication endpoints 0.3.9 · Feb 2024 · source · release history
Data anonymization and PII detection shipped Detects and masks sensitive information (PII) in input or output text using regex patterns, NER models, and language-specific support. 3 releases · 2 other sources · first seen Feb 2024

release

  • Adds support for Isotonic/distilbert_finetuned_ai4privacy_v2 and Isotonic/deberta-v3-base_finetuned_ai4privacy_v2 NER models for the Anonymize capability. 0.3.10 · Mar 2024 · source · release history
  • Anonymize: Adds new regex patterns PO_BOX_RE, PRICE_RE, HEX_COLOR, TIME_RE, DATE_RE, URL_RE, PHONE_NUMBER_WITH_EXT, BTC_ADDRESS for data masking 0.3.9 · Feb 2024 · source · release history
  • Anonymize: Adds Chinese (zh) language support to Anonymize function 0.3.9 · Feb 2024 · source · release history

example

  • Configure the Anonymize scanner patterns using Python configuration. 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) 0.3.10 · Mar 2024 · source
  • Anonymize Chinese text to replace PII entities. result = Anonymize(text, languages=["zh"]) 0.3.9 · Feb 2024 · source
Model loading flexibility shipped Allows scanners to load models from local folders instead of relying exclusively on remote repositories. 2 releases · 2 other sources · first seen Mar 2024

release

  • Adds local folder model loading support to the API 0.3.12 · Apr 2024 · source · release history
  • Enables loading models from local folders instead of requiring HuggingFace access. 0.3.10 · Mar 2024 · source · release history

example

  • Scan a prompt without sanitizing it for faster inference via the new API endpoint curl -X POST http://localhost:8000/scan/prompt -d '{"prompt": "user input"}' 0.3.12 · Apr 2024 · source
  • Configure the Anonymize scanner patterns using Python configuration. 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) 0.3.10 · Mar 2024 · source
Prompt injection detection shipped Detects adversarial prompt injection attempts in input prompts using dedicated scanner models. 3 releases · 1 other source · first seen Nov 2023

Also counts toward: ML-based detection, REST API

release

  • Adds POST /scan/prompt endpoint to scan prompts without sanitizing them 0.3.12 · Apr 2024 · source · release history
  • Switches PromptInjection scanner to use deepset/deberta-v3-base-injection model. 0.3.1 · Nov 2023 · source · release history
  • Removes the PromptInjectionV2 scanner; users must now use the single PromptInjection scanner. 0.3.1 · Nov 2023 · source · release history

docs

  • Sanitizes LLM interactions by detecting prompt injection, harmful language, data leakage, and toxic content in inputs and outputs.
Scanner configuration and control shipped Provides fine-grained control over scanner behavior including pipeline kwargs, model parameters, and selective suppression of scanners. 2 releases · first seen Mar 2024

release

  • Adds the ability to suppress specific scanners during analysis in the API. 0.3.14 · Jun 2024 · source · release history
  • Allows passing pipeline and model kwargs to scanners for better control. 0.3.10 · Mar 2024 · source · release history
Code injection detection shipped Scans prompts to identify and detect the presence of code snippets or programming languages. 1 release · 1 other source · first seen Apr 2024

release

  • Adds BanCode scanner to detect and block code snippets in the prompt 0.3.12 · Apr 2024 · source · release history

example

  • Detect and block code snippets in user prompts using the new scanner from llm_guard.scanners import BanCode scanner = BanCode() sanitized_prompt, scores, result = scanner.scan(prompt) 0.3.12 · Apr 2024 · source
Embedded server verified Runs a local server on a configurable port. 2 other sources · first seen Apr 2024

Also counts toward: Command-line interface

command line

example

  • Configure Gunicorn to run the LLM Guard API with lazy loading support gunicorn -w 4 app:app 0.3.12 · Apr 2024 · source
Gibberish detection shipped Detects if input text consists of gibberish or nonsensical content using dedicated scanners. 1 release · 1 other source · first seen Mar 2024

release

  • Adds Gibberish scanner to detect gibberish in input text. 0.3.10 · Mar 2024 · source · release history

example

  • Scan input text to detect if it is gibberish using the new scanner. from llm_guard.input_scanners import Gibberish scanner = Gibberish() sanitized_prompt, result, score = scanner.scan(prompt) 0.3.10 · Mar 2024 · source
GPU acceleration for inference shipped Enables GPU-accelerated processing for specific scanners to improve performance. 1 release · 1 other source · first seen Sep 2023

release

  • Adds GPU inference support for scanners to accelerate processing 0.2.0 · Sep 2023 · source · release history

example

  • Run the Deanonymize scanner using the ONNX runtime on a GPU device. llm-guard scan --tool deanonymize --device cuda 0.3.4 · Dec 2023 · source
ONNX runtime support shipped Allows scanners to utilize ONNX runtime for optimized CPU or GPU inference. 1 release · 1 other source · first seen Nov 2023

release

  • Adds ONNX runtime support on GPU for the Deanonymize scanner, enabling faster inference. 0.3.4 · Dec 2023 · source · release history

example

  • Enable ONNX runtime for faster CPU inference in a specific scanner. scanner = PromptInjection(use_onnx=True) 0.3.1 · Nov 2023 · source
Factual consistency checking shipped Evaluates output for factual contradictions or refutations against known facts or prompt context. 2 releases · first seen Aug 2023

release

  • Adds ONNX inference support to BanTopics, NoRefusal, FactualConsistency, and Relevance scanners 0.3.2 · Nov 2023 · source · release history
  • Adds Refutation output scanner for factual consistency checking 0.1.0 · Aug 2023 · source · release history
Langchain integration support shipped Offers examples and updates for integrating the tool with Langchain using LCEL. 2 releases · first seen Oct 2023

release

  • Provides an up-to-date Langchain integration using LCEL 0.3.2 · Nov 2023 · source · release history
  • Adds Langchain LCEL integration example demonstrating expression language usage 0.2.4 · Oct 2023 · source · release history
Malicious URL detection shipped Identifies and flags malicious URLs present within model outputs. 2 releases · first seen Aug 2023

Also counts toward: ML-based detection

release

  • Switches the MaliciousURLs scanner to use the DunnBC22/codebert-base-Malicious_URLs model 0.3.2 · Nov 2023 · source · release history
  • Adds MaliciousURLs output scanner to detect malicious URLs in model outputs 0.1.0 · Aug 2023 · source · release history
Scanner benchmarking verified Runs benchmarks against named scanner classes, with options to specify the scanner name and type. 2 other sources · first seen Nov 2023

command line

Language detection and matching shipped Detects the language of prompts and outputs, or verifies that they match. 2 releases · first seen Oct 2023

release

  • Adds LanguageSame output scanner to verify prompt and output languages match 0.3.0 · Oct 2023 · source · release history
  • Adds Language scanners for both prompt and output 0.3.0 · Oct 2023 · source · release history
Secrets detection in prompts shipped Scans input prompts for sensitive secrets or personally identifiable information. 2 releases · first seen Aug 2023

release

  • Introduces new secrets detectors for identifying sensitive information in prompts or outputs 0.2.4 · Oct 2023 · source · release history
  • Adds Secrets prompt scanner to detect secrets in prompts 0.1.0 · Aug 2023 · source · release history
Tracing and metrics integration shipped Supports OpenTelemetry for distributed tracing and performance metrics within the API. 1 release · first seen Feb 2024

release

JSON repair and validation shipped Validates output JSON structure and attempts to repair broken JSON formats. 1 release · first seen Oct 2023

release

  • Adds JSON output scanner capable of repairing broken JSON 0.3.0 · Oct 2023 · source · release history
Streaming demo application shipped Provides a Streamlit-based interactive demo application hosted on HuggingFace. 1 release · first seen Sep 2023

release

  • Includes a Streamlit demo application deployed to HuggingFace Spaces 0.2.0 · Sep 2023 · source · release history
Risk scoring for scanners shipped Provides a configurable risk score between 0 and 1 for scanner results. 1 release · first seen Aug 2023

release

  • Introduces risk score (0-1) for all prompt and output scanners 0.1.0 · Aug 2023 · source · release history

Lines in monospace are the tool's own words: help text parsed from its source, or an endpoint from its API document. Under release, a line is our summary of a dated release. Under docs, it is quoted from the tool's own documentation or website. Each links back to the source it came from.

Score card

  1. Shipping velocity releases a month, last 12 months
  2. Documentation quality release-notes rubric, 0–100
  3. Breaking-change discipline how rarely a release breaks users, and notice given
  4. Maintenance risk quiet time against its own cadence, maintainers
  5. Innovation & surface new capabilities, API and MCP surface
  6. Community health
  7. Contributor trend distinct committers, this year against last
  8. Maintainer concentration bus factor now against a year ago
  9. Issue backlog trend issues closed per issue opened, 12 months
  10. 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 →

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…

Explore the full chart →

Releases

Show

15 entries

  1. June 20241
  2. April 20241
  3. March 20241
  4. February 20241
  5. December 20231
  6. November 20232
  7. October 20232
  8. September 20233
  9. August 20232
  10. January 20231
    Show

    15 entries

    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.

    1. Contributors 1 −7 vs prior 12 months
    2. Maintainers 0 +0 joined · −2 left, last 12 months
    3. Bus factor 0 committers behind half the commits
    4. Community-filed 100% of issues opened, last 12 months
    5. Median time to close 193 days first maintainer reply 22 days
    6. Open backlog 12 of 116 issues ever filed
    1. Issues opened / month 0 · 0 communitymaintainers
    2. Open backlog 12
    3. Contributors / month 0
    4. Commits / month 0
    5. Stars 3,205
    Issue themes, last 12 months
    • 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.

    Tracked by Cyber Toolchain Choose a badge style and copy the code →
    browse all tools → score card for your toolchain →