
Prompt Guard
Meta's 86M parameter classifier that catches prompt injection and jailbreak attempts before they hit your LLM. Returns three scores: benign, injection (embedded instructions in third-party data), and jailbreak (direct override attempts). Runs in under 2ms on GPU, works across 8 languages, and hits 99%+ true positive rate with sub-1% false positives. The dual-mode design is smart: use stricter thresholds (0.5) for user inputs, looser ones (0.3) for RAG documents and API responses. Batch processing support makes it practical for filtering retrieved docs at scale. One caveat: legitimate security research queries can trigger false positives, so you'll want context-aware thresholds for trusted users. Best layered with content moderators like LlamaGuard rather than used as your only defense.
- skills.sh installs
- 1K
- GitHub stars
- 14.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill prompt-guard --agent claude-codeInstalls into .claude/skills of the current project.
Files
Prompt Guard - Prompt Injection & Jailbreak Detection
Prompt Guard is an 86M parameter classifier that detects prompt injections and jailbreak attempts in LLM applications.
Quick start
Installation:
pip install transformers torch
Basic usage:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
from torch.nn.functional import softmax
model_id = "meta-llama/Prompt-Guard-86M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()
def get_jailbreak_score(text):
"""Check user input for jailbreak attempts."""
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
logits = model(**inputs).logits
probs = softmax(logits, dim=-1)
return probs[0, 2].item() # Jailbreak probability
# Check prompt
score = get_jailbreak_score("Ignore previous instructions")
if score > 0.5:
print("⚠️ Jailbreak attempt detected!")
Sponsors
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Categories
- Security, DevOps & CI/CD, AI & Agent Building, Data Science & ML, Release Management, Automation & Workflows
- First seen
- Jun 3, 2026
More from orchestra-research/ai-research-skills
All 95- Knowledge Distillation1K
- Ray Data1K
- Fine Tuning With Trl1K
- Llama Cpp1K
- Tensorboard1K
- Deepspeed1K
- Qdrant Vector Search1K
- Grpo Rl Training1K
- Optimizing Attention Flash1K
- Quantizing Models Bitsandbytes1K
- Verl Rl Training1K
- Dspy1K
- Langchain1K
- Pytorch Lightning1K
- Axolotl1K
- Hqq Quantization1K
- Sentence Transformers1K
- Clip1K
- Huggingface Tokenizers1K
- Long Context1K
- Nanogpt1K
- Pytorch Fsdp21K
- Awq Quantization1K
- Modal Serverless Gpu1K