Index of every page on this site: llms.txt
All skills
Run it yourself

Generate candidate fixes for verified security findings. Consumes TRIAGE.json (preferred), VULN-FINDINGS.json, INCIDENTS.json, or a vuln-pipeline results directory. Pipeline input is delegated to the execution-verified `vuln-pipeline patch` ladder; static-analysis input gets a per-finding patch subagent + independent reviewer and is written as inert diffs for human review. Writes PATCHES/bug_NN/{patch.diff,patch_result.json}, PATCHES.md, and PATCHES.json. Use when asked to "fix the findings", "patch these vulns", "generate fixes", or "close the loop on triage".

Use this Skill: https://skilld.dev/gh/anthropics/defending-code-reference-harness/patch

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

README.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

patch

A Claude Code skill that turns verified security findings into candidate fixes: ranks the queue, routes each finding to the right verification path, and writes every diff as inert text for human review — it never applies a patch to your repo. The last leg of the vulnerability cycle: consumes /triage output (preferred) or any findings file the triage ingest recognizes, and delegates vuln-pipeline results to the execution-verified vuln-pipeline patch ladder. For how it fits the pipeline and how to review what it produces, see docs/patching.md.

Requirements

  • Claude Code CLI installed and authenticated
  • A findings input: TRIAGE.json (preferred — already verified and ranked), VULN-FINDINGS.json (unverified; the skill warns), INCIDENTS.json (untriaged D&R output; the skill warns), or a vuln-pipeline results/<target>/<ts>/ directory
  • A read-only checkout of the target codebase (--repo, default cwd) — required for static mode
  • For pipeline input only: the vuln-pipeline installed and sandboxed, since the skill shells out to vuln-pipeline patch. The target's config.yaml needs a build_command (the in-container rebuild step after applying a diff) and optionally a test_command (the regression suite for the regress tier). All four shipped C/C++ targets have build_command; only canary sets test_command — on the others the regress tier is skipped.

Usage

/patch results/<target>/<ts>/TRIAGE.json --repo ./my-service          # canonical: triaged findings
/patch results/<target>/<ts>/TRIAGE.json --repo ./my-service --top 5  # only the 5 highest-severity
/patch results/<target>/<ts>/ --model <model-id>                      # pipeline results → verification ladder
/patch findings.json --repo ./src --id f003                           # one finding by id
/patch results/<target>/<ts>/TRIAGE.json --repo ./src --fresh         # ignore checkpoint, start over

How the input routes: a pipeline results directory delegates to the vuln-pipeline patch CLI, whose ladder rebuilds the target, replays the PoC, runs the test suite, and re-attacks the patched binary (a D&R results directory containing INCIDENTS.json routes static instead). Static findings (no PoC to replay) get a fresh-context patch subagent per finding — root-cause-first, variant hunt, minimal diff, regression test emitted as part of the diff — plus a separate reviewer agent that sees only {file, line, category} and the diff bytes, never the scanner's prose. --model is passed through to vuln-pipeline patch; in static mode subagents inherit the session model.

You can also drive the pipeline CLI directly — same ladder, no skill in between (it ships with the pipeline; no extra install):

# After a find run has produced results/<target>/<ts>/:
bin/vp-sandboxed patch results/<target>/<ts>/ --model <m>

# Or try it standalone on the pre-baked canary fixture (no find run needed):
bin/vp-sandboxed patch targets/canary/fixtures/results_sample --model <m>

Full flag reference (--bug, --parallel, --no-reattack, --style, iteration and turn caps): docs/patching.md § CLI reference.

Output

  • Static mode: ./PATCHES/bug_NN/patch.diff (the candidate fix, never applied) and ./PATCHES/bug_NN/patch_result.json (verdict and provenance) — relative to the directory the skill runs in, not to the findings file.
  • Execution-verified mode: the ladder writes the pipeline layout — reports/bug_NN/{patch.diff, patch_result.json} inside the results directory, with transcripts streaming to patch_transcript_itN.jsonl and reattack_transcript_itN.jsonl per iteration — and the skill also mirrors each diff and verdict into ./PATCHES/bug_NN/, so both modes land in the same place.
  • PATCHES.md / PATCHES.json — run summary either way, one row per finding. The verified field in each ./PATCHES/bug_NN/patch_result.json says which path produced the diff: ladder_passed / ladder_failed (executable oracle) vs static_review_only (agent review). The pipeline-written reports/bug_NN/patch_result.json records the grader's verdict instead — it has no verified field.

What it does and doesn't do

  • Does: rank and filter findings, read the target source, generate diffs, review each diff independently, delegate pipeline input to the execution-verified ladder, write summaries.
  • Does not: apply a diff, write anywhere in --repo, run git apply/patch, or execute the target in static mode. There is no --apply flag by design: the capability isn't present, so it can't be prompt-injected into use. Applying the fix is your move, after the review pass described in docs/patching.md#reviewing-generated-patches.

Questions

Reach out to your Anthropic contact.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts23d3 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    The `patch` skill is a defensive security tool designed to generate candidate fixes for software vulnerabilities. It operates within a constrained environment, ensuring that generated patches are never automatically applied to the codebase and that all operations are restricted to specific directories. The design includes strong isolation between agents to prevent prompt-based interference.

  • Socket23d

    No alerts

  • Snyk4mo

    Risk: LOW · No issues

Signed by skilld at d3bea6b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Steadyupdated 4 months ago
What it can do
Reads files Edits files Runs commands
argument-hint
<findings-path> [--repo PATH] [--top N] [--id fNNN] [--model M] [--fresh]
All 14 allowed tools
ReadGlobGrepWriteTaskBash(python3 .claude/skills/_lib/checkpoint.py:*)Bash(vuln-pipeline patch:*)Bash(rg:*)Bash(grep:*)Bash(ls:*)Bash(wc:*)Bash(head:*)Bash(file:*)Bash(jq:*)

README badge

README badge for anthropics/defending-code-reference-harness/patch