post-patch-validation
Validates security patches with reproducible baseline-versus-patched evidence, including original exploits, root-cause variants, behavior preservation…
Skill by trailofbits
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/trailofbits-post-patch-validation
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/post-patch-validation
Tools it pre-approves 7
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
ReadWriteEditGrepGlobBashWorkflow
What's inside
- Skill name
post-patch-validation- Description
- Validates security patches with reproducible baseline-versus-patched evidence, including original exploits, root-cause variants, behavior preservation, regressions, and newly introduced security failures. Use after a patch exists and before accepting, merging, or reporting it as fixed; also use when an AI-generated patch, remediation commit, pull request, or proposed upstream fix needs adversarial post-patch validation across any language.
- License
- CC-BY-SA-4.0
- Allowed tools
- Read, Write, Edit, Grep, Glob, Bash, Workflow
- Instructions
- 252 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Pre-approves any shell command
Files (5)
- SKILL.md
- openai.yaml · agents/
- evidence-model.md · references/
- post_patch_validation.py · scripts/
- pyproject.toml · scripts/
SKILL.md (first lines)
# Post-Patch Validation
Validate a security patch against the reported bug and the surrounding code it affects. Give the
patch author reproducible failures to fix and identify what still needs testing. Apply the same
checks to human and agent patches. The diff, author, upstream implementation, and original proof
of concept alone cannot establish correctness.
## When to Use
- A security fix, remediation commit, patch file, or pull request already exists.
- An AI-generated patch needs validation before human review or merge.
- A fix may cover one exploit path while missing variants of the same root cause.
- A security fix may alter legitimate behavior or introduce a new vulnerability.
- A patch author needs concrete failures and coverage gaps before another revision.
## When NOT to Use
- No patch exists yet; use vulnerability discovery or fix implementation first.
- The task is to review an audit finding against a report without executing patch evidence.
- The task is only to convert a finding into a permanent project test.
- The target is remote or production. This skill executes local code and tests only.
- The user has not authorized execution of the repository's code or test suite.
## Quick Start
1. Pin the vulnerable base and patched input. Prefer immutable commits. For uncommitted work,
create a binary patch file first; do not validate in the user's working tree.
2. Scaffold a pinned plan:
```bash
uv run {baseDir}/scripts/post_patch_validation.py scaffold \
--repo . \
--base-ref <vulnerable-ref> \
--patched-ref <patched-ref> \
--finding-id <stable-id> \
--finding-summary "<root cause and impact>" \
--evidence-level runtime \
--output post-patch-validation/plan.json
```
Use `--patch-file <path>` instead of `--patched-ref` for a patch artifact. Choose the highest
honest evidence level: `source` for source/patch invariants only, `build` when target code is
compiled or analyzed but the reported behavior is not executed, or `runtime` when the checks
execute the reported behavior and its safety assertions.
3. Inspect the finding, diff, callers, sibling paths, cleanup/error paths, and existing tests.
Populate `checks` in the generated plan. Run `print-schema` for the structural schema:
```bash
uv run {baseDir}/scripts/post_patch_validation.py print-schema
```
4. Run `validate-plan` for the complete validation, including coverage, command restrictions,
and pinned inputs, before executing code:
```bash
uv run {baseDir}/scripts/post_patch_validation.py validate-plan \
--plan post-patch-validation/plan.json
```
5. Execute the evidence plan:
```bash
uv run {baseDir}/scripts/post_patch_validation.py run \
--plan post-patch-validation/plan.json \
--output post-patch-validation/results
```
6. Report `result.json`, `report.md`, the evidence level, and the complete `assessment`.
Return each finding to the patch author with its check ID, assertion, and saved logs. Identify
each validation gap separately, including gaps that coexist with supported findings. After
the author revises the patch, pin the new inputs and save a fresh validation run. Preserve the
prior evidence. Passing supplied checks still requires human review before acceptance.
## Evidence Contract
The runner rejects incomplete plans. Supply at least one check of every kind:
| Kind | Required observation |
|---|---|
| `control` | Benign harness succeeds on both base and patch |
| `exploit` | Original safety assertion fails on base and succeeds on patch |
| `variant` | A distinct root-cause variant fails on base and succeeds on patch |
| `behavior` | Unaffected behavior succeeds with byte-identical selected output |
| `regression` | Targeted non-security regression check succeeds on both revisions |
| `security` | Adjacent/new-vulnerability check succeeds on base and patch |
| `suite` | Existing project suite, sanitizer, or deterministic fuzz campaign succeeds on patch |
Commands are argv arrays, never shell strings. Put complex setup in a checked-in or plan artifact
script and invoke it with `{plan_dir}`. The runner fixes locale/timezone/hash-seed inputs, executes
checks in lexical ID order, records raw stdout/stderr, and never edits the original worktree.
Each check's `timeout_seconds` defaults to 300 and accepts integers from 1 through 3600.
Exceeding the timeout leaves a validation gap. A timeout alone does not establish a regression.
Every plan also contains a sorted `submodules` array (`[]` when none). Scaffolding infers affected
Gitlinks from the changed-file inventory. The runner initializes those pinned commits from the
source repository's existing Git module objects, never from `.gitmodules` network URLs; initialize
or fetch them in the source repository before validation.
### Exploit and variant checks must prove they ran
A nonzero exit does not mean the vulnerability reproduced. An import error, a failed build, a
missing dependency, and a failed safety assertion all exit nonzero and are indistinguishable to the
runner. Every `exploit` and `variant` check must print and flush `PPV_REACHED` immediately
before it evaluates its assertion, on both revisions:
```json
"argv": ["python3", "-c", "import app; value = app.render('<'); print('PPV_REACHED', flush=True); assert value == '<'"]
```
The token is also in the environment as `PPV_REACHED_MARKER`. It must land on **stdout, as a line
of its own**. Stderr is not scanned, because a Python `SyntaxError` traceback echoes the offending
source and would otherwise satisfy the check for a harness that executed nothing. A run without it
leaves a `marker_missing` gap. Independent findings from other checks remain in the result.
Flush explicitly: a harness whose payload segfaults or calls `_exit` loses buffered output and forfeits its own evidence.
These checks also run **side-blind**. `{side}` is not expanded for them, `PPV_SIDE` is absent from
their environment, the checkout directory is randomly named, and the plan validator rejects any
`exploit` or `variant` check whose `argv` or `env` mentions either. An assertion that can see which
revision it is on can assert on *that* instead of on the code, which is the cheapest possible way
to fake a reproduction followed by a fix.From trailofbits/skills, CC-BY-SA-4.0.
More from trailofbits/skills
- 0.767score
slicing-code-context
trailofbits
Selects bounded, graph-informed source slices with Trailmark and delegates focused code analysis or patch-proposal work to a smaller subagent.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
diagramming-code
trailofbits
Generates Mermaid diagrams from Trailmark code graphs.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
semgrep
trailofbits
Runs a Semgrep security scan over a codebase: detects languages, selects rulesets, presents the plan for explicit approval, then runs every approved ruleset…
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
mermaid-to-proverif
trailofbits
Translates Mermaid sequenceDiagrams describing cryptographic protocols into ProVerif formal verification models (.pv files).
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
github-triage
trailofbits
Triages a repository's open GitHub issues and pull requests via the gh CLI.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
firebase-apk-scanner
trailofbits
Scans Android APKs for Firebase security misconfigurations including open databases, storage buckets, authentication issues, and exposed cloud functions.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
dimensional-analysis
trailofbits
Audits code for unit and decimal-scaling bugs and annotates it with dimensional comments recording the units of each value.
SkillAFreshness: A★ 7.8KClaude Code - 0.767score
let-fate-decide
trailofbits
Draws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
codeql
trailofbits
Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
interpreting-culture-index
trailofbits
Interprets Culture Index (CI) surveys, behavioral profiles, and personality assessment data.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
entry-point-analyzer
trailofbits
Analyzes smart contract codebases to identify state-changing entry points for security auditing.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
trailmark
trailofbits
Builds and queries multi-language source and binary code graphs for security analysis.
SkillAFreshness: A★ 7.8KClaude Code +9
Signals
- Stars
- 7,783
- Forks
- 671
- Open issues
- 30
- Last commit (this folder)
- Sep 14, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- CC-BY-SA-4.0
- Repository
- github.com/trailofbits/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from trailofbits
- 0.767score
github-triage
trailofbits
Triages a repository's open GitHub issues and pull requests via the gh CLI.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
entry-point-analyzer
trailofbits
Analyzes smart contract codebases to identify state-changing entry points for security auditing.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
interpreting-culture-index
trailofbits
Interprets Culture Index (CI) surveys, behavioral profiles, and personality assessment data.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
firebase-apk-scanner
trailofbits
Scans Android APKs for Firebase security misconfigurations including open databases, storage buckets, authentication issues, and exposed cloud functions.
SkillAFreshness: A★ 7.8KClaude Code +9 - 0.767score
dimensional-analysis
trailofbits
Audits code for unit and decimal-scaling bugs and annotates it with dimensional comments recording the units of each value.
SkillAFreshness: A★ 7.8KClaude Code - 0.767score
let-fate-decide
trailofbits
Draws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated.
SkillAFreshness: A★ 7.8KClaude Code +9
Cite this page
post-patch-validation skill. Agent Mart. https://agentmart.dev/skills/trailofbits-post-patch-validation (last updated 2026-10-24)