
Trailmark Review Gate
FreeEnhance security reviews with structural diff analysis.
Free · Opens the source repo
What Trailmark Review Gate does
The Trailmark Review Gate skill provides a structured approach to analyzing changes in code for security regressions. It is specifically designed to assess pull requests, branches, and commits by applying deterministic security gate rules to the structural differences in the code. This skill is essential for developers and security engineers who need to ensure that changes do not introduce new vulnerabilities or remove critical security checks. By generating a compact structural packet, it allows reviewers to focus on the most significant changes without replacing the need for line-level code inspection.
When using the Trailmark Review Gate, the workflow begins by resolving the inputs, which can include branch names or commit ranges. The skill then builds graph evidence by running a pre-analysis to gather critical signals such as taint, privilege-boundary, and complexity changes. This analysis is crucial as it provides insight into how the code structure has evolved, enabling reviewers to identify potential security risks associated with new entry points or altered validation paths.
The skill normalizes these changes into various categories, such as added or removed nodes and edges, ensuring that all aspects of the structural changes are captured. Once the analysis is complete, the skill applies predefined gate rules to determine the security status of the changes. The verdicts can range from PASS to FAIL, providing clear guidance on whether the changes are acceptable or require further scrutiny. This clarity helps streamline the review process and enhances the overall security posture of the codebase.
Overall, the Trailmark Review Gate is a valuable tool for teams focused on maintaining high security standards in their development processes. It complements existing review practices by adding an additional layer of security analysis, making it an essential addition for any development team concerned with application security.
When to use it
Use this skill when reviewing pull requests, branches, or commits to ensure that no new security vulnerabilities are introduced.
When not to use it
Avoid using this skill for single-snapshot analyses or when only text-diff reviews are needed; it's not a substitute for full vulnerability discovery workflows.
What you can build with it
Pull Request Security Review
Use the skill to analyze a pull request for any structural changes that may introduce security vulnerabilities.
Branch Change Assessment
Apply the skill to assess changes in a branch before merging to ensure no critical security checks have been removed.
Release Diff Analysis
Utilize the skill to compare release diffs and verify that new entry points and tainted paths are properly managed.
How to install Trailmark Review Gate
View source1. Install with the skills CLI
npx skills add trailofbits/skills/trailmark-review-gate --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by trailofbitsTrailmark 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
trailmarkortrailmark-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
PASSwhen Trailmark failed. - Separate graph evidence from manual security judgment.
- Include exact changed nodes or paths for every
FAILandWARN. - Include limitations when parser, proxy, unresolved-call, or dynamic-dispatch uncertainty affects the verdict.
Frequently asked questions about Trailmark Review Gate
Similar skills
CodeQL Code Scanning
Streamline CodeQL setup and configuration for security analysis.
Security Review
AI-powered codebase security scanner for vulnerabilities.
Integrating SAST into GitHub Actions
Automate SAST scanning in GitHub Actions workflows.
Implementing Semgrep for Custom SAST Rules
Enhance code security with custom Semgrep rules.
Infrastructure as Code Security Scanning
Automate security checks for your IaC deployments.
Implementing GitHub Advanced Security
Automate code scanning and vulnerability detection at scale.
