मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी5.8k · #14668

auditing-deid-leakage

यह क्या करती है

यह स्किल पहले से डी-आइडेंटिफ़ाइड क्लिनिकल टेक्स्ट की दूसरी जाँच है, जो छूटे हुए पहचानकर्ता खोजती है। यह उन टीमों के लिए है जिन्हें डेटासेट साझा करने से पहले यह साबित करना है कि कोई व्यक्तिगत विवरण नहीं बचा।

कब इस्तेमाल करें

  • ✓जब डी-आइडेंटिफ़ाइड नोट्स किसी सीमा से बाहर जाने वाले हों, जैसे साझा, एक्सपोर्ट या प्रकाशित होने वाले।
  • ✓जब आपको यह साबित करना हो कि कोई व्यक्तिगत पहचानकर्ता नहीं बचा, या डेटासेट के लिए रिलीज़ गेट चाहिए।
  • ✓जब आप ऐसी जाँच चाहते हों जो उस मॉडल से स्वतंत्र हो जिसने रिडैक्शन किया।

Skill का लिंक

https://github.com/maziyarpanahi/openmed/blob/master/skills/auditing-deid-leakage/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/maziyarpanahi/openmed/blob/master/skills/auditing-deid-leakage/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मैंने इन क्लिनिकल नोट्स को रिडैक्ट किया है। रिडैक्ट किए गए आउटपुट में बचे पहचानकर्ता जाँचिए, और कुछ मिले तो रिलीज़ रोक दीजिए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट रिडैक्ट किए गए टेक्स्ट पर पैटर्न और चेकसम डिटेक्टर चलाता है, साथ में एक दूसरी मॉडल जाँच भी, और एक लीकेज रिपोर्ट बनाता है जो फ़ेल हो जाती है अगर कोई पहचानकर्ता बचा हो।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Auditing de-id leakage

De-identification is verified, not assumed. A model-driven redaction can miss a structured identifier (an SSN typo'd with spaces, an account number in a footer, a date in an odd format) — and a single residual identifier defeats the whole release. This skill is the adversarial second pass: scan the output of de-identification for anything that still looks like an identifier, score it, and block release on any leak. It is the verification half of OpenMed's leakage-first ethos — gate on leakage, not on F1.

When to use

  • Right after deidentifying-clinical-text, before the de-identified text leaves a trust boundary (export, share, train, publish).
  • When the user wants proof that "no PHI leaked," a release gate, or a CI check that fails the build if any identifier survives.
  • As a belt-and-suspenders detector independent of the model that produced the redaction — a deterministic checker catches different failures than the NER.

Run this on the de-identified text, not the original. The original is expected to be full of identifiers.

Quick start

Two complementary passes — a deterministic structural scan plus a model second-pass diff:

import re
import openmed

# Synthetic — the de-identified OUTPUT we are auditing for residual leaks.
deid_text = "Patient [NAME] seen on [DATE]. Backup contact 415-555-0184; acct 4111111111111111."

def luhn_ok(digits: str) -> bool:
    nums = [int(d) for d in digits]
    nums[-2::-2] = [(2 * d - 9 if 2 * d > 9 else 2 * d) for d in nums[-2::-2]]
    return sum(nums) % 10 == 0

DETECTORS = {
    "SSN":   (r"\b\d{3}-\d{2}-\d{4}\b", "critical", None),
    "EMAIL": (r"\b[\w.+-]+@[\w-]+\.[\w.-]+\b", "high", None),
    "PHONE": (r"\b(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b", "high", None),
    "DATE":  (r"\b\d{1,2}[/-]\d{1,2}[/-]\d{2,4}\b", "medium", None),
    "MRN":   (r"\bMRN[:#\s]*\d{5,}\b", "high", None),
    "CARD":  (r"\b(?:\d[ -]?){13,19}\b", "critical", luhn_ok),  # checksum-gated
}

findings = []
for label, (pattern, severity, checksum) in DETECTORS.items():
    for m in re.finditer(pattern, deid_text, flags=re.IGNORECASE):
        token = m.group()
        if checksum and not checksum(re.sub(r"\D", "", token)):
            continue  # fails Luhn -> not a real card number, skip
        findings.append({"label": label, "severity": severity,
                         "start": m.start(), "end": m.end()})  # offsets, not text

# Second-pass model detector: re-run PII extraction on the de-id output.
residual = openmed.extract_pii(deid_text)          # PredictionResult
for ent in residual.entities:
    findings.append({"label": ent.label, "severity": "high",
                     "start": ent.start, "end": ent.end})

leaked = bool(findings)
print({"leak": leaked, "count": len(findings)})    # report carries NO plaintext
assert not leaked, "Release BLOCKED: residual identifiers detected."

Note what the report records: labels, severities, and offsets — never the leaked plaintext. Echoing the leaked identifier into a report or log re-creates the exact PHI exposure you are auditing for.

Workflow

  1. Run deterministic format + checksum detectors on the de-identified text: SSN, email, phone, dates, MRN/account/ID patterns, and card numbers gated by the Luhn checksum so random 16-digit strings don't false-positive. These catch structured identifiers a model may skip.
  2. Add an entropy heuristic for high-randomness tokens (long base36/base64 strings, hex blobs) that match no known format but look like keys, tokens, or record locators. Flag for review rather than auto-block; entropy is noisy.
  3. Run a model second-pass: re-run openmed.extract_pii on the output and treat any returned entity as a residual leak. Because it's a different detector than the one that did the redaction, it catches different misses.
  4. Score severity. critical (SSN, card, full DOB+name co-occurrence) > high (email, phone, MRN, names) > medium (partial dates) > low (entropy-only).
  5. Block on any leak. The gate is binary for release: if findings is non-empty at high/critical, fail the export. Surface a no-PHI report (counts + offsets + severities) so a reviewer can locate and re-redact.

Hand-off to / from OpenMed

  • From deidentifying-clinical-text: this skill consumes result.deidentified_text. Never audit result.original_text.
  • OpenMed second-pass detector: `
अक्सर पूछे जाने वाले सवाल

क्या इसे मूल नोट्स पर चलाना चाहिए?

नहीं। इसे डी-आइडेंटिफ़ाइड आउटपुट पर चलाएँ, क्योंकि मूल में पहचानकर्ता होने की उम्मीद है।

यह किस तरह के पहचानकर्ता पकड़ती है?

यह संरचित पहचानकर्ता जाँचती है, जैसे SSN, Luhn से जाँचे गए कार्ड नंबर, ईमेल और रिकॉर्ड नंबर के पैटर्न।

क्या यह डी-आइडेंटिफ़िकेशन की जगह लेती है?

नहीं। यह डी-आइडेंटिफ़िकेशन रन के आउटपुट को सत्यापित करती है, इसलिए यह दूसरे चरण के रूप में काम करती है।

जानकारी

लेखक का मूल विवरण

Adversarially scan already-de-identified clinical text for residual identifiers and emit a leakage report that blocks release on any hit. Use after OpenMed de-identification when the user asks to verify a redaction, prove no PHI/PII leaked, gate a dataset before sharing, or run a second-pass detector. Covers format and checksum detectors (SSN, Luhn for card numbers, MRN/account patterns, emails, phones, dates), entropy heuristics for high-randomness tokens, severity scoring, and a hard block-on-leak rule. This is the verification half of OpenMed's leakage-first ethos. Hand-off: re-run openmed.

repo: maziyarpanahi/openmed

लोकप्रियता

GitHub स्टार
5.8k
रैंकिंग में स्थान
#14668
लाइसेंस
Apache-2.0
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

annotating-variants

5.8k

आपके एजेंट को मुफ़्त सार्वजनिक एनोटेटर से जेनेटिक वेरिएंट का असर बताने, HGVS नामों को जीनोम पोज़िशन में बदलने और जनसंख्या आवृत्ति जोड़ने में मदद करती है।

डेटाएनालिसिस और स्प्रेडशीट

ask-openmed

5.8k

आपके एजेंट को क्लिनिकल टेक्स्ट अनुरोध के लिए सही OpenMed वर्कफ़्लो चुनने में मदद करती है, जहाँ मरीज़ का डेटा हो सकता है वहाँ पहले गोपनीयता जाँच से शुरू करके।

अन्यविविध

assembling-fhir-bundles

5.8k

कई FHIR स्वास्थ्य रिकॉर्ड को एक ट्रांज़ैक्शन Bundle में पैक करती है, जो EHR को भेजने के लिए तैयार हो और आंतरिक संदर्भ सही जुड़े हों।

डेटाडेटाबेस

auditing-deidentification-runs

5.8k

डी-आइडेंटिफ़िकेशन रन का हस्ताक्षरित, दोबारा जाँचा जा सकने वाला रिकॉर्ड बनाती है, जिसमें दिखता है कि क्या रिडैक्ट हुआ और क्यों, और रिकॉर्ड के अंदर कोई मरीज़ डेटा नहीं होता।

कोडिंगसिक्योरिटी

मिलती-जुलती skills