reviewing-reidentification-risk
できること
このスキルは、匿名化されたデータセットの中で、まだ人が特定されうるかを測る方法をエージェントに教えます。プライバシーのレビュー担当者が、データを公開して安全かを判断できるよう、スコアとメモを作ります。
使う場面
- ✓匿名化したデータセットを公開するため、リスクが非常に小さいという証拠が必要なとき。
- ✓年齢、郵便番号、日付から人が特定されるのではと心配なとき。
- ✓外部の人が追加の情報を使う攻撃を模したテストが、レビューに必要なとき。
スキルのリンク
https://github.com/maziyarpanahi/openmed/blob/master/skills/reviewing-reidentification-risk/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“年齢と郵便番号から、匿名化したデータセットで患者が特定されないか確認してもらえますか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、同じ詳細の組み合わせを持つレコードの数を数えます。これがk-匿名性の指標です。また、リンク攻撃を模したテストを行い、残るリスクについてメモを書きます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Reviewing re-identification risk
Removing direct identifiers is not enough. A record stripped of name, SSN, and MRN can still be singled out by a combination of quasi-identifiers — age, ZIP/region, admission date, sex, rare diagnosis. The HIPAA Expert Determination pathway (45 CFR 164.514(b)(1)) requires a qualified person to apply statistical methods and document that the risk of re-identification is "very small." This skill produces that evidence: quasi-identifier risk metrics (k-anonymity, l-diversity) plus OpenMed's empirical re-identification attack, written up as a residual-risk memo.
When to use
- After direct-identifier removal passes
auditing-deid-leakage(no leaks) and you must decide whether the dataset is releasable. - The user invokes Expert Determination, asks for a re-identification risk score, k-anonymity, l-diversity, or a "very small risk" determination memo.
- You need an adversarial linkage attack — modeling an attacker with auxiliary data — not just a structural metric.
Quick start
from openmed.eval.attacks.reid import run_reid_attack, run_reid_benchmark
# Synthetic de-identified records; each row is the released, de-id'd data.
deidentified = [
{"record_id": "r1", "text": "[NAME], 47F, ZIP 021xx, admitted 2024-03."},
{"record_id": "r2", "text": "[NAME], 47F, ZIP 021xx, admitted 2024-03."},
{"record_id": "r3", "text": "[NAME], 88M, ZIP 597xx, admitted 2024-03."}, # singleton
]
# Auxiliary = what an attacker might already hold (e.g. a voter list).
auxiliary = [{"record_id": "v9", "text": "88M ZIP 597xx"}]
result = run_reid_attack(
fixtures=[], # bring your own records below
deidentified_records=deidentified,
auxiliary_records=auxiliary,
)
metric = result.to_metric()
print(metric["aux_linkage_rate"], # empirical linkage success
metric["k_min"], # smallest equivalence-class size
metric["singleton_count"], # k=1 records (uniquely identifiable)
metric["quasi_identifier_count"])
k_min is the population k-anonymity floor across the dataset; a k_min of 1
means at least one record is unique on its quasi-identifiers and is the highest
re-identification risk. aux_linkage_rate is the empirical attack: how often the
adversary's auxiliary data successfully links back to a released record.
To run against the bundled golden suite and emit a leaderboard-style report:
report = run_reid_benchmark(
suite="golden",
deidentified_records=deidentified,
auxiliary_records=auxiliary,
output_markdown="reid_risk.md",
)
Workflow
- Enumerate quasi-identifiers (QIs). List every field an outsider could
plausibly know and cross-reference: age/DOB, ZIP/region, dates of service,
sex, race, rare conditions, provider. Direct identifiers should already be
gone (verified by
auditing-deid-leakage); QIs are what's left to worry about. - Compute k-anonymity. For each equivalence class (records sharing the same
QI combination), the class size is k.
run_reid_attackreturnsk_minand the list ofsingleton_records(k=1). A common Expert Determination target is k ≥ a documented threshold (e.g. k ≥ 5 or k ≥ 11) for every record. - Check l-diversity on sensitive attributes. k-anonymity hides which record, but if every record in a class shares the same sensitive value (e.g. all HIV-positive), the attribute leaks anyway. Require ≥ l distinct sensitive values per class; flag homogeneous classes.
- Run the empirical attack.
run_reid_attack/run_reid_benchmarkmodel an adversary withauxiliary_recordsand measure actual linkage success (aux_linkage_rate), residual leakage (leakage_rate), surrogate-consistency leaks, and date-shift-inversion leaks. Structural metrics bound risk; the attack demonstrates it. - Generalize or suppress, then re-score. For singletons / low-k classes,
coarsen QIs (age → age band, ZIP5 → ZIP3, exact date → month/quarter) or
suppress the record, then re-run until
k_minand linkage rate meet your documented threshold. - Write the determination memo. Record the QIs considered, methods applied,
k_min, l-diversity, the attack'saux_linkage_rate, the assumptions about attacker capability, and the conclusion that residual risk is "very small." Cite the metrics — never paste raw records into the memo.
Hand-off to / from OpenMed
よくある質問
k-匿名性とは何ですか?
同じ詳細の組み合わせを持つレコードがいくつあるかを数えるものです。数が少ないほどリスクが高くなります。
テストに合格すれば、データは安全ですか?
それだけでは言えません。残るリスクを記録したメモが必要で、そのリスクは資格のある人が判断します。
HIPAAと関係がありますか?
はい。このスキルは、HIPAAの専門家による判定の経路とこの作業を結びつけています。
詳細
作者による元の説明
Run expert-determination-style quasi-identifier risk scoring (k-anonymity, l-diversity) plus OpenMed's empirical re-identification attack on a de-identified dataset, then document residual risk in a defensible memo. Use when the user needs HIPAA Expert Determination (45 CFR 164.514(b)(1)) support, asks whether a dataset is safe to release, worries about singling-out via age/ZIP/dates, or wants a statistical \"very small risk\" determination. Covers identifying quasi-identifiers, computing k-anonymity / l-diversity, running openmed.eval.attacks.reid (run_reid_attack / run_reid_benchmark) as the
repo: maziyarpanahi/openmed
人気
- GitHubのスター
- 5.8k
- ランキング
- #14727
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
annotating-variants
5.8kエージェントが、無料の公開アノテーターを使って、遺伝子バリアントの作用を予測し、HGVS名をゲノム上の位置に変換し、集団の頻度を付与できるよう支援します。
ask-openmed
5.8kエージェントが、臨床テキストの依頼に合ったOpenMedのワークフローを選べるよう支援します。患者データが含まれる可能性がある場合は、必ずプライバシーの確認から始めます。
assembling-fhir-bundles
5.8kエージェントが、複数のFHIR健康記録を、内部の参照を正しくつないだ一つのトランザクションBundleにまとめ、EHRに送れる状態にします。
auditing-deid-leakage
5.8kエージェントが、匿名化済みの臨床テキストに残っている識別子(SSN、カード番号、メール、日付など)をスキャンし、残っていれば公開を止めます。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。