コード参照ハッチの防御(GitHub リポジトリ)
Anthropic は、Claude を活用した自律的な脆弱性発見・修復パイプラインの参考実装リポジトリを公開し、同時に管理型サービス「Claude Security」への誘導を行っている。
キーポイント
自律的セキュリティパイプラインの実装公開
C/C++ のメモリ脆弱性検出に特化した、再調査からパッチ適用までの完全なループ(recon → find → verify → report → patch)を実装したオープンソースリポジトリ「Defending Code Reference Harness」を公開。
Claude Code によるインタラクティブ操作
/quickstart, /threat-model, /vuln-scan, /triage, /patch などのコマンドを提供し、開発者が Claude Code を介してスコーピングからパッチ適用まで対話的に実行可能。
管理型サービスへの誘導と非公式化
本リポジトリはメンテナンス終了・コントリビューション受け付けなしの「参考実装」であり、企業向けには多プロジェクト対応や偽陽性低減機能を持つ管理型製品「Claude Security」の利用を推奨。
汎用性とカスタマイズの可能性
プロンプト設計やサンドボックス化の手法は再利用可能であり、/customize コマンドを用いて他言語や他の脆弱性クラスへポートすることが意図されている。
Canaryターゲットでのクイックスタート
記事では、Defending Code Reference Harnessの最初の使用例として、canaryターゲット上で30秒で実行可能なガイド付きクイックスタート手順が紹介されています。
迅速な導入体験の提供
/quickstartコマンドを通じて、ユーザーは最小限の設定で即座にツールを実行し、その挙動を確認できるようになっています。
段階的な導入アプローチ
完璧なパイプラインを設計する前に、Day 1 から小さく始めて学習に基づいて拡張していくことが推奨されています。
影響分析・編集コメントを表示
影響分析
この発表は、生成 AI をセキュリティ運用(DevSecOps)へ統合する具体的な実装例を示すとともに、オープンソースの参考実装と商用管理型サービスの役割分担を明確にしました。開発者にとっては自社のセキュリティパイプライン構築の足掛かりとなる一方、企業顧客に対しては高付加価値な管理型製品への移行を促す戦略的な動きと言えます。
編集コメント
セキュリティ分野における LLM の実用化において、Anthropic は「参考実装によるエコシステム拡大」と「管理型サービスによる収益化」の両軸を同時に進めていることが読み取れます。開発者はこのリポジトリを学習素材として活用しつつ、本番環境では公式製品の導入を検討すべきでしょう。
Claude を用いた自律的な脆弱性発見と修復のための参照実装は、Claude Mythos Preview のリリース以降に複数の組織のセキュリティチームとの連携から得た知見に基づいています。これらの知見とベストプラクティスについては、 accompanying blog post(および blog-post.md)をご覧ください。また、同じ再調査→発見→選別→報告→パッチ適用のループを軽量な SDK のみで解説したウォークスルーについては、 companion cookbook をご覧ください。
本リポジトリはメンテナンスされておらず、コントリビューションも受け付けていません。
**
🔒 マネージド型オプションをご希望ですか?** Anthropic は、複数のプロジェクトにまたがるソースコード内の脆弱性を発見・修正するホスト製品である Claude Security を提供しています。Claude Security はリポジトリをスキャンして脆弱性を特定し、誤検知を減らすための多段階検証パイプラインを適用し、選別、修正の妥当性確認、迅速な修正生成というライフサイクルを通じて発見事項を管理できます。
このリポジトリは、Claude を用いた脆弱性発見のための一般的なベストプラクティスに基づいたオープンソースの参照実装です。これを用いて独自の脆弱性発見パイプラインを構築したり、ロジックをカスタマイズしたりできます。また、Claude API へのアクセス権限(Bedrock、Vertex、Azure などを含む)に応じて利用可能です。
コンテンツ
- Claude Code スキル: /quickstart, /threat-model, /vuln-scan, /triage, /patch, /customize: インタラクティブなスコーピング、スキャン、トリアージ、パッチ適用。このリポジトリを Claude Code で開き、/quickstart を実行して概要を把握してください。
- harness/: 自律型参照パイプライン(偵察→発見→検証→報告→パッチ)、Docker と ASAN (AddressSanitizer) を用いた C/C++ メモリ脆弱性の発見用に構成されています。このハーンセスは製品ではなく参照実装です。一般的な構造、プロンプト、サンドボックス化の手法は再利用可能ですが、このハーンセスをそのままあらゆるコードベースで動作させることはできません。/customize を実行して、ご自身の言語、検出器、または脆弱性クラスに移植してください。
**
⚠️ セキュリティ: /quickstart, /threat-model, /vuln-scan, および /triage はファイルの読み取りと書き込みのみを行います。静的な発見結果(TRIAGE.json または VULN-FINDINGS.json)に対して /patch を実行する場合も、同様に読み取り・書き込み専用です。/customize はハーンコードを編集し、検証コマンドを実行します。これらのスキルはいずれも、Claude Code 内で各ツールの使用をレビューして承認する限り、サンドボックスなしで安全に実行できます。自律型参照パイプライン(パイプライン結果に対する /patch を含む)はターゲットコードを実行するため**、明示的にオーバーライドされない限り gVisor サンドボックス外では実行されません。セットアップには、scripts/setup_sandbox.sh を一度実行した後、bin/vp-sandboxed を介してパイプラインを呼び出してください。詳細については、docs/security.md および docs/agent-sandbox.md を参照してください。
始め方
git clone https://github.com/anthropics/defending-code-reference-harness
cd defending-code-reference-harness
claude
30 秒のイントロダクションと、キャノリーターゲットに対するガイド付き初回実行
/quickstart
/quickstart how do I port the pipeline to Java?
/quickstart how do I triage all these bugs?
さらに読むべき資料
- ブログ記事 · 学習内容とベストプラクティスをまとめた、付随するブログ記事
- パイプライン · 仕組みの解説:図、ステージ、CLI フラグ
- セキュリティ · サンドボックス化、マウントしてはいけないもの
- エージェントサンドボックス · gViso による分離と、各エージェントごとの egress(外部通信)許可リスト
- カスタマイズ · 自分のスタックへの移植;どのファイルが変更され、その理由
- パッチ適用 · 検証済みのクラッシュに対する修正の生成と検証
- トラブルシューティング · 重複、レート制限、サブエージェントモデルの固定
- セーフガード · 危険なサイバー作業のブロック
ランプアップ(初期導入)
私たちがパートナーシップを結んだセキュリティチームの中で最も成功しているのは、最も早く実践的な取り組みを開始したチームです。完璧なパイプラインを設計するために数ヶ月を費やしたくなる誘惑はありますが、私たちは 1 日目から小さく始めて、得られた知見に基づいてそこから構築していくことを推奨します。以下の手順はそのパターンに従っており、私たちが目撃してきた内容に基づいた野心的(しかし現実的な)ペースを設定しています。
1 日目
脅威モデルを構築し、最初の静的スキャンとトリアージを実行する
2 日目
C/C++ ライブラリ上で参照パイプラインを実行する
3〜5 日目
ターゲット向けにパイプラインをカスタマイズする
第 2 週
自律的なスキャン、トリアージ、パッチ適用を開始する
ステップ 1(1 日目):脅威モデルの構築と最初の静的スキャン・トリアージの実行
1 日目は、ループ全体をエンドツーエンドで確認することに焦点を当てています。対話型スキルのみを使用して、脅威モデルを構築し、それに基づいてスコープを限定した静的スキャンを実行し、結果のトリアージを行い、候補となる修正策をドラフトします。その日の終わりにには、脅威モデル、ランク付けされた静的検出結果の一覧、および候補パッチが完成します。
関連するスキルは、リポジトリ内のファイルに対して読み取りと書き込みのみを行います。Claude Code を対話型で実行し、各ツールの使用を承認する限り、サンドボックスは不要です。
目的のモデルにすべてのサブエージェントを固定する
export CLAUDE_CODE_SUBAGENT_MODEL=<model-id>
claude
0. イントロダクションとガイド付き初回実行
/quickstart
1. 脅威モデルの構築(撃つ前に狙いを定める)
/threat-model bootstrap targets/canary
2. その脅威モデルに基づいて静的スキャンを実行
/vuln-scan targets/canary
3. 結果の確認、重複排除、およびランク付け
/triage targets/canary/VULN-FINDINGS.json
4. 確認済みの検出結果に対する候補修正の生成
/patch ./TRIAGE.json --repo targets/canary
このフローにより、THREAT_MODEL.md、VULN-FINDINGS.{json,md}、TRIAGE.{json,md}、および PATCHES/ が生成されます。
ステップ 1 で生成される脆弱性候補は、ソースコードに対する Claude の静的レビュー(何もビルドまたは実行されない)に基づくため、非カナリターゲットについては偽陽性が多くなることを想定してください。ステップ 2 では、*実行検証済み*の検出結果を生成します。
注意: canary ターゲット上では、/triage がスキャンの発見結果を偽陽性として却下する場合があります。entry.c は意図的に脆弱なデモコードであることを宣言しており、/triage はテスト用または固定データ(fixture)コード内のバグを正しく除外します。完全な確認・重複排除・偽陽性処理フローを確認するには、代わりに curated fixture で実行してください(/triage .claude/skills/triage/fixtures/canary-findings.json --repo targets/canary)、または Step 1 のスキルを自分のコードに指向させてください。
ステップ 2 (2 日目): C/C++ ライブラリ上で参照パイプラインを実行する
2 日目には、対話型スキルから、参照パイプラインを使用した最初の自律実行に移ります。既知の脆弱性を持つオープンソースライブラリを対象に、ご自身の環境で完全な再調査(recon)→ 発見(find)→ 検証(verify)→ 報告(report)ループを実行し、発見された問題に対する候補パッチを生成します。最終的には、再現可能なクラッシュ、エクスプロイト可能性に関するレポート、および候補パッチのセットが得られ、パイプラインの動作感をつかむことができます。
パイプラインの実行は簡単です:
一度きりのセットアップ
python3 -m venv .venv && .venv/bin/pip install -e .
./scripts/setup_sandbox.sh # gVisor のインストール、エージェントイメージのビルド、隔離の確認を行います(注: Docker が必要です)
export ANTHROPIC_API_KEY=sk-ant-... # または CLAUDE_CODE_OAUTH_TOKEN; パイプラインには環境変数にいずれかが必要です
再調査 → 発見 → 検証 → 報告ループの実行
bin/vp-sandboxed run drlibs --model <model-id> --runs 3 --parallel --stream --auto-focus
各発見に対して候補パッチを生成する
bin/vp-sandboxed patch results/drlibs/<timestamp>/ --model <model-id>
または、Claude Code にパイプラインの起動を依頼して実行を見守る
claude
drlibs 上でパイプラインを実行し、発見された事象について随時説明する
ループからの結果は results/drlibs/<timestamp>/ ディレクトリに格納されます。--stream フラグを使用すると、最初のレポートは数分以内に reports/bug_NN/ の下に現れます。
**
⚠️ run は自律型エージェントを起動します。** パイプラインは各エージェントを gVisor コンテナ内で実行し、外部通信(egress)は Claude API へのアクセスに制限されます。エージェント起動サブコマンドは、明示的にオーバーライドされない限り、このコンテナ外では起動しません。詳細については、docs/security.md および docs/agent-sandbox.md を参照してください。
内部では、パイプラインは 7 つのステージを順に実行します:
- Build: ASAN(C および C++ のメモリエラー検出器)を使用してターゲットを Docker イメージとしてコンパイルします。パイプラインは、初回実行時にターゲットの Dockerfile を使用して自動的にこのイメージを構築します。
- Recon: 軽量なエージェントがネットワーク分離されたコンテナ内でソースコードを読み込み、パーティション(つまり、「別々に攻撃する価値のある N の異なる入力解析サブシステムがあります」)を提案し、並列探索を行うファインダーエージェントが同じバグに収束するのではなく、異なる領域を探索できるようにします。--auto-focus フラグを使用しない場合、パイプラインはターゲットの config.yaml から focus_areas リストを使用します。
- Find: N エージェントが並列で実行され、それぞれが独自の隔離コンテナ内で動作します。各エージェントはソースコードを読み込み、不正な入力を作成し、特定の入力に対して 3 回連続してクラッシュが発生するまで ASAN バイナリを実行します。
- Verify: 別のグラダーエージェントが、ファインドエージェントが触れていない新しいコンテナ内で各クラッシュを再現します。ファインドエージェントからグラダーエージェントへ移行するのは、作成された概念実証(PoC)のみです。
- Dedupe: ジャッジエージェントは、検証済みのクラッシュを既に報告されているバグと比較し、それぞれが新たなバグなのか、既知のバグのより良い例示なのか、それともスキップすべき重複データなのかを判断します。
- Report: レポートエージェントは、各固有のバグに対して構造化された脆弱性分析レポートを作成します。これには、プリミティブクラス(primitive class)、到達可能性(reachability)、エスカレーションパス(escalation path)、および深刻度に関する詳細が含まれます。
- Patch (上記の別個の patch コマンド): パッチエージェントが提案された修正コードを記述し、グラダーエージェントが以下の条件を確認します。すなわち、新しいコードがビルドできること、元の概念実証(PoC)入力がもはやクラッシュしないこと、ターゲットのテストスイートが依然としてパスすること、そして新たなファインドエージェントが修正を回避する道を見つけられないことです。
詳細については、docs/pipeline.md を参照してください。
Step 3 (Days 3-5): Customize the pipeline for your target
3 日目から 5 日目にかけて、あなたは独自のターゲット向けにハネスをカスタマイズします。まず、ステップ 1 のスキルを使ってコードを指し示し、次に /customize コマンドを使用してパイプラインをあなたのスタックへ移植します。週が明ける頃には、パイプラインを実行できる targets/<your-service>/ ディレクトリが完成しており、パイプラインの単一の煙出しテスト(smoke run)によって検証済みで、ステップ 4 でスケールアップする準備も整っています。
参照用パイプラインは C および C++ コード内のメモリ脆弱性を見つけるために設計されていますが、その形状は汎用的です。新しい脆弱性クラスや言語へ移植するには、ターゲットのスタックに対して以下の質問に答えるだけで済みます:
質問
C/C++ 参照
あなたのターゲット(例)
発見をシグナルするのは何ですか?
ASAN クラッシュ署名
例外 / キャンアリーファイル / DNS コールバック
概念実証(PoC)はどのようなものですか?
クラッシュする入力ファイル
HTTP リクエストシーケンス / トランザクションリスト / テストハネス
ターゲットはどのようにビルドされ、実行されますか?
Dockerfile(clang + ASAN を使用)
コンテナ内でのあなたの言語のビルド
カスタマイズを行う前に、ステップ 1 のスキルを自分のコードに指し示してください。念のため、これらは読み取り専用かつ書き込み専用のため、サンドボックスなしで実行可能です。
claude
/quickstart how do I customize this for ~/code/my-service?
/threat-model bootstrap-then-interview ~/code/my-service
/vuln-scan ~/code/my-service
/triage ~/code/my-service/VULN-FINDINGS.json --repo ~/code/my-service
その後、これらのスキルによって生成された成果物を使用して、/customize スキルでハネスをコードベースに合わせて修正します。
/customize use ~/code/my-service/{THREAT_MODEL.md,VULN-FINDINGS.json} and ./TRIAGE.md
/customize の処理が完了すると、targets/my-service/ ディレクトリがセットアップされます。スケーリングする前に、パイプラインの簡易実行(smoke run)を実行して検証してください。
bin/vp-sandboxed run my-service --model <model-id> --runs 1
詳細については、docs/customizing.md を参照してください。
ステップ 4(2 週目): 自律的なスキャン、トリアージ、パッチ適用を開始する
2 週目には、ステップ 3 でカスタマイズしたパイプラインを独自のターゲットに対して使用し、内部パイプラインループに*外側*のループを追加します。複数のパイプラインスキャンを実行し、それらすべての実行からの発見事項をトリアージし、優先順位に基づいてパッチを適用し、これを繰り返します。
スキャン - ターゲットに対して並列実行の一斉走査(wave)を実行
bin/vp-sandboxed run my-service --model <model-id> --runs 5 --parallel --stream --auto-focus
トリアージ - 脅威モデルを使用して、すべての走査からの発見事項を重複排除し、ランク付けする
/triage results/my-service/ --repo ~/code/my-service --auto --votes 5
パッチ適用 - トリアージで最高位にランクされたものから始め、修正の生成と検証を行う
/patch results/my-service/<timestamp>/ --model <model-id>
⚠️ ステップ 2 と同じサンドボックス化ガイドラインに従ってください
与えられたパイプライン実行は、すでに自身の発見を検証し重複を排除しています。
/triage は多数のパイプライン実行にわたって機能します。結果ディレクトリを指すことで、すべての実行における重複を統合し(存在する場合は /vuln-scan からの静的な発見も含まれ)、脅威モデルに対して深刻度評価を再較正し、各発見をコンポーネントの所有者へルーティングしようと試みます。
可能な限り迅速に発見を修正することは、外側のループをできるだけ生産的に保つために役立ちます。発見が修正されると、モデルはそれらを再度検出できず、代わりに通常はより深い新たな問題のみを表面化します。パイプラインの波を実行する回数が増えるにつれて、発見数は減少する可能性がありますが、複雑さはむしろ増加するでしょう。迅速なパッチ適用ができない場合でも、対象の既知のバグリスト(known_bugs)に過去の発見を記録しておくだけで、将来の実行をより新しいバグへと誘導するのに役立ちます。
自律的なトリアージとパッチ適用は依然として未解決の課題であり、このリファレンスハルネスでは完全には解決されていません。/patch 内の検証戦略は基準を引き上げますが、深刻度や優先順位付けは最終的に環境に応じた判断であり、検証済みパッチが常に上位プロジェクトへ取り込まれるとは限りません。多くのパートナー企業がこれらのステップを現在のボトルネックとして報告しており、これらには実際のエンジニアリング時間を予算化しておく必要があります。
詳細については、docs/triage.md および docs/patching.md をご覧ください。
将来を見据えて
初期の立ち上げフェーズを経て、これまで協力してきたチームは、主にいくつかの方向性に投資する傾向があります:
- 自社のすべての内部リポジトリと主要なオープンソース依存関係をレビューし、スキャンすべき優先順位を付けます(例えば、暴露リスク、過去の CVE の履歴、ビジネス上の重要度に基づいて)。その後、優先順に従ってリストのスキャンを進めます。
- スキャン用の専用インフラストラクチャを整備し、ノートパソコンや単発の仮想マシンからのスキャンを移行します。最も成功しているチームは、スケールアップする前に完璧なスキャンプラットフォームを構築しようとする衝動に抗っています。
- 開発ライフサイクル(SDLC)にスキャンを組み込みます。一部のチームでは、定期的なスキャン(例えば、毎日、毎週)を設定したり、CI パイプラインにスキャン機能を追加したりしています。
- 自社の状況に最も適したモデルを見つけるために、さまざまなモデルのテストと実験を行っています。
原文を表示
A reference implementation for autonomous vulnerability discovery and
remediation with Claude, based on our learnings from [partnering with security
teams at several organizations](https://www.anthropic.com/glasswing)
since launching Claude Mythos Preview. For a write up of these learnings along with
best practices, see the accompanying blog post
(also available in blog-post.md). For a lightweight SDK-only
walkthrough of the same recon → find → triage → report → patch loop, see the
This repo is not maintained and is not accepting contributions.
🔒 Want a managed option? Anthropic offers
Claude Security, a hosted product
that finds and fixes vulnerabilities in your source code across multiple
projects. Claude Security scans your repository for vulnerabilities,
applies a multi-stage verification pipeline to reduce false positives, and
lets you manage findings through their lifecycle: triage, fix validation,
and rapid fix generation.
This repository is an open-source reference implementation based on general
best practices for finding vulnerabilities using Claude. You can use it to
build your own vulnerability finding pipeline, customize the logic, and it
can be used with whatever access you have to Claude APIs (including
Bedrock, Vertex, or Azure).
Contents
- Claude Code skills: /quickstart, /threat-model, /vuln-scan,
/triage, /patch, /customize: interactive scoping, scanning, triage,
and patching. Open this repo in Claude Code and run /quickstart to get
oriented.
- harness/: the autonomous reference pipeline (recon → find → verify
→ report → patch), configured for finding C/C++ memory vulnerabilities
using Docker and ASAN. This harness is a reference, not a product.
The general shape, prompts, and sandboxing are reusable, but the harness
will not work on every codebase out of the box. Run /customize to port it
to your language, detector, or vuln class.
⚠️ Security: /quickstart, /threat-model, /vuln-scan, and /triage
only read and write files. Running /patch on static findings (TRIAGE.json
or VULN-FINDINGS.json) is likewise read- and write-only. /customize edits
the harness code and runs validation commands. Any of these skills are safe to
run unsandboxed, as long as you review and approve each tool use in Claude Code.
The autonomous reference pipeline (including /patch on pipeline results)
executes target code, so it refuses to run outside of a gVisor sandbox
unless explicitly overridden. To get set up, run scripts/setup_sandbox.sh once,
then invoke the pipeline via bin/vp-sandboxed. See docs/security.md
and docs/agent-sandbox.md for more details.
Getting Started
git clone https://github.com/anthropics/defending-code-reference-harness
cd defending-code-reference-harness
claude
# 30-sec intro + guided first run on the canary target
> /quickstart
> /quickstart how do I port the pipeline to Java?
> /quickstart how do I triage all these bugs?Further Reading
- Blog Post · The accompanying blog post with learnings + best practices
- Pipeline · How it works: diagram, stages, CLI flags
- Security · Sandboxing, what not to mount
- Agent sandbox · gVisor isolation + egress allowlist for every agent
- Customize · Port to my stack; which files change and why
- Patching · Generate and verify fixes for verified crashes
- Troubleshooting · Duplicates, rate limits, subagent model pinning
- Safeguards · Block for dangerous cyber work
Ramp Up
The most successful security teams we've partnered with are those
that have gotten hands-on the fastest. Though it's tempting to
spend months designing the perfect pipeline, we recommend starting
small on Day 1 and building from there as learnings come. The
steps below follow that pattern and set an ambitious (but reasonable)
pace based on what we've seen.
Day 1
Build a threat model and run your first static scan + triage
Day 2
Run the reference pipeline on a C/C++ library
Days 3-5
Customize the pipeline for your target
Week 2
Start autonomous scanning, triage, and patching
Step 1 (Day 1): Build a threat model and run your first static scan + triage
Day 1 is focused on seeing the whole loop end-to-end. Using only the
interactive skills, you'll build a threat model, run a static scan scoped
by it, triage what comes back, and draft candidate fixes. You'll finish
the day with a threat model, a ranked list of static findings, and candidate
patches.
The relevant skills only read and write files in your repo. As long as you
run Claude Code interactively and approve each tool use, no sandbox is needed.
# Pin every subagent to the model you want
export CLAUDE_CODE_SUBAGENT_MODEL=<model-id>
claude
# 0. intro + guided first run
> /quickstart
# 1. Build a threat model (aim before you shoot)
> /threat-model bootstrap targets/canary
# 2. Run a static scan, scoped by that threat model
> /vuln-scan targets/canary
# 3. Verify, dedupe, and rank what came back
> /triage targets/canary/VULN-FINDINGS.json
# 4. Generate candidate fixes for the verified findings
> /patch ./TRIAGE.json --repo targets/canaryThis flow produces THREAT_MODEL.md, VULN-FINDINGS.{json,md},
TRIAGE.{json,md}, and PATCHES/.
The vulnerability candidates produced in Step 1 come from Claude's static
review of the source (nothing is built or run), so expect more false positives on
any non-canary targets. In Step 2, you'll produce *execution-verified* findings.
Note: on the canary target, /triage may dismiss the scan's findings
as false positives. entry.c announces itself as deliberately vulnerable
demo code, and /triage correctly excludes bugs in test / fixture code.
To see the full confirm / dedupe / false positive flow, run it on the
curated fixture instead (/triage .claude/skills/triage/fixtures/canary-findings.json --repo targets/canary) or point the Step 1 skills at your own code.
Step 2 (Day 2): Run the reference pipeline on a C/C++ library
On Day 2, you'll move from interactive skills to your first autonomous
run using the reference pipeline. You'll run the full recon → find →
verify → report loop in your environment on a known-vulnerable open-source
library, then generate a candidate patch for what it finds. You'll finish
with a set of reproducible crashes, exploitability reports, and candidate patches,
along with a feel for how the pipeline works.
Running the pipeline is simple:
# One-time setup
python3 -m venv .venv && .venv/bin/pip install -e .
./scripts/setup_sandbox.sh # installs gVisor, builds the agent images, and verifies isolation; note: requires Docker
export ANTHROPIC_API_KEY=sk-ant-... # or CLAUDE_CODE_OAUTH_TOKEN; the pipeline requires one in env
# Run the recon → find → verify → report loop
bin/vp-sandboxed run drlibs --model <model-id> --runs 3 --parallel --stream --auto-focus
# Generate a candidate patch for each finding
bin/vp-sandboxed patch results/drlibs/<timestamp>/ --model <model-id>
# Or, ask Claude Code to launch the pipeline and watch the run for you
claude
> run the pipeline on drlibs and explain findings as they comeResults from the loop land in a results/drlibs/<timestamp>/ directory. With
the --stream flag, the first report will appear in minutes under reports/bug_NN/.
⚠️ run spawns autonomous agents. The pipeline runs each agent
inside a gVisor container with egress restricted to the Claude API.
Agent-spawning subcommands refuse to start outside it unless explicitly
overridden. For more information, see docs/security.md
and docs/agent-sandbox.md.
Under the hood, the pipeline walks through seven stages:
- Build: Compiles the target into a Docker image with ASAN (the memory
error detector for C and C++). The pipeline builds this image automatically
on first run using the target's Dockerfile.
- Recon: A lightweight agent reads the source inside a network-isolated
container and proposes a partition, i.e., "here are N distinct input-parsing
subsystems worth attacking separately", so that parallel find agents explore
different areas instead of converging on the same bug. Without the --auto-focus
flag, the pipeline uses the focus_areas list from the target's config.yaml.
- Find: N agents run in parallel, each in its own isolated container.
Each agent reads the source, crafts malformed inputs, and runs the ASAN
binary until a given input produces a crash 3 out of 3 times.
- Verify: A separate grader agent reproduces each crash in a fresh
container that the find agent hasn't touched. The only thing that crosses over
from the find agent to the grader is the proof of concept it produced.
- Dedupe: A judge agent compares verified crashes against bugs already
reported and decides whether each is a new bug, a better example of a known
bug, or a duplicate to skip.
- Report: A report agent writes a structured exploitability analysis per
unique bug, including details on primitive class, reachability, escalation
path, and severity.
- Patch (the separate patch command above): A patch agent writes a proposed
fix, and a grader agent confirms that the new code builds, that the original
proof of concept input no longer crashes, that the target's test suite still
passes, and that a fresh find agent can't find a way around the fix.
For more details, see docs/pipeline.md.
Step 3 (Days 3-5): Customize the pipeline for your target
On Days 3-5, you'll customize the harness for your own target. First, you'll
point the Step 1 skills at your code, then you'll use /customize to port the
pipeline to your stack. By the end of the week, you'll have a targets/<your-service>/
directory that the pipeline can run against, validated with a single smoke run
of the pipeline, and ready to scale up in Step 4.
While the reference pipeline is designed for finding memory vulnerabilities in C and C++
code, its shape is generic. Porting it to a new vuln class or language just means
answering the following questions for your target stack:
Question
C/C++ Reference
Your target (examples)
What signals a finding?
ASAN crash signature
exception / canary file / DNS callback
What does a proof of concept look like?
crashing input file
HTTP request sequence / tx list / test harness
How is the target built and run?
Dockerfile (using clang + ASAN)
your language's build in a container
Before customizing, point the Step 1 skills at your own code. As a reminder,
they're read- and write-only, so they can run unsandboxed.
claude
> /quickstart how do I customize this for ~/code/my-service?
> /threat-model bootstrap-then-interview ~/code/my-service
> /vuln-scan ~/code/my-service
> /triage ~/code/my-service/VULN-FINDINGS.json --repo ~/code/my-serviceThen, use the artifacts produced by those skills in the /customize skill,
which modifies the harness for your codebase.
> /customize use ~/code/my-service/{THREAT_MODEL.md,VULN-FINDINGS.json} and ./TRIAGE.mdWhen /customize is done, you'll have a targets/my-service/ directory
set up. Validate it with a smoke run of the pipeline before scaling up.
bin/vp-sandboxed run my-service --model <model-id> --runs 1For more details, see docs/customizing.md.
Step 4 (Week 2): Start autonomous scanning, triage, and patching
In Week 2, you'll use the pipeline you customized in Step 3 on your own
targets, adding an *outer* loop to the inner pipeline loop - run multiple
pipeline scans, triage the findings from across those runs, patch based
on prioritization, and repeat.
# Scan - run a wave of parallel runs against your target
bin/vp-sandboxed run my-service --model <model-id> --runs 5 --parallel --stream --auto-focus
# Triage - dedupe and rank every finding across all waves using your threat model
> /triage results/my-service/ --repo ~/code/my-service --auto --votes 5
# Patch - generate and validate fixes, starting with what triage ranked the highest
> /patch results/my-service/<timestamp>/ --model <model-id>⚠️ Follow the same sandboxing guidelines as in
Step 2
A given pipeline run already verifies and deduplicates its own findings.
/triage works across many pipeline runs. When pointed at the results/
directory, it collapses duplicates across all runs (and any static findings
from /vuln-scan if present), recalibrates severity ratings against your
threat model, and attempts to route every finding to the component owner.
When possible, patching findings quickly helps keep the outer loop as
productive as possible. When findings are fixed, the model can't re-find
them, and instead will surface net new, typically deeper issues. As you run
more pipeline waves, the number of findings will likely go down, but the
complexity will likely also go up. If quick patching isn't possible, even
just recording prior findings in the target's known_bugs can help steer
future runs toward newer bugs.
Autonomous triage and patching are still open issues, and this reference
harness doesn't fully solve them. The verification strategies in /patch
help raise the bar, but severity and prioritization are ultimately
judgments about your environment, and verified patches are not always
upstreamable. Many partners have reported these steps as their current
bottlenecks, and you should budget real engineering time for them.
For more details, see docs/triage.md and
Looking Forward
After the initial ramp up, the teams we've worked with have tended to invest in a
few directions:
- Reviewing all their internal repos and key open-source dependencies,
ranking which are the most important to scan (e.g., based on their exposure,
history of CVEs, business-criticality), then working through scanning the
list in priority order.
- Setting up bespoke infrastructure for scanning to move scans off of laptops
or one-off VMs. The most successful teams resist the urge to build the perfect
scanning platform before scaling up.
- Incorporating scans into their SDLC. Some teams have set up recurring scans
(e.g., daily, weekly) or have added scanning into their CI pipelines.
- Testing and experimenting with the models to find what works best for them.
関連記事
[AINews] アンソロピックがシリーズ H で 9650 億ドルを調達、Opus 4.8 と Dynamic Workflows/ultracode を発表
アンソロピックは時価総額 9000 億ドルでシリーズ H ラウンドから 650 億ドル(一部はハイパースケイラーからの出資を含む)を調達し、収益年率を 470 億ドルに引き上げたと発表した。同社はこれに伴い、新モデル「Opus 4.8」とワークフロー機能「Dynamic Workflows/ultracode」も公開した。
動的ワークフローの紹介(3 分読了)
Jarred Sumner は動的ワークフローを活用し、Bun を Zig から Rust に書き換え、11 日間で 75 万行のコードを処理してテストスイートの成功率 99.8% を達成した。この手法では Claude がタスクを細分化し、エージェントが並列実行して結果が収束するまで動作する。
プロダクト全体でのClaudeの隔離手法について
Simon Willison氏は、AnthropicがClaude.aiやClaude Codeなど複数の製品で採用しているサンドボックス技術の詳細なドキュメントを評価し、その信頼性向上への貢献を指摘した。