prompt-guard

Detects prompt injection and jailbreak attempts in LLM inputs and retrieved context using Prompt-Guard-86M.

Updated May 2, 2026
One-click install
npx skills add https://github.com/qcmuu/AI-Research-Skills --skill prompt-guard-qcmuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-guard
Source: https://github.com/qcmuu/AI-Research-Skills/tree/main/07-safety-alignment/prompt-guard
Command: npx skills add https://github.com/qcmuu/AI-Research-Skills --skill prompt-guard-qcmuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, torch.

What problem does it solve?

Prompt Guard helps prevent prompt injection and jailbreak attempts from malicious user inputs or third-party RAG content from steering an LLM away from its intended instructions.

Core Features & Use Cases

  • Prompt injection & jailbreak detection: Scores text as benign, injection, or jailbreak so you can block unsafe prompts and documents before inference.
  • User input filtering: Use the classifier to gate user messages in chat or agent pipelines (e.g., block “ignore previous instructions” style attacks).
  • Third-party/RAG data filtering: Use lower thresholds to flag and discard suspicious retrieved passages from APIs, web content, or RAG indexes.
  • Batch processing for RAG: Filter many retrieved documents efficiently in batches to reduce security risk at retrieval time.

Quick Start

Install the model dependencies and score an incoming message for jailbreak probability using Python, blocking the request when the score exceeds your chosen threshold.

Frequently Asked Questions about prompt-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect prompt injection and jailbreak attempts in user inputs?

Detect prompt injection and jailbreak attempts by loading the Prompt-Guard-86M model with transformers and torch to score text, producing BENIGN, INJECTION, or JAILBREAK probabilities for user messages before LLM inference.

Can I filter retrieved RAG documents for malicious content in batches?

Filter retrieved RAG documents for malicious content in batches by applying the sequence classification model to score multiple passages simultaneously, flagging and discarding suspicious retrieved text based on configurable thresholds.

How do I configure thresholds for blocking unsafe prompts in an LLM chat application?

Configure thresholds for blocking unsafe prompts by setting a score cutoff for the JAILBREAK or INJECTION probabilities output by the classifier, allowing you to gate user messages and block requests exceeding your chosen safety limit.

What dependencies do I need to run a jailbreak detection model for LLM security?

Run a jailbreak detection model for LLM security by installing the transformers and torch dependencies, which are required to load the 86M parameter sequence classification model and process text inputs for probability scoring.

Does prompt injection detection work for vetting third-party API and web content?

Prompt injection detection works for vetting third-party API and web content by applying lower thresholds to the classifier's probability scores, allowing you to flag and discard suspicious external passages before they enter your application context.

What is the difference between injection and jailbreak probabilities in LLM security scoring?

The difference between injection and jailbreak in LLM security scoring is defined by the model's output labels: INJECTION covers attempts to override instructions, while JAILBREAK targets attempts to bypass safety guardrails entirely.