agentic-actions-audito…
Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI,…
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
Claude Code
$ npx -y skills add trailofbits/skills --skill post-patch-validation --agent claude-code
Codex
$ npx skills add trailofbits/skills --skill post-patch-validation -a codex -y
Cursor
$ npx skills add trailofbits/skills --skill post-patch-validation -a cursor -y
Gemini CLI
$ npx skills add trailofbits/skills --skill post-patch-validation -a gemini-cli -y
GitHub Copilot
$ npx skills add trailofbits/skills --skill post-patch-validation -a github-copilot -y
OpenCode
$ npx skills add trailofbits/skills --skill post-patch-validation -a opencode -y
Windsurf
$ npx skills add trailofbits/skills --skill post-patch-validation -a windsurf -y
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. allowed-tools: Read Write Edit Grep Glob Bash Workflow
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.
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:
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.jsonUse `--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:
uv run {baseDir}/scripts/post_patch_validation.py print-schema4. Run `validate-plan` for the complete validation, including coverage, command restrictions, and pinned inputs, before executing code:
uv run {baseDir}/scripts/post_patch_validation.py validate-plan \
--plan post-patch-validation/plan.json5. Execute the evidence plan:
uv run {baseDir}/scripts/post_patch_validation.py run \
--plan post-patch-validation/plan.json \
--output post-patch-validation/results6. 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.
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.
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:
"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_
Trail of Bits skills and plugins for AI-assisted security analysis, testing, and development. Install this marketplace in Claude Code or Codex, or import it into your ChatGPT workspace marketplace.
Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI,…
Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on…
Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing…
Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools,…
Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging…
Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…