基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/alibaba/anolisa --skill code-scanner命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
使用 agent-sec-cli 扫描 prompt 文本中的注入攻击和越狱尝试,返回结构化 JSON 扫描结果。当用户提到 prompt 安全、prompt 注入检测、越狱检测、提示词攻击检测,或者需要判断一段文本是否包含恶意 prompt 注入时,都应使用此技能。即使用户没有明确说"扫描",只要涉及评估 prompt 文本的安全性,也应触发此技能。
Use this skill when the user asks about ANOLISA, Alibaba Cloud Linux 4 Agentic Edition, cosh, Copilot Shell, AgentSecCore, AgentSight, Tokenless, ws-ckpt, OS Skills, or any component of ANOLISA. This includes questions about usage, configuration, commands, free quota, billing, pricing, authentication, or how to use specific features like switching to bash, token optimization, checkpoint rollback, security features, or deploying OpenClaw/Claude Code.
只读查询 agent-sec-cli 已落盘的历史安全事件记录,并据此生成会话级安全复盘。仅当用户显式要求查看或审计已发生的安全事件、安全告警、安全审计记录,或要求按 session/run/trace/时间/类别筛选与统计已有安全事件,或要求复盘某次会话的安全判定时使用。不用于扫描新内容:检查代码安全性用 code-scanner,检测 prompt 注入用 prompt-scanner,审查 Skill 安全状态用 skill-ledger。不要因为对话中出现“安全”“工具调用”等字样、或为了主动自查而触发。
| name | code-scanner |
| description | 扫描 Bash / Python 代码片段中的安全风险,返回结构化 JSON 扫描结果。当用户要求检查代码安全性时使用。 |
基于正则的轻量级代码安全扫描引擎,支持 Bash 和 Python,内置 25 条检测规则。
agent-sec-cli scan-code --code '<source_code>' --language <bash|python>
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
code | string | 是 | 待扫描的源代码字符串,支持多行 |
language | string | 是 | 编程语言,取值:bash 或 python |
返回 JSON 格式的 ScanResult 对象:
| 字段 | 类型 | 说明 |
|---|---|---|
ok | bool | 扫描是否正常完成(无内部错误) |
verdict | string | 最终判定,见下方 Verdict 说明 |
summary | string | 人类可读的扫描摘要 |
findings | Finding[] | 命中的规则列表,无命中时为空数组 |
language | string | 输入的语言 |
engine_version | string | 与 agent-sec-cli 版本一致 |
elapsed_ms | int | 扫描耗时(毫秒) |
| 字段 | 类型 | 说明 |
|---|---|---|
rule_id | string | 规则 ID,如 shell-recursive-delete |
severity | string | 严重级别:warn / deny |
desc_zh | string | 中文描述 |
desc_en | string | 英文描述 |
evidence | string[] | 匹配到的代码片段列表 |
| 值 | 含义 |
|---|---|
pass | 未检测到安全风险 |
warn | 存在告警级风险,建议关注 |
deny | 存在阻断级风险,应阻止执行 |
error | 扫描引擎内部错误 |