agentic-os-org/anolisa/prompt-scanner
Claude Code and agent skill by agentic-os-org/anolisa
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
使用 agent-sec-cli 扫描 prompt 文本中的注入攻击和越狱尝试,返回结构化 JSON 扫描结果。当用户提到 prompt 安全、prompt 注入检测、越狱检测、提示词攻击检测,或者需要判断一段文本是否包含恶意 prompt 注入时,都应使用此技能。即使用户没有明确说"扫描",只要涉及评估 prompt 文本的安全性,也应触发此技能。
Install
npx vskill@latest install agentic-os-org/anolisa/prompt-scannerSKILL.md
Prompt Scanner
多层 prompt 注入 / 越狱检测引擎。L1 规则引擎做快速正则匹配,L2 ML 分类器(Llama Prompt Guard 2)做语义理解,两层协同覆盖从简单关键词注入到复杂语义越狱的各种攻击手法。
何时使用
- 用户让你检查一段 prompt 是否安全
- 用户怀疑某个输入包含注入攻击或越狱尝试
- 需要在执行用户提供的 prompt 前做安全预检
- 批量审计 prompt 日志中的可疑文本
- 用户提到"prompt 注入""jailbreak""提示词攻击"等关键词
调用方式
最常用的调用方式——直接传入待扫描文本:
其他输入方式:
参数
| 参数 | 默认值 | 说明 | |
|---|---|---|---|
--text | — | 直接指定扫描文本(优先级最高) | |
--input | — | 文本文件路径,每行一条 prompt | |
--mode | standard | 检测模式,见下方选择指南 | |
--format | json | 输出格式:json 或 text(人类可读) | |
--source | "" | 输入来源标签(如 user_input、rag、tool_output),记录到审计日志 |
--text、--input、stdin 三者至少提供一种,优先级:--text > --input > stdin。
模式选择指南
根据场景选择合适的检测模式:
| 模式 | 检测层 | 延迟 | 何时选择 | |
|---|---|---|---|---|
fast | L1 规则引擎 | < 5 ms | 只需快速初筛,或 ML 依赖未安装时 | |
standard | L1 + L2 ML | 20–80 ms | 默认选择,精度与速度最佳平衡 | |
strict | L1 + L2(全层执行) | 50–200 ms | 高安全场景,不希望因快速失败跳过后续检测层 |
如果不确定,直接使用默认的 standard 模式即可。
理解输出
关键字段
扫描完成后,关注这几个核心字段来判断结果:
- `verdict`:最终判定——
pass(安全)、warn(可疑,建议审核)、deny(高风险,应阻断)、error(引擎异常) - `threat_type`:威胁类型——
direct_injection(直接注入)、indirect_injection(间接注入)、jailbreak(越狱)、benign(良性) - `confidence`:置信度 0.0–1.0,越高越确定
- `findings`:命中的具体规则列表,每条包含
rule_id、severity、evidence(匹配到的文本片段)
向用户沟通结果
根据 verdict 值给出不同级别的反馈:
- pass → 告知用户文本未检测到安全风险
- warn → 提示发现潜在风险,引用
findings中的evidence说明具体匹配内容,建议用户审核 - deny → 明确警告存在高置信度的注入/越狱攻击,引用具体证据,建议阻断该输入
- error → 说明扫描引擎遇到错误,建议用户检查输入或重试
完整输出 Schema
| 字段 | 类型 | 说明 | |
|---|---|---|---|
schema_version | string | 固定 "1.0" | |
ok | bool | 无威胁时为 true | |
verdict | string | pass / warn / deny / error | |
risk_level | string | low / medium / high / critical | |
threat_type | string | direct_injection / indirect_injection / jailbreak / benign | |
confidence | float | 置信度 0.0–1.0 | |
summary | string | 人类可读摘要 | |
findings | array | 命中的规则详情(rule_id, severity, title, evidence, category) | |
layer_results | array | 各层检测摘要(layer, detected, score, latency_ms) | |
engine_version | string | 引擎版本号 | |
elapsed_ms | float | 总耗时(毫秒) |
示例
Example 1 — 检测到注入攻击:
Example 2 — 安全文本:
注意事项
- 退出码
0表示扫描器正常运行(包括检测到威胁),退出码1表示参数错误。判断是否有威胁应解析 JSON 中的verdict字段,而非依赖退出码。 - 如果 ML 依赖未安装(未执行
uv sync --extra ml),scanner 会自动降级为仅 L1 模式并输出 WARNING 日志,不会报错。此时--mode standard实际只执行 L1。 standard/strict模式依赖 L2 模型,模型不会自动下载,需先执行ollama pull modelscope.cn/ANOLISA/Qwen3Guard-Gen-0.6B-GGUF。agent-sec-cli scan-prompt warmup只检查 Ollama 能否提供该模型,不会把模型加载进内存,因此首次扫描仍会有秒级冷启动开销。
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/agent-sec-core/skills/prompt-scanner/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/agentic-os-org/anolisa/prompt-scanner)