pseudonymizing-for-gdpr
できること
このスキルは、エージェントに、後から連結できる鍵を別に保ちながら、テキストの中の個人情報を隠す方法を教えます。GDPRの仮名化のルールに従いますが、これは完全な匿名化とは異なります。
使う場面
- ✓EU内の人々の個人情報や健康情報を処理する必要があり、可逆的な保護策が必要なチーム。
- ✓患者のフォローアップなどのため、後で記録を本人に結びつける必要があり、鍵は別に保管されているとき。
- ✓仮名化と匿名化の違いを、レビューする人のために文書にする必要があるとき。
スキルのリンク
https://github.com/maziyarpanahi/openmed/blob/master/skills/pseudonymizing-for-gdpr/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“EUの研究用に、患者のノートを仮名化してください。連結用の鍵は別に保管してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは個人情報を伏せ字に置き換え、対応表を別の場所に保存します。その対応表を使って元の記録に結びつけられるのは、許可された人だけです。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Pseudonymizing for GDPR
Pseudonymization under the GDPR (Art. 4(5)) means processing personal data so it "can no longer be attributed to a specific data subject without the use of additional information" — provided that additional information (the re-linkage key) is "kept separately and is subject to technical and organisational measures." Crucially, pseudonymized data is still personal data (Recital 26): re-linkage is possible, so GDPR still applies. This is the opposite of anonymization, where re-identification is irreversibly prevented and the data falls outside the GDPR.
OpenMed implements this with a single reversible de-identification pass plus a mapping you store away from the data. This skill covers producing that mapping, vaulting the key separately, and re-linking under authorization.
When to use
- You process EU residents' personal or special-category health data (Art. 9) and need a lawful, reversible safeguard rather than full anonymization.
- You need to keep a record-linkage capability (e.g. to recontact a patient, reconcile longitudinal records, or honor a Subject Access Request) but must separate the linkage key from the working dataset.
- A reviewer asks for the pseudonymization-vs-anonymization distinction in writing, or for the ENISA-style "additional information kept separately" control to be demonstrable.
Do not use this when the goal is irreversible anonymization for open release
— there, drop the mapping entirely and gate residual risk with
reviewing-reidentification-risk. Pseudonymization keeps a key; anonymization
must not.
Quick start
import openmed
# Synthetic record — never run this skill's examples on real PHI.
note = "Patient Maria Schmidt (ID 4471) seen 2024-03-02; contact maria@example.de."
result = openmed.deidentify(
note,
method="replace", # realistic surrogates, not [LABEL] holes
policy="gdpr_pseudonymization", # bundled GDPR profile
keep_mapping=True, # produce the reversible re-linkage map
consistent=True, # same input -> same surrogate in the doc
seed=20240302, # cross-run reproducibility of surrogates
)
pseudonymized_text = result.deidentified_text # safe to process / analyze
relink_key = result.mapping # surrogate -> original; SECRET
result.deidentified_text is the pseudonymized payload. result.mapping is the
"additional information" GDPR Art. 4(5) requires be kept separately — it is the
key that makes re-linkage possible, and therefore the most sensitive artifact in
the whole flow.
Workflow
- Choose reversible pseudonymization, not masking. Use
method="replace"withpolicy="gdpr_pseudonymization"andkeep_mapping=True. Replacement surrogates keep the text usable for downstream NLP while remaining non-identifying.consistent=True(optionally withseed=) makes repeated mentions resolve to one stable surrogate so intra-document linkage survives. - Split the data from the key immediately. The moment
deidentifyreturns, routeresult.deidentified_textto your working store andresult.mappingto a separate, access-controlled key vault — different system, different credentials, different backups. Never persist them in the same row, file, bucket, or log line. This separation is the technical-and-organisational measure that makes the data pseudonymized rather than just "personal data with PII in it." - Process the pseudonymized text freely. Run
analyze_text, analytics, model training, or transfer ondeidentified_text. The key never leaves the vault during ordinary processing. - Re-link only under authorization. When a lawful basis exists (e.g. an
authorized SAR or recontact), fetch the mapping from the vault and call
openmed.reidentify(deidentified_text, mapping). Log that a re-linkage happened (who, when, why, record id) — but never log the restored plaintext. - Apply retention to the key. The mapping has its own retention clock. When
the lawful basis for re-linkage ends, destroy the mapping. Once the key
is irreversibly gone and no other re-identification path remains, the
remaining text approaches anonymization and GDPR obligations shrink
accordingly. Verify that claim with
reviewing-reidentification-riskbefore relying on it.
Hand-off to / from OpenMed
- From `extracting-pi
よくある質問
仮名化されたデータも個人データのままですか?
はい。後から連結できるため、GDPRの下では依然として個人データだとスキルは説明しています。
これでデータは匿名になりますか?
いいえ。匿名のデータは連結できませんが、この方法では管理された再連結が可能です。
鍵はどこに保管すべきですか?
作業データとは別に保管し、技術的および組織的な管理策を施すよう、スキルは勧めています。
詳細
作者による元の説明
Apply GDPR-grade pseudonymization to clinical or personal text with OpenMed, keeping a separately-held re-linkage key so the data can be controlled-re-linked later. Use when the user must process EU personal/health data under GDPR, asks for pseudonymization vs anonymization, needs Art. 4(5) / Art. 9 / Recital 26 alignment, wants a reversible mapping/key vault held apart from the data, or needs controlled re-linkage. Covers openmed.deidentify(policy=\"gdpr_pseudonymization\", keep_mapping=True), storing the mapping in a separate key vault, reidentify() for authorized re-linkage, and retention.
repo: maziyarpanahi/openmed
人気
- GitHubのスター
- 5.8k
- ランキング
- #14720
- ライセンス
- 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出力もできます。