Factory、自律型コード生成ツール「Droid Shield 2.0」を公開し機密検知機能を強化
本文の状態
日本語全文を表示中
詳細モードで約21分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Factory Engineering
Factory は自律型コード生成における秘密検出の精度向上のため、誤検知と見落としをそれぞれ最適化した2つの新モデルを搭載した Droid Shield 2.0 を公開し、そのモデル重みもオープンソースとして提供している。
AI深層分析を開く2026年8月4日 14:35
AI深層分析
キーポイント
自律型開発における秘密検出の課題
従来の決定論的スキャナは、プレースホルダーでの誤検知(False positives)や固定パターンにない秘密の見落とし(False negatives)という2つの重大な欠陥を抱えていた。
2 つの専用モデルによる解決
見落としを防止する「Risk」モデルと、誤検知を解除する「Downgrade」モデルという2 つの微調整済みモデルを導入し、それぞれ異なる失敗モードに最適化している。
性能とコストの劇的改善
新モデルは既存の最先端分類器と比較して最強または同等の精度を維持しつつ、コストは大幅に削減され、レイテンシも著しく短縮されている。
オープンソースによるセキュリティ向上への貢献
Factory はソフトウェアセキュリティとプライバシーに関する将来の研究を促進するため、これらのモデルの重み(weights)を公開してコミュニティに提供している。
Downgrade モードの動作
スキャナーが検知した候補はすべてマスキングされ、モデルは文脈のみからそのブロックを維持するか誤検知として解除するかを判断する。
重要な引用
Our models sit on opposite ends of the deterministic scanner — they don't review the same events and are optimized separately for distinct failure modes.
We're releasing the model weights in the interest of compounding future work on software security and privacy.
The model must decide from context alone whether the scanner hit should stay blocked or be cleared as a false alarm.
This is a tunable threshold we control that requires no retraining for reconfiguration.
編集コメントを表示
編集コメント
自律型開発の普及を阻むセキュリティ懸念に対し、検出精度とコスト効率を両立するモデルを公開した点は業界にとって大きな前進である。特にモデル重みをオープンソース化し、コミュニティ全体でのセキュリティ向上を図る姿勢は評価に値する。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Droid Shield 2.0: 学習による機密検出
Factory の Droids は、人間が完全に監視できる量を超えてコードを記述・リファクタリングし、コミットします。エンタープライズ規模で自律的なソフトウェアエンジニアリングを安全に保つためには、信頼性が高く、かつ不必要な摩擦を生じさせない機密検出機能が不可欠です。
Droid Shield は、自律的なコミットやプッシュ時に潜在的な機密情報が漏洩するのを防ぐための追加の防御ラインです。このツールはコミットの各行を一つずつ確認し、既知のシークレットに似たパターンや、機密性を示すランダム性の度合いを検索します。不審なケースが検出されると、コミットはブロックされ、ユーザーにはエラーメッセージが返されます。大企業を含む多くの顧客が、自律的なソフトウェアファクトリーのすべてのフェーズを安全かつ確実に運用できるよう、Shield を活用しています。
制限事項
スキャナは決定論的であるため、現在以下の 2 つの失敗モードに直面しています。
- 誤検知(False positives): プレースホルダー、サンプル、テスト用データ、ドキュメント、機密ではない識別子などに反応してアラートが発生します。これが摩擦を生み、ユーザーがアラートを無視する癖をつけてしまう原因となります。
- 見落とし(False negatives): 固定されたパターンセットに一致しない実際の機密情報を検出できず、完全自律型の運用における信頼性が低下します。
Droid Shield の改良版を、2 つのケースそれぞれに対応する 2 つの新規ファインチューニング済みモデルとともに発表します。各モデルは最適な動作点に調整されており、コストは大幅に抑えつつレイテンシも劇的に改善されています。その性能は、両タスクにおいて既存の最先端手法と比べて最強、あるいは同等の精度を誇ります。ソフトウェアセキュリティとプライバシーに関する今後の研究を促進するため、モデルの重み(weights)を公開します。
分類
私たちのモデルは、決定論的なスキャナーの対照的な位置に配置されています。つまり、両者は同じイベントを監視するのではなく、それぞれ異なる失敗モードに対して個別に最適化されています。
リスク検出: スキャナーがトリガーしなかった際に動作します。変更された行は文脈全体の中で依然として機密情報を含んでいるように見える場合です。ここでは「真の秘密を見逃す」という致命的なエラーを避けるため、リコール(再現率)の最大化に注力しています。そのためには、より多くの真陽性(true positives)を検出するために、若干の過剰警告を引き受けるトレードオフを受け入れています。
ダウングレード判定: スキャナーがトリガーした場合に動作します。類似した文脈ウィンドウを読み込みますが、検出されたすべての秘密候補は、モデルが判断する前にマスク処理されます。モデルは文脈情報だけに基づいて、「スキャナーによるブロックを維持すべきか」、それとも「誤検知として解除すべきか」を決定します。リスク検出と同様、ここでは「真の秘密を見逃す」ことが致命的なエラーとなります(具体的には、スキャナーが既に検出した秘密を誤って解除してしまうケースです)。モデルが誤検知であると確信した場合のみ、スキャナーによるブロックを解除します。これは、誤検知の削減と、真の秘密が漏洩するリスクとのバランスを取る判断です。
各モデルは、バイナリ判定(Yes/No)とユーザー向けの簡潔な理由を出力します。この判定の確からしさは、その周辺トークンの確率分布に基づいてスコアリングされます。これは調整可能な閾値であり、再設定のためにモデルの再学習は不要です。
Droid Shield 2.0 では、すべてのコミットが決定論的なスキャナを経由します。パターンに一致した場合は「ダウングレードモデル(スクラップされたウィンドウ)」へ、より広範なフィルタリングでシークレットらしき行と判定された場合は「リスクモデル(生データウィンドウ)」へと振り分けられます。
データセット
学習と評価には、Samsung's CredData をベースとしたデータを使用しています。これは実際のソースファイルとその注釈付きスパンから構成される公開ベンチマークです。各サンプルは T(真のシークレット)、F(誤検知)、または X(未判定)として注釈されています。
生成プロセスにおける判断精度を向上させるため、未判定サンプルの一部を手動でラベル付けし、学習セットと評価セットの両方に含めました。これらはデータパイプライン内での追加的な判断基準となる根拠付き推論例として活用され、より広範な未判定行群の評価にも用いられます。
リスク判定モデルとダウングレードモデルは、同じソース素材から異なるスライスを使用します:
- リスク判定行: 元のスキャナが検出対象としなかった行です。候補となる値を含む生データウィンドウをそのまま使用します。
- ダウングレード行: スキャナがヒットした行です。ウィンドウ全体にわたる既知の認証情報スパンをすべてマスクし、モデルがシークレット値そのものを一切見ずに判断力を習得できるようにしています。
両方のタスクにおいて、すべての例は同じ形状をしています。モデルが観測する入力と、学習して出力すべきラベルです。 (原文の技術表記: input、label)
入力には、再構築されたコードウィンドウ(lines)、ファイルの拡張子、およびfocus_lineインデックスが含まれます。 (原文の技術表記: input、extension)
判断の基準となる行。label は、バイナリ形式の判定結果(S=安全、B=実際の秘密)と、その理由を簡潔に記述したものです。 (原文の技術表記: verdict、reason)
リスクは、候補値を明文化された状態(CredData の正例は公開され、難読化される)に保ちます。これはスキャナーの見落とし後にモデルが判断すべき対象です。この例では、テストコードに見える場所に TOTP シークレットが存在しますが、その形状は本物と見紛うほどであるため、レビュー対象としてフラグを立てるべきです。
Downgrade(ダウングレード)は逆のケースです。スキャナーがすでに検知したため、モデルが確認する前にすべての検出されたシークレットはマスクされます。この場合、モデルはコンテキスト情報だけに基づいて、マスクされたヒットが実際のシークレットなのか、それとも誤報なのかを判断する必要があります。
リスク評価用のトレーニングセットには 5,000 件のデータが含まれています:実在するシークレットが 2,000 件(40%)、誤報が 2,000 件(40%)、不明なケースが 1,000 件(20%)です。評価セットには実在するシークレットと誤報がそれぞれ 427 件ずつ含まれています。セキュリティ上の理由から、実際の運用環境のデータ分布を模倣しようとするのではなく、あえてこのバランスの取れた構成を採用しました。
ダウングレード版のトレーニングセットには6,776件のデータが含まれています。その内訳は、実在するシークレットが4,726件(69.7%)、誤検知が1,940件(28.6%)、不明なものが110件(1.6%)です。
評価セットには実在するシークレットが90件、誤検知が340件含まれており、実在するシークレットの割合は約21%となっています。これは私たちがサンプリングした本番環境全体のベースレートと一致しています。
モデルの学習と評価に用いるデータミックスは、集約されたセッションデータから導き出されたファイルタイプのプロフィールに合わせて選定されています。これにより、モデルは ts/py/md/tsx といった特定の偏り(スクリプト)を有するデータを積極的に学習します。
これらは実際の差分で出会い、異なる言語の形状を学習します。
周囲の秘密を囲む。LLM 判定アンサンブル(主審に GPT-5.5、裁定役として Opus 4.8 を採用)が、学習結果の判定とその理由付けを行います。
判断ミスを最小限に抑え、ファインチューニングが決定論的なソースから学習できるようにするため、実際の信頼データ(CredData)の真実源に基づいています。
リスクは CredData の分類体系全体に広がっており、パスワードに偏っています。これは理にかなっています。パスワードには事前に定義されたエントロピーやフォーマットがないため、決定論的に検出するのが難しいからです。
ダウングレードセットでは、マスクされたスキャナによる検出が確認されるため、削除された認証情報は確定的な形状を持つものに偏ります。これは主に鍵やシークレットに依存しています。
プライバシーについて: 実際のセッションは学習用データ行にはなりません。使用されるのは、識別情報を防止するために十分な数の異なるセッションからサンプリングされた集計クラスの事前分布のみです。これらはユーザーのコンテンツを一切露出させることなく、カリキュラムと評価ミックスの調整に利用されます。
訓練と評価
コーディング能力、推論機能、そして最先端モデルと比較したコスト・レイテンシの改善により、Qwen 3.6 35B A3B をベースモデルとして選択しました。今後の研究では、Nemotron 3 Nano など、さらに小型の言語モデルのパフォーマンスについても検討する予定です。
最終モデルは、リスク検出用にランク 16 の LoRA アダプターを、性能低下(ダウングレード)検出用にランク 64 のアダプターを採用しました。
両方のタスクでランク数を増やす実験を行いましたが、評価セット上では特にダウングレード検出において大きな改善が見られました。ランク 64 は、より低いランクのアダプターと比較して顕著な性能向上を示しています。
評価はリポジトリレベルのホールドアウト(ソースデータから完全なリポジトリを学習データから除外する手法)に基づいて実施しました。
ファイルレベルでのホールドアウトも検討しましたが、学習データと評価データの間に過度なクロスコンタミネーション(相互汚染)が生じるため、今回は報告を見送りました。
リスク評価スプリットの選定理由について
前述の通り、リスク評価における 427/427 の分割は意図的にバランスを取っています。実際の形状集約を試みたわけではありませんが、既存のシークレット検出や PII(個人識別情報)問題の分布と一致すると推測されます。一般的に、真陽性(実際に存在するリスク)が占める割合は非常に小さいものです。
このバランス型設定で成立した指標を報告します。
- リコール: ホールドアウトデータ内の実際のシークレットのうち、モデルがどれだけ検出できたか。
- FPR(偽陽性率): ホールドアウトデータ内の非シークレットのうち、誤って警告を発した割合。
- ROC-AUC: モデルが真のシークレットを非シークレットよりも上位に正しくランク付けできる精度。
これらの指標はそれぞれスプリットの片側(シークレットまたは非シークレット)のみを読み取るため、もう一方の側の包含率を変更しても数値は変動しません。つまり、これらは事前確率(有病率)に依存しない指標であり、バランス型スプリットから実際の運用環境での発生率へとそのまま適用可能です。
精度や PR-AUC は、必ずしも信頼できる指標とは限りません。例えば、真の秘密が 0.1% という低い頻度でしか存在しない場合でも、わずかな偽陽性率(FPR)が実在する秘密を偽陽性の山に埋もれさせてしまいます。検出率(recall)を 70% に保ちつつ FPR を 3% に設定すると、モデル自体は何も変更していないにもかかわらず、精度はバランスの取れたデータセットでは約 96% から、現実的なデータセットでは約 2% まで急落します。
Downgrade の評価結果が推定される本番環境のベースレートと既に一致しているのに対し、リスク検出についてはこの評価から信頼できる精度の数値を導き出すことはできません。
結果
微調整を行うことで、両方のユースケースにおいて保持された評価データセット上の分類性能が向上しました。
最前線のモデル(GPT-5.5 および Opus 4.8、デフォルトの推論レベル)との比較における評価では:
両方のゲートは検出率を最適化しますが、それぞれ異なるトレードオフメカニズムを採用しています。完全に公平な比較を行い、報告される信頼度の暗黙的な違いも考慮するために、各評価対象モデルをそれぞれの目的に対して最適な動作点に設定しました。
リスク検出では、Wilson の 95% 上界に基づく偽陽性許容範囲内で、まず検出率を最優先します。ここでは二つの偽陽性許容範囲を報告しています。一つは厳格な FPR ≤ 0.05、もう一つは現在出荷されているリスクゲートが稼働しているより緩い FPR ≤ 0.10 です。これらのレートは上界の制約内に収め、各モデルが到達できる最高の検出率を採用します。
厳格な 0.05 の許容範囲の場合:
リスクゲート:FPR ≤ 0.05 における最高検出率
Wilson 95% CI, n = 427
| モデル | リコール | 95% CI | FPR |
|---|---|---|---|
| Fine-tuned LoRA | 0.698 | [0.653, 0.740] | 0.028 |
| GPT-5.5 | 0.588 | [0.541, 0.634] | 0.021 |
| Opus 4.8 | 0.574 | [0.526, 0.620] | 0.028 |
| Base Qwen 3.6 | 0.563 | [0.516, 0.610] | 0.023 |
より寛容な予算(0.10)の場合:
リスクゲート:FPR ≤ 0.10 における最良の再現率
Wilson の95%信頼区間、n = 427
| モデル | リコール | 95% CI | FPR |
|---|---|---|---|
| Fine-tuned LoRA | 0.878 | [0.844, 0.906] | 0.070 |
| Opus 4.8 | 0.852 | [0.816, 0.883] | 0.070 |
| GPT-5.5 | 0.707 | [0.662, 0.748] | 0.054 |
| Base Qwen 3.6 | 0.629 | [0.582, 0.674] | 0.066 |
微調整されたアダプターは、両方の予算設定において、コスト制約内での検出率(リコール)を最高値に達しています。
- 厳しい 0.05 の予算では、当社のアダプターは GPT-5.5 の次点モデルを上回っています(95% 信頼区間が重ならず、0.698 vs 0.588)。
- 0.10 の予算では、Opus 4.8 と統計的に同等の結果を示しています(信頼区間の重なりがあり、0.878 vs 0.852)。
ダウングレードは同じリコール優先度を持ちますが、重大なエラーとして、スキャナーが既に検出した実在のシークレットを削除してしまうリスクがあります。スキャナーがすでにこれらの行をブロックしているため、誤検知(偽陽性)に対する自然な上限を設定して予算を組むことはできません。現状では、誤報を残しておくことが標準であり、それが新たなコストとなるわけではありません。そこで各閾値は、ネット・ユーティリティに基づいてスコアリングします。具体的には、「削除される誤報の数」から「誤って削除されてしまう実在のシークレットの数に lambda を乗じた値」を差し引いた結果で評価します。
lambda は交換レートです。見逃した秘密 1 つが、どれだけの正しく処理された偽アラートに相当するかを示す値です。lambda = x の場合、見逃した秘密の重みは、正しいクリア 1 つあたりの価値の x 倍になります。
lambda を上げるとこの閾値が下がり、偽陽性の検出数が増える代わりに、シークレットの検出率を高めることができます。
λ に {1, 2, 5, 10} を順に適用し、λ = 5 を採用します。
不均衡なホールドアウトデータセットにおける各モデルの λ = 5 の動作点では:
ダウングレードゲート:λ = 5 の動作点
同じリポジトリレベルのホールドアウト (原文の技術表記: lambda、lambda = 5、lambda = 5)
| モデル | リコール | 適合率 | 誤検知を除去 |
|---|---|---|---|
| ファインチューニング済み LoRA | 0.856 | 0.405 | 0.668 |
| GPT-5.5 | 0.800 | 0.471 | 0.762 |
| Opus 4.8 | 0.767 | 0.352 | 0.626 |
| Base Qwen 3.6 | 0.589 | 0.327 | 0.679 |
このコスト設定では、アダプターが最も多くの真の秘密を保持します。GPT-5.5 は誤検知をより多く排除しブロック精度が高くなりますが、その代償として真陽性(真の秘密)を誤って格下げしようとするケースが増えます。
このゲートは負のサンプルに偏っており、真の秘密の割合は約 21% に過ぎません。そのため PR-AUC も重要な指標となります。これは、ゲートがブロックし続けると判断したアイテム群の中に、真の秘密がどれだけ集中しているかを捉える指標だからです。
残りの運用曲線全体、特に誤検知率の低い領域においても、最先端モデルは依然として競合能力を維持しています。
オープンウェイト
両方のファインチューニング済みモデルは Hugging Face で公開されており、コミュニティがローカル環境で実行したり、判断結果と推論プロセスを検証したり、さらに発展させることができます。
公開には、PEFT LoRA アダプターの重み、トークナイザー、設定ファイル、トレーニング時に使用した正確なシステムプロンプトが含まれます。また、モデル出力内の対数確率の読み方と較正方法に関する追加ガイドも用意されています。
この重みを公開する理由は、本技術を Factory 社内で完結させるだけでなく、広く利用可能にすることにあります。同時に、オープンソース AI コミュニティへのコミットメントを再確認するためでもあります。これらのモデルをより良くするために、コミュニティからの貢献や協力を歓迎します。
考慮事項と制限
リスク評価用データセット: 限られた正例を考慮し、ランキングの質に依存しています。実際の機密情報は稀であり、発見が複雑であるため、リスク評価は意図的にバランスよく設計されています。報告するのは prevalence-invariant な指標(recall, FPR, ROC-AUC)のみです。候補プールは拡張されており、secret-name キーワードによる抽出に加え、検出されない編集のランダムなサンプリングを少量加えています。これにより、意味的な類似性よりも、機密情報に似た形状を持つ行が過剰に含まれるプールとなっています。
ダウングレード用データセット: このモデルは、検出された値すべてがマスクされた文脈から判断を下す必要があるため、データに含められる信号には厳しい制限があります。コードウィンドウに非機密値の形状やエントロピーを追加して情報を補強することは、今後の課題であり、追加的なプロダクション環境の変更が必要です。負例中心のホールドアウトセットでは PR-AUC は約 0.54 で、GPT-5.5 とほぼ同等の結果となっています。
データ、評価、プライバシー: スキャナーや機密情報の検出結果を分析システムに保存することはありません。クラス事前確率は、過去のヒットに対するキャッシュされた判定ラベルから算出されており、リアルタイムストリームからのものではありません。評価用データセットはすべて、この事前確率に合わせて重み付けられた公開ベンチマークコンテンツです。実際のプライベートリポジトリには、本手法が表現できていない機密情報やコード形状が含まれている可能性があります。学習における判断は、未知のサンプルを手動ラベル付けたバッチを基盤とした LLM 判定アンサンブルによって行われます。これによりラベルの信頼性は保たれますが、判定モデル自体のバイアスを継承するリスクは残ります。
導入:各ゲートは、固定された評価用ホールドアウトデータセット上で選定した単一の閾値カットに配置されます。これは実トラフィックにおいて常に有効とは限らず、これらの運用ポイントはさらに洗練させる必要があると考えています。クローズドモデルにおける境界比較は粗くなります。GPT-5.5 や Opus 4.8 はトークン確率を公開していないため、自社モデルから読み取る較正済みスコアではなく、自己報告された信頼度に基づいて調整する必要があります。これによりノイズが生じる可能性がありますが、信頼度の条項がある場合とない場合の両方でサンプルを再実行した結果、GPT のリスク行の 95.4%、GPT の降格行の 91.3%、Opus のリスク行の 97.9%、Opus の降格行の 98.0% で判断結果が一致していることを確認しました。
Droid Shield の改良版を発表します。これは決定論的なスキャンを補完するために、より広範なコードコンテキストから意味的な機密情報を検出するものです。実トラフィックで想定される状況を代表するパブリックベンチマークで評価したところ、微調整済みアダプターが最先端の LLM と競合する性能を持ちながら、サイズは小さく処理速度も速いことを示しました。
Droid が組織のコミットボリュームをより多く担うようになると、セキュリティは Factory の最優先課題となります。堅牢な保護層こそが、自律型ソフトウェアエンジニアリングが安全にスケールできる理由です。
Droid Shield 2.0 は現在、研究プレビュー版として提供されています。ご組織での利用を希望される場合は、ぜひチームまでお問い合わせください。
この成果にご関心をお持ちいただけた方は、私たちと一緒に働いてみませんか。
原文を表示
Droid Shield 2.0: learned secret detection
Factory's Droids write, refactor, and commit code autonomously at a volume that no human reviewer can completely monitor. Keeping autonomous software engineering safe at enterprise scale means secret detection that is trustworthy but doesn't introduce unnecessary friction.
Droid Shield is an extra line of defense against exposing potential secrets during an autonomous commit and push. It works by going through each individual line of a commit and scanning for known secret-shaped patterns and degrees of randomness indicating sensitive material: on a suspicious encounter, it blocks the commit and returns an error to the user. Our customers, including large enterprises, use Shield to ensure every phase of their autonomous software factories operates safely and securely with confidence.
Limitations
Because the scanner is deterministic, it currently suffers from two failure modes:
- False positives: fires on placeholders, examples, fixtures, docs, and non-secret identifiers. This creates friction and trains users to ignore the flag.
- False negatives: misses real secrets that do not match its fixed pattern set, reducing confidence for fully autonomous usage patterns.
We're introducing an improved version of Droid Shield with two new fine-tuned models, one for each of these cases. Adjusted to the models' best operating points, they are the strongest or tied-strongest classifiers on both tasks compared to the frontier, at a fraction of the cost and with a significant improvement in latency. We are releasing the model weights in the interest of compounding future work on software security and privacy.
Classification
Our models sit on opposite ends of the deterministic scanner — they don't review the same events and are optimized separately for distinct failure modes.
Risk: runs when the scanner did not fire, but the changed line still looks secret-bearing within the broader context. The catastrophic error is missing a real secret, so we've optimized this model for recall — we accept the tradeoff of introducing some extra warnings if that's what it takes to catch more true positives.
Downgrade: runs when the scanner did fire. It reads a similar context window, but every detected secret candidate is masked before the model sees it. The model must decide from context alone whether the scanner hit should stay blocked or be cleared as a false alarm. Like risk, the catastrophic error is missing a real secret — in this case by clearing one the scanner already caught. We only clear a scanner hit when the model is confident it's a false alarm, trading false-alarm reduction against the risk of letting a real secret through.
Each model emits a binary verdict plus a short user-facing reason, and is scored according to the model's block probability via exposed token probabilities around this verdict. This is a tunable threshold we control that requires no retraining for reconfiguration.
Droid Shield 2.0 routes every commit through the deterministic scanner: a pattern hit goes to the downgrade model (scrubbed window), while an even broader filter selects secret-looking lines to go to the risk model (raw window).
Data
We train and evaluate on data shaped from Samsung's CredData, a public benchmark of real source files and annotated spans. Each example is annotated with T (real secret), F (false positive), or X (unknown).
To improve the quality of judging we used in our generation, we hand-labeled a batch of these unknown samples to be included in both training + evaluation sets. These are then used as grounded reasoning examples for further judging in the data pipeline, including in broader sets of unknown rows.
Risk and downgrade use opposite slices of the same source material:
- Risk rows: lines the original scanner would not fire on. These keep the raw window, including the candidate value.
- Downgrade rows: scanner hits. We mask every known credential span across the entire window, so the model learns to judge without ever seeing the secret value(s).
Every example, in both tasks, has the same shape: an input the model sees and a label it learns to emit. The input is the reconstructed code window (lines), the file extension, and the focus_line index of the line under judgment. label is a binary verdict (S = safe, B = real secret) along with a short reason.
Risk keeps the candidate value in the clear (CredData positives are public and obfuscated); this is what the model has to judge after a scanner miss. In this example we see a TOTP secret that sits in what looks like test code, but the shape looks real enough that it should be flagged for review:
Downgrade is the opposite: the scanner already fired, so every detected secret is masked before the model sees it. The model must decide from context alone whether the masked hit was a real secret or a false alarm:
For risk, our training set contains 5,000 rows: 2,000 real secrets (40%), 2,000 false alarms (40%), and 1,000 unknowns (20%). The eval set contains 427 real secrets / 427 false alarms. We chose to keep this balanced rather than attempting to mine a production shape for security reasons.
For downgrade, our training set contains 6,776 rows: 4,726 real secrets (69.7%), 1,940 false alarms (28.6%), and 110 unknowns (1.6%). The eval set contains 90 real secrets and 340 false alarms, about 21% real secrets, matching an aggregate production base rate we've sampled.
Training and evaluation mixes are chosen to match a file-type profile derived from aggregate session data, so the models see a ts/py/md/tsx, etc… skew they will meet in real diffs to learn different language shapes surrounding secrets. An LLM judge ensemble (GPT-5.5 as the primary judge, Opus 4.8 adjudicating) assigns the training verdict + reasoning. We ground this in the actual CredData source of truth to minimize potential for any judging errors and to help the fine-tune learn from a deterministic source.
Risk spans the entire CredData taxonomy, skewing toward passwords. This makes sense: passwords don't have any pre-defined entropy or format, so they are harder to deterministically catch:
The downgrade set sees masked scanner hits, so its redacted credentials skew towards those with deterministic shapes. It leans heavily on keys and secrets:
On privacy: Real sessions are never training rows. The only production signals used are aggregate class priors that have been sampled across enough distinct sessions to prevent any identifying information. These are used to calibrate the curriculum and evaluation mix without ever exposing user content.
Training and evaluation
We chose Qwen 3.6 35B A3B as our base model due to its coding strength, reasoning capabilities, and improved cost/latency in comparison to the frontier. For future work, we intend to look into the performance of other even smaller LMs, including Nemotron 3 Nano.
Our final models are a rank-16 LoRA adapter for risk and a rank-64 adapter for downgrade.
- We experimented with increased rank for both and saw the largest gain on downgrade, where rank 64 showed significant improvement over lower-rank adapters on our evaluation set:
We run evaluations on repo-level holdouts, where whole repositories from the source data are held out of training.
- We considered a file-level holdout that keeps those same repositories in training, but found that it carries too much cross-contamination between train and eval, so we do not report it here.
On our choice of risk evaluation split
As mentioned earlier, our risk eval's 427 / 427 split is deliberately balanced. No real shape aggregation was attempted, though we do estimate it would match existing secret-detection and PII problem shapes; typically a very small fraction of true positives.
We report the metrics that survive the balanced setup:
- Recall: of the real secrets in the holdout, how many did the model catch?
- FPR: of the non-secrets in the holdout, how many did it incorrectly warn on?
- ROC-AUC: how well does the model rank real secrets above non-secrets?
Each of these reads only one side of the split, the secrets or the non-secrets, so changing how much of the other side we include doesn't move them. In other words, these metrics are prevalence-invariant; they carry over from the balanced split to whatever the true production rate would be.
Precision and PR-AUC are not as faithful. For example, even at a ~0.1% prevalence a small FPR buries the real secrets in false positives: hold recall at 70% and FPR at 3%, and precision falls from ~96% on the balanced split to ~2% without the model changing at all. Unlike downgrade, whose eval already matches an estimated production base rate, we cannot claim a reliable precision number for risk from this eval.
結果
Fine-tuning improves the classification on our held-out evaluation for both use-cases:
In evaluation against the frontier (GPT-5.5 and Opus 4.8 with default reasoning levels):
Both gates optimize for recall, but each uses a different tradeoff mechanism. We place each evaluated model at its own best operating point for the chosen objective for a completely faithful comparison and to account for any implicit differences in reporting confidence.
Risk is recall-first under a false-positive budget according to a Wilson 95% upper bound. We report two false-positive budgets: a strict FPR <= 0.05, and the looser FPR <= 0.10 that the shipped risk gate currently runs at. We hold the rates within budget on this upper bound and take the best recall each model reaches.
At a strict 0.05 budget:
Risk gate: best recall at FPR ≤ 0.05
Wilson 95% CI, n = 427
| Model | Recall | 95% CI | FPR |
|---|---|---|---|
| Fine-tuned LoRA | 0.698 | [0.653, 0.740] | 0.028 |
| GPT-5.5 | 0.588 | [0.541, 0.634] | 0.021 |
| Opus 4.8 | 0.574 | [0.526, 0.620] | 0.028 |
| Base Qwen 3.6 | 0.563 | [0.516, 0.610] | 0.023 |
At a more lenient 0.10 budget:
Risk gate: best recall at FPR ≤ 0.10
Wilson 95% CI, n = 427
| Model | Recall | 95% CI | FPR |
|---|---|---|---|
| Fine-tuned LoRA | 0.878 | [0.844, 0.906] | 0.070 |
| Opus 4.8 | 0.852 | [0.816, 0.883] | 0.070 |
| GPT-5.5 | 0.707 | [0.662, 0.748] | 0.054 |
| Base Qwen 3.6 | 0.629 | [0.582, 0.674] | 0.066 |
The fine-tuned adapter reaches the highest in-budget recall at both budgets.
- At the strict 0.05 budget, our adapter is ahead of the GPT-5.5 runner-up (non-overlapping 95% intervals, 0.698 vs 0.588).
- At the 0.10 budget, our adapter is statistically tied with Opus 4.8 (their intervals overlap, 0.878 vs 0.852).
Downgrade shares the same recall priority, but the catastrophic error is clearing a real secret the scanner already caught. There's no natural false-positive ceiling to budget against because the scanner already blocked these lines; retaining a false alarm is the status quo, not a new cost. Instead, we score each threshold by net utility: the false alarms it clears minus lambda times the real secrets it wrongly clears.
lambda is an exchange rate: how many correctly cleared false alarms one missed secret is worth. At lambda = x a missed secret costs as much as x good clears. Raising lambda pushes this threshold down and trades more retained false alarms for higher secret recall. We sweep lambda over {1, 2, 5, 10} and ship lambda = 5.
At each model's lambda = 5 operating point on the unbalanced holdout:
Downgrade gate: λ = 5 operating point
Same repo-level holdout
| Model | Recall | Precision | Clears false alarms |
|---|---|---|---|
| Fine-tuned LoRA | 0.856 | 0.405 | 0.668 |
| GPT-5.5 | 0.800 | 0.471 | 0.762 |
| Opus 4.8 | 0.767 | 0.352 | 0.626 |
| Base Qwen 3.6 | 0.589 | 0.327 | 0.679 |
At this cost setting, our adapter retains the most real secrets. GPT-5.5 clears more false alarms and has higher block precision, but at the cost of wrongly attempting to downgrade more true positives.
Because this gate is negative-heavy, with only about 21% real secrets, PR-AUC is also relevant: it captures how concentrated real secrets are among the items the gate would keep blocked:
The frontier models remain competitive across the rest of the operating curve, including in the low false-positive region.
Open weights
Both fine-tunes are available on Hugging Face for the community to run locally, inspect verdicts and reasoning, and continue to build on.
Included are the PEFT LoRA adapter weights, tokenizer and config files, the exact system prompt used for training, and additional guidance for how to read and calibrate the log probabilities in the model outputs.
We're releasing the weights to make this work usable beyond Factory and to reaffirm our commitment to the open source AI community. We welcome any contribution or collaboration in improving these models for everyone.
Considerations and limitations
Risk dataset: We lean on ranking quality to account for limited positives; real secrets are rare and complicated to mine for, so the risk eval is deliberately balanced. We report only prevalence-invariant metrics (recall, FPR, ROC-AUC). The candidate pool is enriched: risk candidates are mined by secret-name keywords plus a thin random sample of non-firing edits, so the pool over-represents deterministic secret-shaped lines rather than semantic similarities.
Downgrade dataset: Because this model has to judge from context where every detected value is masked, there's a hard limit on the signal we can include in the data. Enriching the code window with non-sensitive value shape and entropy remains future work that requires additional production changes. On the negative-heavy holdout, PR-AUC sits at ~0.54 and is essentially tied with GPT-5.5.
Data, evaluation, and privacy: We do not store any scanner or secret detections in our analytics; class priors come from cached judge labels over historic hits, not a live stream. Our eval datasets are entirely public benchmark content re-weighted to this prior. Real private repositories may carry secret and code shapes this fails to represent. Training verdicts come from an LLM judge ensemble anchored on a hand-labeled batch of otherwise-unknown samples; this keeps the labels grounded, but susceptible to inheriting the judge's bias.
Deployment: Each gate is placed at a single threshold cut selected on our fixed evaluation holdout. This does not always hold up in real traffic and we expect to further refine these operating points. The frontier comparison is coarser for closed models: GPT-5.5 and Opus 4.8 don't expose any token probabilities, so we have to tune them on a self-reported confidence rather than the calibrated score we read from our own models. This does introduce noise: we reran the samples with and without the confidence clause and observed matching verdicts on 95.4% of GPT risk rows, 91.3% of GPT downgrade rows, 97.9% of Opus risk rows, and 98.0% of Opus downgrade rows.
We present an improved version of Droid Shield: semantic secret detection from broader code context to augment deterministic scanning. Evaluated on a public benchmark representative of what we expect real traffic to look like, we show that our fine-tuned adapters are competitive with frontier LLMs while being smaller and faster.
As Droids take on more of an organization's commit volume, security is at the forefront of Factory's priorities. A strong protection layer is what keeps autonomous software engineering safe to scale.
Droid Shield 2.0 is currently in research preview. If you'd like access enabled for your organization, please reach out to our team.
If this work excites you, join us!
AI算出
主要ニュースainew評価高い
AI エージェント(Droid)の運用における機密検知機能を強化する「Droid Shield 2.0」の発表であり、AI モデルによる検知精度向上という技術的実装が中心テーマであるため ai_relevance は最高値となる。比較記事が存在しない中で、既存ツールの限界(False positive/negative)を克服する具体的な新モデル導入と機能強化を報じており、新規性が高い。検索機会については「Droid Shield 2.0」という明確な製品名が含まれるがバージョン番号の指定がないため 0.75 とした。日本企業や日本固有のコンテキストに関する記述はないため低評価とした。
6つの評価軸を見る
- AI関連度
- 100
- 情報源の信頼性
- 100
- 新規性
- 75
- 調べる価値
- 75
- 重複の少なさ
- 100
- 日本での有用性
- 25
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み