LLM Guard Playground - Test LLM Security Scanners in Your Browser
Dec 7, 2025
llmsecuritydemoguardrailshuggingface
LLM Guard Playground is an interactive demo hosted on Hugging Face Spaces that lets you test LLM security scanners directly in your browser. No installation, no API keys—just paste a prompt and see how each scanner evaluates it.
What It Does
The playground provides a web interface to test LLM Guard’s input and output scanners. Configure controls in the sidebar, submit a prompt, and get:
- Sanitized prompt output - the cleaned version after scanners run
- Risk evaluation per scanner - detailed breakdown showing which scanners flagged issues
- Pass/fail status - “true” means no risk detected; “false” means the scanner caught something
If a scanner detects a risk, the prompt may be redacted (for PII) or blocked entirely (for prompt injections).
Available Scanners
Input Scanners (15): Anonymize, BanCode, BanCompetitors, BanSubstrings, BanTopics, Code, Gibberish, InvisibleText, Language, PromptInjection, Regex, Secrets, Sentiment, TokenLimit, Toxicity
Output Scanners (21): BanCode, BanCompetitors, BanSubstrings, BanTopics, Bias, Code, Deanonymize, JSON, Language, LanguageSame, MaliciousURLs, NoRefusal, ReadingTime, FactualConsistency, Gibberish, Regex, Relevance, Sensitive, Sentiment, Toxicity, URLReachability
Testing Ideas
Try these prompt types to see scanners in action:
- PII detection: Include fake names, emails, or phone numbers
- Prompt injection: “Ignore previous instructions and…”
- Jailbreak attempts: Common jailbreak patterns
- Toxic content: Offensive language or harmful requests
- Secrets: API keys, passwords, or credentials
Built With Streamlit
The playground is a simple Python app using Streamlit. You can run it locally by cloning the repo and installing dependencies:
git clone https://huggingface.co/spaces/protectai/llm-guard-playground
cd llm-guard-playground
pip install -r requirements.txt
streamlit run app.py
Why Use the Playground
- Learning: Understand what each scanner catches before integrating LLM Guard
- Testing: Quickly validate prompts without writing code
- Demos: Show stakeholders how LLM security scanning works
- Red teaming: Test prompt injection techniques in a safe environment
Related
See also: LLM Guard Quickstart for code-level integration.
Sources: