Scans text that has already been de-identified for leftover identifiers such as SSNs, card numbers, emails and dates, and blocks release if anything turns up.
Install the "auditing-deid-leakage" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/auditing-deid-leakage into .claude/skills/auditing-deid-leakage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "auditing-deid-leakage", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "auditing-deid-leakage" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/auditing-deid-leakage into .agents/skills/auditing-deid-leakage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "auditing-deid-leakage", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "auditing-deid-leakage" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/auditing-deid-leakage into .cursor/skills/auditing-deid-leakage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "auditing-deid-leakage", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "auditing-deid-leakage" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/auditing-deid-leakage into .gemini/skills/auditing-deid-leakage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "auditing-deid-leakage", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "auditing-deid-leakage" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/auditing-deid-leakage into .github/skills/auditing-deid-leakage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "auditing-deid-leakage", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "auditing-deid-leakage" agent skill from https://github.com/maziyarpanahi/openmed/tree/master/skills/auditing-deid-leakage into .opencode/skills/auditing-deid-leakage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "auditing-deid-leakage", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
auditing-deid-leakage
GitHub stars
5.5k
Token cost
~1.9k tokens
SKILL.md length
645 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0
At a glance
Scans text that has already been de-identified for leftover identifiers such as SSNs, card numbers, emails and dates, and blocks release if anything turns up.
Works in 5 steps: Run deterministic format + checksum… → Add an entropy heuristic for… → Run a model second-pass: re-run… → …
Verifying a redaction before de-identified clinical text is exported or shared
SKILL.md covers When to use, Quick start, Workflow and Hand-off to / from OpenMed, plus 2 more sections
Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
What it does
This is a second-pass check for clinical text after de-identification, run on the redacted output and not on the original. A deterministic scan looks for structured identifiers: SSNs, emails, phone numbers, dates, MRN and account patterns, and card numbers confirmed with the Luhn checksum so random 16-digit strings are not flagged. An entropy heuristic marks long random-looking tokens for review, but it does not block a release on its own.
A model pass then re-runs `openmed.extract_pii` on the output and treats every entity it returns as a residual leak. Findings get a severity from critical down to low, and any finding blocks release, which makes the skill usable as a CI gate. The report keeps labels, severities and offsets and never the leaked text itself, since echoing it would recreate the exposure. It is meant to follow the `deidentifying-clinical-text` skill.
When your agent uses it
Verifying a redaction before de-identified clinical text is exported or shared
Gating a dataset release on zero residual identifiers
Adding a CI check that fails the build when any identifier survives
Getting an independent detector's view of another model's redaction output
Example prompts
“Audit the de-identified notes in ./deid/output for leftover identifiers and block the release if anything shows up.”
“Check this redacted discharge summary for SSNs, phone numbers and card numbers and give me a severity-scored report.”
“Add a CI step that runs the leakage audit on our de-identified export and fails on any finding.”
Requirements
The `openmed` Python package
Workflow steps
5 steps, taken from the first numbered list in SKILL.md.
1Run deterministic format + checksum detectors on the de-identified text
2Add an entropy heuristic for high-randomness tokens (long base36/base64
3Run a model second-pass: re-run openmed.extract_pii on the output and
4Score severity. critical (SSN, card, full DOB+name co-occurrence) > high
5Block on any leak. The gate is binary for release: if findings is
What it can do on your machine
Read from SKILL.md and the folder at commit 34d7b8c. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
Network
Links to these hosts (documentation or services it may open):
hhs.gov
iso.org
csrc.nist.gov
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
De-identification Leakage Audit loads about 1.9k tokens when it runs. Until then it costs about 188 tokens; SKILL.md has 645 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~188
When it runs· the whole SKILL.md, loaded when a task matches
~1.9k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check passed
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
Download SKILL.mdSave it as .claude/skills/auditing-deid-leakage/SKILL.md (or your agent's skills folder).
name
auditing-deid-leakage
description
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.extract_pii on the de-id output and diff against expectations. License-free, local-first. Pairs after deidentifying-clinical-text.
license
Apache-2.0
metadata.project
OpenMed
metadata.category
de-identification
metadata.pairs
after
metadata.version
1.0
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:
python
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
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.
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.
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.
Score severity. critical (SSN, card, full DOB+name co-occurrence) > high
(email, phone, MRN, names) > medium (partial dates) > low (entropy-only).
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.
Show full SKILL.md (272 more words)Show less
Hand-off to / from OpenMed
Fromdeidentifying-clinical-text: this skill consumes
result.deidentified_text. Never audit result.original_text.
OpenMed second-pass detector:from openmed import extract_pii — re-run it
on the de-id output and diff. Equivalent MCP/REST surfaces detect PII spans for
the same purpose. Any span returned on already-de-identified text is a leak.
Toreviewing-reidentification-risk: zero direct-identifier leaks is
necessary but not sufficient — quasi-identifiers (age + ZIP + date) can still
re-identify. Hand a clean-on-leakage dataset to QI risk scoring next.
Toevaluating-with-leakage-gates: wire this scan into the eval harness so
a leakage regression fails CI, not just an F1 drop.
Edge cases & gotchas
Never log the leaked value. Report offsets, labels, hashes — not the text.
A leakage report full of plaintext SSNs is itself a breach.
Checksum-gate card numbers. Apply Luhn before flagging 13–19 digit runs, or
every order number and account id becomes a false "card leak."
Surrogates are not leaks. If de-id used method="replace", the output
contains fake names/emails by design. The model second-pass may flag them —
diff against the known mapping/surrogate set so you don't block on synthetic
data. True leaks are values present in the original text.
Locale-aware dates and IDs.dd/mm/yyyy, yyyy.mm.dd, NHS/SIN/fiscal-code
formats vary; tune detectors to the data's locale or you under-detect.
Entropy is advisory. High-entropy ≠ identifier (could be a hash already).
Route to human review, don't hard-block on entropy alone.
Local-first. Run the whole scan on-device; do not ship the text to a cloud
scanner to check whether it leaked.
De-identification Leakage Audit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
De-identification Leakage Audit compared with similar skills
Skill
Stars
Used in
Tokens
Auto-check
Licence
Repo updated
De-identification Leakage Audit this skillmaziyarpanahi/openmed
Implement cloud DLP using Amazon Macie, Google Cloud DLP API, Microsoft Purview, Azure Information Protection, and Nightfall AI to discover, classify, label, de-identify, and protect sensitive data…
Data governance & compliance for CometChat — pick the data-residency region, satisfy GDPR/CCPA (right-to-erasure and data export), plan message retention & purge, and produce audit / eDiscovery…
Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.
Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.
Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.
Scans text that has already been de-identified for leftover identifiers such as SSNs, card numbers, emails and dates, and blocks release if anything turns up. This is a second-pass check for clinical text after de-identification, run on the redacted output and not on the original. A deterministic scan looks for structured identifiers: SSNs, emails, phone numbers, dates, MRN and account patterns, and card numbers confirmed with the Luhn checksum so random 16-digit strings are not flagged.
When should I use De-identification Leakage Audit?
De-identification Leakage Audit fits situations like: verifying a redaction before de-identified clinical text is exported or shared; gating a dataset release on zero residual identifiers; adding a CI check that fails the build when any identifier survives; getting an independent detector's view of another model's redaction output.
How do I install De-identification Leakage Audit in Claude Code?
Run `npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a claude-code`. Or copy the skill folder (skills/auditing-deid-leakage in maziyarpanahi/openmed) into .claude/skills/auditing-deid-leakage in your project. Claude Code loads it when a task matches its description.
How do I install De-identification Leakage Audit in Codex?
Run `npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a codex`. Or copy the skill folder (skills/auditing-deid-leakage in maziyarpanahi/openmed) into .agents/skills/auditing-deid-leakage in your project. Codex loads it when a task matches its description.
Can I use De-identification Leakage Audit in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill auditing-deid-leakage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/auditing-deid-leakage, .gemini/skills/auditing-deid-leakage, .github/skills/auditing-deid-leakage and .opencode/skills/auditing-deid-leakage in your project.
What does De-identification Leakage Audit need to run?
SKILL.md names no scripts, command-line tools or credentials: De-identification Leakage Audit is instructions for the agent only. Our summary lists: The `openmed` Python package.
Does De-identification Leakage Audit access the network?
SKILL.md names 3 domains. As links in the text: hhs.gov, iso.org and csrc.nist.gov. This is read from the text; nothing was executed.
Is De-identification Leakage Audit safe to install?
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
What licence does De-identification Leakage Audit use?
De-identification Leakage Audit is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does De-identification Leakage Audit use?
About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
What are the alternatives to De-identification Leakage Audit?
Skills that share tags, products or a category with De-identification Leakage Audit: Implementing Cloud Dlp For Data Protection (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Cursor Compliance Audit (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), Cometchat Compliance (cometchat/cometchat-skills, 132 stars) and Data Quality Frameworks (wshobson/agents, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains De-identification Leakage Audit?
maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,506 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 11, 2026.
Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.