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-code

Installs 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

Recommended

More Security
1adobe avatardispatcheradobe/skillsSingle entry point for all AEM 6.5 LTS Dispatcher skills. Covers config authoring, technical advisory, incident response, performance tuning, security hardening1Kskills.sh installs
2alirezarezvani avatarsenior-secopsalirezarezvani/claude-skillsSenior SecOps engineer skill for application security, vulnerability management, compliance verification, and secure development practices. Runs SAST/DAST scans928skills.sh installs
3secondsky avatarsap-btp-cloud-loggingsecondsky/sap-skillsThis skill provides comprehensive guidance for SAP Cloud Logging service on SAP BTP. Use when setting up Cloud Logging instances, configuring log ingestion from908skills.sh installs
4agentmail-to avataragent-email-patternsagentmail-to/agentmail-skillsArchitecture patterns for AI agents that communicate over email -- why agents need dedicated inboxes rather than human email accounts, infrastructure/provider t903skills.sh installs
5davila7 avatardocker-expertdavila7/claude-code-templatesDocker containerization expert with deep knowledge of multi-stage builds, image optimization, container security, Docker Compose orchestration, and production d899skills.sh installs
6sanjay3290 avatargoogle-drivesanjay3290/ai-skillsInteract with Google Drive - search files, find folders, list contents, download files, upload files, create folders, move, copy, rename, and trash files. Use w875skills.sh installs