This is an early release preview. You may encounter bugs.
LLM Guard logo
Unclaimed

Tool security

LLM Guard

Archived security toolkit of composable input and output scanners for prompts and LLM responses

No longer maintained. The upstream repository is archived and read-only.
B 66/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
No votes yet

01 / About

What LLM Guard is.

LLM Guard is a Python toolkit from Protect AI for securing the traffic between an application and a large language model. It applies scanners to prompts before they reach the model and to responses before they reach the user, covering sanitisation, harmful-language detection, data-leakage prevention, and prompt-injection resistance. The project and its models on Hugging Face are archived and no longer maintained.

Scanners compose as pipelines: 15 prompt scanners and 21 output scanners, each independently configurable. Base functionality needs few libraries, with additional dependencies installed on demand as more advanced scanners are used. Python 3.9 or higher is required, and the toolkit can be deployed as a standalone API service or called from application code, with an example for the OpenAI chat API.

Features

  • Prompt scanners: Anonymize, BanCode, BanCompetitors, BanSubstrings, BanTopics, Code, Gibberish, InvisibleText, Language, PromptInjection, Regex, Secrets, Sentiment, TokenLimit, and Toxicity
  • Output scanners: BanCode, BanCompetitors, BanSubstrings, BanTopics, Bias, Code, Deanonymize, JSON, Language, LanguageSame, MaliciousURLs, NoRefusal, ReadingTime, FactualConsistency, Gibberish, Regex, Relevance, Sensitive, Sentiment, Toxicity, and URLReachability
  • Anonymise and deanonymise: PII is replaced before the prompt is sent and restored in the response
  • API deployment: runs as an HTTP service in front of a model
  • Playground: a Hugging Face Space for trying scanners interactively

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with LLM Guard.

Browse the catalogue for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get LLM Guard →

Browse the catalogue