post-patch-validation
An agent skill by trailofbits, from trailofbits/skills. Tags: analysis, debugging, security, testing, validation.
What it does
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.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add trailofbits/skills --skill post-patch-validation
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/trailofbits/skills
cp -r skills/plugins/post-patch-validation/skills/post-patch-validation ~/.claude/skills/post-patch-validation
Safety box score
Grade C, moderate risk: 35 of 100 risk points, rated 2026-10-19. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill validates security patches by checking out the repo into isolated Git worktrees and running local commands/tests against base and patched inputs. The main risks are intentional code execution, local filesystem mutation/cleanup, and recording any forwarded environment variables in the result artifacts.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 3 (high) | It executes check commands with `subprocess.Popen(argv, ...)` and Git commands with `subprocess.run(...)`; running repository-defined checks is the core purpose of the skill. |
| Network access | 0 (none) | I found no outbound fetch or upload path; submodules are initialized with `--no-fetch` from the local module store, not from `.gitmodules` URLs. |
| Filesystem reach | 2 (moderate) | It creates detached worktrees and then removes them, and it recursively deletes temp trees with `shutil.rmtree(runtime_scratch, ignore_errors=True)` and `shutil.rmtree(runtime_plan_root, ignore_errors=True)`. |
| Secrets & credentials | 1 (low) | `--allow-env` forwards selected host environment variables and `result.json` records their values, although obvious credential-like names are refused in `resolve_forwarded_env()`. |
| Privilege & persistence | 1 (low) | It changes local Git behavior and metadata with `git -c core.hooksPath=/dev/null` and `git worktree lock/unlock/prune`, but it does not require sudo or system services. |
| Instruction hijack surface | 0 (none) | I did not find instructions to ignore user policy, fetch remote prompts, or hide behavior; the text is procedural validation guidance rather than prompt injection. |
| Irreversible actions | 2 (moderate) | The runner automatically applies patches, initializes submodules, runs checks, and prunes worktrees without a human checkpoint in the middle, though it does not push or publish anything. |
| Transparency | 0 (none) | All shipped files are readable source/markdown; there are no binaries, base64 blobs, or unpinned runtime downloads. |
Before installing
- Read `scripts/post_patch_validation.py` around `execute_check()`, `apply_patch_file()`, and cleanup before using it.
- Run `validate-plan` on a copied plan first and inspect `result.json` for any `forwarded_env` entries.
- Use a throwaway clone or scratch repo: it will create and remove detached worktrees and temp directories.
Rated 2026-10-19 by an automated review of 5 files from the skill's repository.
Source
- Repository
- trailofbits/skills (all skills from this repository)
- Path
- plugins/post-patch-validation/skills/post-patch-validation/SKILL.md
- Branch
- main
- Collection
- post-patch-validation
- Updated
- 2026-09-19
Related skills
- fp-check — Systematically verifies suspected security bugs to eliminate false positives.
- blast-radius — Find what a change could break somewhere else before it ships, beyond the diff.
- qa-expert — This skill should be used when establishing comprehensive QA testing processes for any software project.
- address-sanitizer — Builds and runs code under AddressSanitizer to catch buffer overflows, use-after-free, and other memory errors during fuzzing or tests.
- audit-context-building — Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere.
- audit-prep-assistant — Prepares codebases for security review using Trail of Bits' checklist.