triage
它能做什么
这项技能检查安全扫描器的输出,去除重复项,核实哪些发现属实,并按可利用程度排序。适合收到大量原始发现清单的安全团队。
适用场景
- ✓当安全扫描器返回了一长串需要审查的发现的时候。
- ✓当你需要去除多次扫描中的重复发现的时候。
- ✓当你希望把最紧迫的真实问题排序,并分配给负责人的时候。
技能链接
https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/triage/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能检查这份扫描器输出,去掉误报,并告诉我应该先修复什么吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体将每项发现与源代码对照检查,把重复项归为一组,按真实风险对剩余项目排序,并写出附有建议负责人的排序清单。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
triage
Adversarial triage of raw security-scanner output. Does four jobs: verify each finding is real, deduplicate across runs and scanners, rank survivors by derived exploitability rather than the scanner's claimed severity, and route each to a component owner. Output is a short, ranked, owned list instead of a raw dump.
Invoke with /triage <findings-path> [--auto] [--votes N] [--repo PATH] [--fp-rules FILE].
Arguments (parse from $ARGUMENTS; positional $1/$2 expansion is
not stable across runtimes):
- findings path (first positional, required): a JSON file, a directory of
JSON files, a
VULN-FINDINGS.json, anINCIDENTS.json, a pipelineresults/<target>/<ts>/directory, or a markdown report. --auto: skip the interview and use defaults. Default mode is interactive.--votes N: verifier votes per finding (default 3; use 1 for a quick pass, 5 for high-stakes batches).--repo PATH: path to the target codebase, read-only (default cwd). Verification needs source access; the skill stops with an error if the cited files aren't reachable.--fp-rules FILE: append the contents of FILE to the verifier's exclusion-rule list (Phase 3a). Use for org-specific precedents: "we use Prisma ORM everywhere — raw-query SQLi only", "k8s resource limits cover DoS", etc. Plain text, one rule per line or paragraph.--fresh: ignore any existing checkpoint in./.triage-state/and start from Phase 0. Without this flag the skill resumes from the last completed phase if a checkpoint is present.
Tools: Read, Glob, Grep, Write, Task, AskUserQuestion. Bash is
permitted only for git, find, wc, ls, jq, and
python3 .claude/skills/_lib/checkpoint.py (checkpoint I/O).
Do not execute target code. No building, running, installing dependencies, or sending requests. A proof-of-concept that accidentally works against something real is unacceptable, and "couldn't write a working PoC" is weak evidence of non-exploitability. Every conclusion comes from reading source. This applies to the orchestrator and every subagent; include the constraint in every Task prompt. For high-confidence HIGH findings, recommend a human-built PoC as a follow-up instead.
Do not reach the network. No package-registry lookups, CVE-database queries, or upstream-commit fetches.
Checkpointing (runs before Phase 0 and after every phase)
On large finding batches a full run can exhaust context or hit rate limits
mid-way — particularly Phase 3, which spawns candidates × votes verifiers.
Phase state persists to ./.triage-state/ so a fresh /triage session can
resume without re-asking the interview or re-spawning verifiers.
All checkpoint I/O goes through python3 .claude/skills/_lib/checkpoint.py
(atomic writes, JSON-validated). Never use the Write tool for progress.json
directly. Never pass payload via heredoc or stdin; target-derived strings
could collide with the heredoc delimiter and break out to shell. The
Write→--from pattern keeps repo-derived bytes out of Bash argv.
State files in ./.triage-state/:
progress.json— single source of truth for resume position:{"status": "running"|"complete", "phase_done": N, "shards_done": [...]}. Resume decisions read ONLY this file, never a glob ofphase*.jsonor shard files (stale files from a prior run must not be trusted).phaseN.json— data payload for phase N (schemas at the tail of each phase section below)._chunk.tmp— transient payload buffer; overwritten before everysave/shard/appendcall.
Start of run — resume check. Bash:
python3 .claude/skills/_lib/checkpoint.py load ./.triage-state
status == "absent"OR"complete", OR--freshin$ARGUMENTS→ fresh start. Bash:python3 .claude/skills/_lib/checkpoint.py reset ./.triage-state, then proceed to Phase 0.status == "running"withphase_done == N→ resume. Read./.triage-state/phase0.jsonthroughphaseN.jsonin order (and anyshard_*.jsonfiles listed inshards_done), merging keys into working state (later files override earlier — checkpoints may be deltas). PrintResuming from checkpoint: Phase N complete (./.triage-state/phaseN.json), and skip directly to Phase N+1.
End of every phase N. Two tool calls:
- Write tool →
./.triage-state/_chunk.tmpcontaining the phase's output JSON (schema at the tail of each phase section). - Bash → `python3 .claude
常见问题
它需要源代码吗?
需要。它必须阅读发现所指向的代码,才能判断这些发现是否属实。
它可以不提问直接运行吗?
可以。自动模式会使用默认设置,并跳过访谈。
它会写入哪些文件?
它会写入一个 JSON 格式的分诊文件,以及一份可读的 markdown 摘要。
详情
作者的原始描述
Triage a batch of raw security findings. Verify each is real, collapse duplicates, re-rank by derived exploitability, and tag with an owner. Takes a directory or file of scanner output and writes TRIAGE.json + TRIAGE.md sorted by what actually needs engineering attention. Use when asked to "triage findings", "validate scanner output", "prioritize vulns", or "review the backlog". Runs interactively by default; pass --auto to skip the interview.
热度
- GitHub 星标
- 7.7k
- 排名
- #13106
- 许可证
- —
- 更新时间
- 2026/8/6
评论
- …