Process Document: Operate DCRH (Scan → Triage → Remediate)
Owner: AppSec / Security Engineering team operating the harness | Last Updated:
2026-08-14 | Review Cadence: Quarterly, or after any upstream change to
anthropics/defending-code-reference-harness
Verified against the runnable copy in ../../samples/defending-code-reference-harness/
— every CLI flag below was checked against harness/cli.py's argparse definitions, not
recalled from the README.
Purpose
Give a security team a repeatable procedure for using DCRH to find, verify, and fix memory-safety bugs in a C/C++ target — from first threat model through a verified patch — without re-deriving the workflow from source each time. DCRH itself is a reference implementation, not a product: this document is what turns that reference into an operable team process.
Scope
In scope: the static/memory-safety track (/threat-model, /vuln-scan, /triage,
vuln-pipeline, /patch) run against a target directory under targets/<name>/ with a
Dockerfile. Out of scope: the detection & response track (dnr-pipeline,
/dnr-hunt, /dnr-respond) — that has its own scope and target shape (log corpora, not
source) and deserves a separate process document if adopted; /customize (porting the
pipeline to a new stack) is a one-time engineering task, not a recurring operational
process.
RACI Matrix
| Step | Responsible | Accountable | Consulted | Informed |
|---|---|---|---|---|
| Threat model the target | Security analyst | AppSec lead | Target's engineering owner | Security engineering team |
| Static scan + triage | Security analyst | AppSec lead | — | Target's engineering owner |
| Autonomous pipeline run (find/grade/report) | Security engineer (sandbox operator) | AppSec lead | Infra/platform team (Docker/gVisor host) | Security analyst |
| Patch generation + verification | Security engineer | AppSec lead | Target's engineering owner (for upstream-ability) | Security analyst |
| Review + apply patch | Target's engineering owner | Engineering manager | Security engineer | AppSec lead |
| Sandbox setup & credential rotation | Security engineer (sandbox operator) | AppSec lead | Infra/platform team | Security engineering team |
Process Flow
┌─────────────┐ ┌──────────────┐ ┌────────────────┐ ┌───────────────┐ ┌──────────┐
│ 1. Threat │──▶│ 2. Scan │──▶│ 3. Triage │──▶│ 4. Patch │──▶│ 5. Act │
│ model │ │ (static or │ │ (verify+dedupe+ │ │ (draft+grade │ │ on │
│ │ │ pipeline) │ │ rank) │ │ fix) │ │ verdict │
└─────────────┘ └──────────────┘ └────────────────┘ └───────────────┘ └──────────┘
│ │ │
│ └── autonomous path branches to Setup & Sandbox first ──┐ │
▼ ▼ ▼
THREAT_MODEL.md results/<target>/<ts>/ PATCHES/
Detailed Steps
Step 1: Threat model the target
- Who: Security analyst
- When: Before the first scan of any new target, or when the target's attack surface materially changes
- How: In a Claude Code session opened on the harness repo (or the target's own repo,
per
/customize's guidance), run/threat-model bootstrap <target>(no engagement owner available) or/threat-model bootstrap-then-interview <target>(owner has time — spend their time only on what the code couldn't answer). Read-only; never builds or executes the target. For open-source targets, read the project'sSECURITY.mdfirst and feed its stated scope in — many projects rule out bug classes as "by design." - Output:
THREAT_MODEL.md— ranked threats (not a bug list), used to scope both the static scan andvuln-pipeline recon.
Step 2: Scan — static or execution-verified
- Who: Security analyst (static) or Security engineer (autonomous pipeline)
- When: After Step 1's threat model exists
- How: Two paths, not mutually exclusive:
- Static (fast, more false positives, no sandbox needed):
/vuln-scan <target>— readsTHREAT_MODEL.mdas scoping context if present in the target directory. - Execution-verified (slower, requires the sandbox from the Setup runbook):
bin/vp-sandboxed run <target> --model <model-id> --runs N --parallel --stream --auto-focus.--auto-focusruns recon first and uses its partition; omit it iffocus_areasis hand-written in the target'sconfig.yaml. Start with a small--runs 3wave to measure token burn before scaling up (see run-a-detection-scan.md). - Output:
VULN-FINDINGS.{json,md}(static) orresults/<target>/<timestamp>/withreports/bug_NN/report.jsonper unique bug (pipeline, with--stream).
Step 3: Triage — verify, dedupe, rank
- Who: Security analyst
- When: After Step 2 produces findings (static or pipeline, one run or many)
- How:
/triage <findings-source> --repo <target>— for static findings, point atVULN-FINDINGS.json; for pipeline output, point at aresults/<target>/directory (collapses duplicates across all runs, recalibrates severity against the threat model, attempts to route each finding to a component owner). Use--auto --votes 5when triaging across many pipeline waves. - Output:
TRIAGE.{json,md}— verified, deduped, ranked findings ready for patching.
Step 4: Patch — draft and adversarially grade a fix
- Who: Security engineer
- When: After Step 3 produces a ranked
TRIAGE.json(static) or aresults/directory (pipeline) - How: Static findings:
/patch ./TRIAGE.json --repo <target>. Pipeline findings:bin/vp-sandboxed patch results/<target>/<timestamp>/ --model <model-id>(add--bug Nto patch one bug faster;--no-reattackto skip the re-attack tier for speed at the cost of thoroughness;--stylefor the advisory style judge). The grading loop rebuilds, re-runs the original PoC, runs the target's test suite, and — unless--no-reattack— launches a fresh find agent against the patched code before the fix is trusted. - Output:
PATCHES/(static) or a verified diff underresults/<target>/<timestamp>/(pipeline), each tagged with aPatchVerdict.
Step 5: Act on the verdict
- Who: Target's engineering owner, informed by the security engineer
- When: After Step 4 produces a verified patch
- How: Review the diff (target-derived text was wrapped in
<untrusted_data>at generation time — still review manually, that's a mitigation, not a guarantee). If verified and upstreamable, open a PR against the target. If not upstreamable (e.g. a vendored dependency), record the finding + patch as documentation and considerknown_bugsin the target'sconfig.yamlso future runs don't re-surface it. - Output: Merged fix, or a documented decision not to upstream.
Exceptions and Edge Cases
| Scenario | What to Do |
|---|---|
/triage dismisses all findings on targets/canary |
Expected — canary's entry.c announces itself as deliberately vulnerable demo/test code, and /triage correctly excludes test fixtures. To see the full confirm/dedupe/FP flow, run /triage against the provided curated fixture (.claude/skills/triage/fixtures/canary-findings.json --repo targets/canary) instead. |
| A pipeline batch is killed mid-run | Resumable: bin/vp-sandboxed run <target> --runs N --resume <results-dir> with the same --runs N the batch was launched with — skips runs whose result.json reached a terminal state, retries agent_failed/build_failed/error ones. See Troubleshooting in the upstream docs. |
A run hits error_max_turns |
Not resumable by design (resuming would multiply the turn cap). Any crash submitted before the cap is still salvaged and graded; raise --max-turns and start a fresh run for the rest. |
| Target's build needs internet access mid-scan | Should not happen by design — the setup/attack split means all internet-needing work (dependency install, compile) happens during the Docker build, before the agent container is created on the egress-restricted network. If it's happening, the target's Dockerfile likely fetches something at runtime — fix the Dockerfile, don't loosen the sandbox. |
A finding looks severe but the target's SECURITY.md rules it out of scope |
Record it in the threat model as a documented, accepted risk rather than re-litigating it every scan; don't let /triage keep re-surfacing it — add to known_bugs. |
Using a non-default ANTHROPIC_BASE_URL or Bedrock/Vertex |
The default egress allowlist only permits api.anthropic.com:443. Set VP_EGRESS_ALLOW before running scripts/setup_sandbox.sh (see setup-and-sandbox.md) — changing it later requires re-running setup, which drops any live agent connections, so do it between batches. |
Metrics
| Metric | Target | How to Measure |
|---|---|---|
| Time from scan start to first verified report | < a few hours for a --runs 3 wave |
Timestamp on results/<target>/<ts>/ vs. first reports/bug_NN/report.json |
| False-positive rate (static track) | Decreasing over successive threat-model iterations | /triage's dismissed-vs-confirmed ratio per run |
| Verified-fix rate | Track, don't over-target — some findings aren't upstreamable | Count of PatchVerdict passes vs. total findings patched |
| Token burn per agent | ~10K uncached input / ~2K output TPM (repo's own sizing rule) | Sum usage blocks in run_NNN/ transcripts |
| Recurrence rate | Bugs a subsequent pipeline wave re-finds after a claimed fix | Compare found_bugs.jsonl across successive batches on the same target |
Related Documents
- Setup & Sandbox runbook
- Run a Detection Scan runbook
- Patch & Verify runbook ⚠️ edits code
- Process Optimization
Defending Code Harness Vault/DCRH/DCRH — Sandboxing and Trust Boundaries.mddocs/design/HLD.md,docs/design/LLD.md