prompt-guard
仓库创建 2025年11月3日最近提交 1 个月前SkillHot 收录 20 天前
▸ 精选理由
模型小且速度快,适合在请求入口做实时安全判断与过滤。
▸ 风险提示
需下载模型权重并可能出现误判,影响可用性。
这个 Skill 做什么
用于检测与拦截 prompt 注入和越狱攻击的小型多语种分类模型。
一个小型多语种分类模型(约 86M 参数),用来检测 prompt 注入和 jailbreak 攻击,适合在 LLM 应用或 RAG 流程中过滤第三方 prompt 或数据。它多语言支持(约 8 种语言)、速度极快(GPU 下 <2ms)、准确率高且误报低,便于在线部署或在 HuggingFace 上批量推断。特点是专门为 prompt 安全设计,能在模型输入层拦截恶意指令减少安全隐患。
▸ 展开 SKILL.md 英文原文
Meta's 86M prompt injection and jailbreak detector. Filters malicious prompts and third-party data for LLM apps. 99%+ TPR, <1% FPR. Fast (<2ms GPU). Multilingual (8 languages). Deploy with HuggingFace or batch processing for RAG security.
1.1w
Stars
817
Forks
40
仓库内 Skill
+704
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/Orchestra-Research/AI-Research-SKILLs/main/07-safety-alignment/prompt-guard/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/Orchestra-Research/AI-Research-SKILLs/main/07-safety-alignment/prompt-guard/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# 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**:
```bash
pip install transformers torch
```
**Basic usage**:
```python
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, revia SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有