跳到正文
Skillpedia
安全8.0k · #12733

trailmark-review-gate

它能做什么

这项技能比较分支、拉取请求或发布前后的代码结构,并标记有风险的结构变化。适合希望在常规代码审查之外进行结构化安全检查的审查人员。

适用场景

  • ✓你在审查拉取请求,想知道它是否开辟了新的入口点时。
  • ✓修复提交或发布可能移除了某项验证或权限检查时。
  • ✓你想看看某项变更是否使敏感代码可以从外部触及时。

技能链接

https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-review-gate/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-review-gate/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查这个拉取请求,看它是否新增了通往敏感代码的路径,或移除了权限检查。”

每周 5 个新技能,1 分钟读完。

工作原理

它对两个代码版本之间的结构差异应用固定规则,并生成一份标记了变更的简短报告。如果工具无法运行,它会报告 UNKNOWN,而不会把该变更判定为通过。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Trailmark Review Gate

Apply deterministic security gate rules to Trailmark structural diff evidence. This skill does not replace line-level review. It produces a compact structural packet reviewers can cite while they inspect the code.

When to Use

  • Reviewing a branch, pull request, release diff, or fix commit
  • Checking whether a change expands attack surface
  • Looking for removed validation or authorization on reachable paths
  • Comparing before/after taint, privilege-boundary, blast-radius, or complexity signals
  • Producing graph evidence for a differential review

When NOT to Use

  • Single-snapshot analysis. Use trailmark or trailmark-structural.
  • Text-diff review only. Use differential-review.
  • Full vulnerability discovery. Use an audit or bug-finding workflow.
  • One static finding. Use trailmark-finding-triage.
  • Tooling is unavailable and the user wants manual review only.

Rationalizations to Reject

Rationalization Why It Is Wrong Required Action
"The line diff is small, so no graph gate is needed" Small changes can create new call paths Compare before/after graphs
"Graph gate passed, so the PR is secure" The gate only checks structural regressions Still perform line-level review
"Trailmark failed, so pass the gate" Tool failure is unknown risk, not success Emit UNKNOWN
"Tests pass, so removed validation is fine" Tests may miss affected entrypoint paths Review the removed path manually
"Only new code matters" Removed auth, validation, and callers can be higher risk than additions Review removals and path changes

Workflow

Review Gate Progress:
- [ ] Step 1: Resolve before/after inputs
- [ ] Step 2: Build graph-evolution evidence
- [ ] Step 3: Normalize structural changes
- [ ] Step 4: Apply gate rules
- [ ] Step 5: Emit review packet and actions

Step 1: Resolve Inputs

Accept two refs, a branch name, a commit range, or before/after directories. Do not check out branches unnecessarily. Prefer git diff, git show, and git worktrees, following the graph-evolution snapshot workflow.

Step 2: Build Graph Evidence

Run graph-evolution or equivalent Trailmark before/after graph analysis. Both snapshots must run engine.preanalysis() so taint, privilege-boundary, blast-radius, complexity, and entrypoint signals are available.

Record Trailmark version and any feature probes. If graph construction fails, emit UNKNOWN.

Step 3: Normalize Changes

Normalize evidence into:

  • added, removed, and modified nodes
  • added and removed edges
  • entrypoint set changes
  • taint membership changes
  • privilege-boundary membership changes
  • blast-radius changes
  • complexity changes
  • newly reachable sensitive sinks
  • unresolved, proxy, or dynamic edge changes

Step 4: Apply Gate Rules

Apply the rules in references/gate-rules.md. Gate verdicts are:

Verdict Meaning
FAIL A high-risk structural regression needs review before acceptance
WARN A meaningful graph change needs reviewer attention
PASS No configured structural gate fired
UNKNOWN Trailmark failed or evidence is too incomplete

Step 5: Emit Packet

Write the packet using references/output-format.md, then hand it to the branch reviewer. Use references/review-integration.md when combining this packet with differential-review or another PR review process.

Requirements

  • Never mutate the user's working branch while comparing refs.
  • Never report PASS when Trailmark failed.
  • Separate graph evidence from manual security judgment.
  • Include exact changed nodes or paths for every FAIL and WARN.
  • Include limitations when parser, proxy, unresolved-call, or dynamic-dispatch uncertainty affects the verdict.
常见问题

通过检查是否意味着代码是安全的?

不是。这项检查只关注结构变化,因此仍需要逐行审查。

如果工具无法运行会怎样?

该技能会报告 UNKNOWN,不会把失败当作通过。

它能取代常规代码审查吗?

不能。它为审查人员提供结构化证据,与他们自己的审查配合使用。

详情

作者的原始描述

Runs a Trailmark structural review gate over a branch, pull request, fix commit, release diff, or git ref range to detect new entrypoints, new tainted paths, removed validation or authorization calls, privilege-boundary drift, blast-radius growth, complexity growth, and newly reachable sensitive sinks. Use when reviewing a PR, branch, remediation commit, or release diff where graph-level security regressions should be checked before merge.

repo: trailofbits/skills

热度

GitHub 星标
8.0k
排名
#12733
许可证
CC-BY-SA-4.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能