# Reviewing Reidentification Risk

Run expert-determination-style quasi-identifier risk scoring (k-anonymity, l-diversity)...

- Repository: https://github.com/maziyarpanahi/openmed (5755 stars)
- Category: Data and ML
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add maziyarpanahi/openmed --skill reviewing-reidentification-risk -g -a claude-code -y`
Codex: `npx skills add maziyarpanahi/openmed --skill reviewing-reidentification-risk -g -a codex -y`
Cursor: `npx skills add maziyarpanahi/openmed --skill reviewing-reidentification-risk -g -a cursor -y`
Gemini CLI: `npx skills add maziyarpanahi/openmed --skill reviewing-reidentification-risk -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add maziyarpanahi/openmed`

## Description

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 adversarial attack, and writing the risk memo. Pairs after deidentifying-clinical-text and auditing-deid-leakage.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

```python
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"}]

The rest: https://github.com/maziyarpanahi/openmed/blob/HEAD/skills/reviewing-reidentification-risk/SKILL.md
