Agent skill

Gating Deid Leakage

by maziyarpanahi in maziyarpanahi/openmed

Add a CI gate that fails the build when an OpenMed de-identification model's recall on a held-out PHI set drops below threshold or any critical identifier leaks.

Apache-2.0Auto-check passedTesting & QA

Install Gating Deid Leakage

skills CLI
$ npx skills add maziyarpanahi/openmed --skill gating-deid-leakage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maziyarpanahi/openmed gating-deid-leakage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/gating-deid-leakage .claude/skills/gating-deid-leakage && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gating-deid-leakage
GitHub stars
5.5k
Token cost
~1.7k tokens
SKILL.md length
554 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

Add a CI gate that fails the build when an OpenMed de-identification model's recall on a held-out PHI set drops below threshold or any critical identifier leaks.

  • Works in 6 steps: Curate a synthetic held-out PHI set and… → Pick the floor from policy. Don't… → Run the suite → gate the report (pytest… → …
  • The user wants a pytest test
  • SKILL.md covers When to use this skill, Quick start — a pytest gate, Quick start — a CLI gate and Wire it into GitHub Actions, plus 4 more sections
  • Calls python

What it does

Gating Deid Leakage is an agent skill from maziyarpanahi/openmed. Add a CI gate that fails the build when an OpenMed de-identification model's recall on a held-out PHI set drops below threshold or any critical identifier leaks. Use when the user wants a pytest test or CLI step that exits nonzero on de-id regression, wants to wire OpenMed's leakage-first release gates into GitHub Actions / CI, needs a recall floor plus zero-leakage assertion against a synthetic held-out set, or wants to block merges that weaken de-identification. Trigger on "CI gate", "fail the build"…

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing and CI/CD. It works with pytest and GitHub Actions. The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.

When your agent uses it

  • The user wants a pytest test
  • CLI step that exits nonzero on de-id regression
  • Wants to wire OpenMeds leakage-first release gates into GitHub Actions / CI
  • Needs a recall floor plus zero-leakage assertion against a synthetic held-out set

Example prompts

  • “CI gate”
  • “fail the build”
  • “regression test”
  • “/gating-deid-leakage”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Curate a synthetic held-out PHI set and commit it (offsets + labels, no
  2. Pick the floor from policy. Don't hardcode a magic number you invented —
  3. Run the suite → gate the report (pytest fixture above).
  4. Assert two invariants: critical_leakage_count == 0 and per-label recall
  5. Make it required. Mark the job a required status check so a red gate
  6. On failure, the harness CLI can open/refresh a tracking issue

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

    Shell commands in SKILL.md call:

    • 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
    • csrc.nist.gov
    • docs.github.com

    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

Gating Deid Leakage loads about 1.7k tokens when it runs. Until then it costs about 162 tokens; SKILL.md has 554 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~162
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

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.

SKILL.md

The full file from maziyarpanahi/openmed at commit 34d7b8c, republished under its Apache-2.0 licence (© maziyarpanahi). 554 words, ~1,743 tokens.

Download SKILL.mdSave it as .claude/skills/gating-deid-leakage/SKILL.md (or your agent's skills folder).
name
gating-deid-leakage
description
Add a CI gate that fails the build when an OpenMed de-identification model's recall on a held-out PHI set drops below threshold or any critical identifier leaks. Use when the user wants a pytest test or CLI step that exits nonzero on de-id regression, wants to wire OpenMed's leakage-first release gates into GitHub Actions / CI, needs a recall floor plus zero-leakage assertion against a synthetic held-out set, or wants to block merges that weaken de-identification. Trigger on "CI gate", "fail the build", "regression test", "de-id recall threshold", "block the merge", "exit nonzero", or "leakage check in CI" for OpenMed.
license
Apache-2.0
metadata.project
OpenMed
metadata.category
evaluation-quality
metadata.pairs
adjacent
metadata.version
1.0

Gating De-id Leakage in CI

Logs, baselines, and models drift. The only durable defense is a gate that runs on every change and fails closed when de-identification regresses. This skill operationalizes OpenMed's leakage-first ethos into a CI check: recall must stay above the floor and critical leakage must be exactly zero, or the build goes red.

When to use this skill

  • You want a pytest test or CLI step that exits nonzero on de-id regression.
  • You need to block PRs that drop PHI recall or introduce a leak.
  • You want OpenMed's release gates (ReleaseGate, G1a–G8) enforced in CI.
  • You maintain a synthetic held-out PHI set and want it checked automatically.

For the full gate semantics see evaluating-with-leakage-gates; this skill is about wiring it into CI so it fails the build.

Quick start — a pytest gate

python
# tests/eval/test_deid_leakage_gate.py
import pytest
from openmed.eval import run_suite, ReleaseGate, RELEASABLE

RECALL_FLOOR = 0.99          # direct-identifier recall floor
HELD_OUT = "eval/heldout/phi_synthetic.json"   # SYNTHETIC, committed

@pytest.fixture(scope="module")
def gate_report():
    report = run_suite(
        HELD_OUT,
        suite="golden",
        model_name="OpenMed/Privacy-PII-Detection",
        device="cpu",
        metadata={"family": "PII", "tier": "base", "policy": "hipaa_safe_harbor"},
    )
    return ReleaseGate(milestone="v1.6", policy="hipaa_safe_harbor").evaluate(report)

def test_no_critical_leakage(gate_report):
    # Hard zero: one leaked SSN/credit-card is a breach, full stop.
    assert gate_report.critical_leakage_count == 0, "critical PHI leaked"

def test_recall_floor(gate_report):
    low = {
        label: r
        for label, r in gate_report.per_label_recall.items()
        if r < RECALL_FLOOR
    }
    assert not low, f"recall below floor: {low}"

def test_releasable(gate_report):
    # The structural decision: any failed gate -> QUARANTINED -> red build.
    failed = [c.gate for c in gate_report.gate_results if not c.passed]
    assert gate_report.decision == RELEASABLE, f"quarantined; failed gates: {failed}"

pytest exits nonzero on any failure, so CI turns red automatically.

Quick start — a CLI gate

The harness ships a main() that fails closed (exit 1 on quarantine):

bash
# Produce a candidate report, then gate it. Nonzero exit blocks the job.
python -m openmed.eval.release_gates \
  --candidate eval/out/candidate_report.json \
  --baseline-store eval/baselines/last_green.json \
  --milestone v1.6 --policy hipaa_safe_harbor \
  --output release-gate-report.json

Exit codes: 0 RELEASABLE, 1 QUARANTINED, 2 evaluation error before a report. CI should treat 1 and 2 as failures.

Wire it into GitHub Actions

yaml
# .github/workflows/deid-gate.yml
name: de-id leakage gate
on: [pull_request]
jobs:
  gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v5
      - run: uv pip install --system -e ".[hf]"
      - name: Run de-id leakage gate
        run: uv run pytest tests/eval/test_deid_leakage_gate.py -q
      # The job fails (red) automatically if pytest exits nonzero.

Workflow

  1. Curate a synthetic held-out PHI set and commit it (offsets + labels, no real patient text). Use building-gold-corpus. It must be disjoint from any calibration/training data.
  2. Pick the floor from policy. Don't hardcode a magic number you invented — align to the gate's published floors (G1A_V16_RECALL_FLOOR etc. in openmed.eval.release_gates) and the active policy profile.
  3. Run the suite → gate the report (pytest fixture above).
  4. Assert two invariants: critical_leakage_count == 0 and per-label recall ≥ floor. Optionally assert decision == RELEASABLE for the full G1a–G8 check.
  5. Make it required. Mark the job a required status check so a red gate blocks merge — a passing-but-not-required gate protects nothing.
  6. On failure, the harness CLI can open/refresh a tracking issue (--issue-on-failure) so the regression is visible, not silently retried.
Show full SKILL.md (240 more words)Show less

Hand-off to / from OpenMed

  • From evaluating-with-leakage-gates: this skill is the CI wrapper around the same ReleaseGate.evaluate(...) call — reuse its gate semantics.
  • From building-gold-corpus: supplies the synthetic held-out fixtures the gate runs against.
  • To authoring-model-cards: a green gate's GateReport is the evidence the model card cites under "evaluation".
  • Pairs with enforcing-nophi-logging: the gate proves the model doesn't leak; the logging guard proves your runtime doesn't leak.

Edge cases & gotchas

  • Fail closed, never open. If the candidate report is missing or the eval errors, treat it as a failure. Don't || true the step.
  • A passing F1 is not a passing gate. Recall floor + zero critical leakage are the load-bearing assertions; assert them explicitly even if you also check decision.
  • Held-out must stay held-out. If the gate set leaks into calibration or training, the gate measures memorization, not generalization. Keep splits disjoint (see building-gold-corpus).
  • Pin the model and milestone. Floors change per milestone (v1.6 vs v2.0); pin both so a "passing" gate doesn't silently weaken.
  • No real PHI in CI artifacts or logs. The gate report is offsets/hashes only; don't print fixture text in CI output.
  • Baselines are inputs, not outputs of the gate. Promote last-green baselines in a separate, reviewed step — never auto-write them from the gate job.

Standards & references

© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/gating-deid-leakage of maziyarpanahi/openmed.

Open the folder on GitHubat commit 34d7b8c

Compare with similar skills

Gating Deid Leakage 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.

Gating Deid Leakage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gating Deid Leakage this skillmaziyarpanahi/openmed5.5k—~1.7kAutomated safety check: PassApache-2.0
Simple Modern Uvjlevy/simple-modern-uv301—~1.9kAutomated safety check: PassMIT
Megatron Core Testing GuideNVIDIA/Megatron-LM18k—~2.1kAutomated safety check: PassApache-2.0
Code PatternsAedelon/claude-code-blueprint120—~1.2kAutomated safety check: PassCustom licence
Langchain CI Integrationjeremylongshore/tons-of-skills-marketplace2.8k—~4.4kAutomated safety check: PassMIT
Django CI Test Optimizationhashgraph-online/awesome-codex-plugins1.3k—~812Automated safety check: PassMIT

Similar skills

  • Simple Modern Uv

    jlevy/simple-modern-uv

    Start, selectively modernize, fully migrate, or update Python projects using simple-modern-uv practices: uv, ruff, BasedPyright, pytest, GitHub Actions CI, and tag-driven PyPI publishing.

    301 GitHub stars~1.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Megatron Core Testing Guide

    NVIDIA/Megatron-LM

    Official

    Guide to the Megatron-LM test system: layout, recipe YAML, running and adding unit and functional tests, golden values, marker filters and CI parity.

    18k GitHub stars~2.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Code Patterns

    Aedelon/claude-code-blueprint

    Reference patterns for REST APIs, pytest/vitest testing, Docker multi-stage builds, GitHub Actions CI/CD, PostgreSQL, TypeScript generics, Python async, and React Server Components.

    120 GitHub stars~1.2k tokensUpdated 7 mo ago
    DevOps & CloudAuto-check passed
  • Langchain CI Integration

    jeremylongshore/tons-of-skills-marketplace

    Wire LangChain 1.0 / LangGraph 1.0 tests into a GitHub Actions pipeline — unit tests with FakeListChatModel, VCR-gated integration tests, warning-filter policy, and eval-regression merge gates.

    2.8k GitHub stars~4.4k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Django CI Test Optimization

    hashgraph-online/awesome-codex-plugins

    Optimize Django and pytest-django test execution in CI with cache configuration, slow-test splitting, database reuse strategy, parallel workers, pytest-xdist, CircleCI/GitHub Actions/Jenkins/Travis…

    1.3k GitHub stars~812 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 12 repos~1.3k tokens
    Testing & QAAuto-check passed

More from maziyarpanahi/openmed

All 74 skills in this repo
  • Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.

    5.5k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • OpenMed Model Card Writer

    maziyarpanahi/openmed

    Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.

    5.5k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • ICD-10 Coding Assistant

    maziyarpanahi/openmed

    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.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • OpenMed ETL to OMOP CDM

    maziyarpanahi/openmed

    Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Extracting SDOH and Z-Codes

    maziyarpanahi/openmed

    Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Questions about Gating Deid Leakage

What does Gating Deid Leakage do?

Add a CI gate that fails the build when an OpenMed de-identification model's recall on a held-out PHI set drops below threshold or any critical identifier leaks. Gating Deid Leakage is an agent skill from maziyarpanahi/openmed. Add a CI gate that fails the build when an OpenMed de-identification model's recall on a held-out PHI set drops below threshold or any critical identifier leaks.

When should I use Gating Deid Leakage?

Gating Deid Leakage fits situations like: the user wants a pytest test; CLI step that exits nonzero on de-id regression; wants to wire OpenMeds leakage-first release gates into GitHub Actions / CI; needs a recall floor plus zero-leakage assertion against a synthetic held-out set.

How do I install Gating Deid Leakage in Claude Code?

Run `npx skills add maziyarpanahi/openmed --skill gating-deid-leakage -a claude-code`. Or copy the skill folder (skills/gating-deid-leakage in maziyarpanahi/openmed) into .claude/skills/gating-deid-leakage in your project. Claude Code loads it when a task matches its description.

How do I install Gating Deid Leakage in Codex?

Run `npx skills add maziyarpanahi/openmed --skill gating-deid-leakage -a codex`. Or copy the skill folder (skills/gating-deid-leakage in maziyarpanahi/openmed) into .agents/skills/gating-deid-leakage in your project. Codex loads it when a task matches its description.

Can I use Gating Deid Leakage 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 gating-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/gating-deid-leakage, .gemini/skills/gating-deid-leakage, .github/skills/gating-deid-leakage and .opencode/skills/gating-deid-leakage in your project.

What does Gating Deid Leakage need to run?

Going by SKILL.md and its folder, Gating Deid Leakage needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Gating Deid Leakage access the network?

SKILL.md names 3 domains. As links in the text: hhs.gov, csrc.nist.gov and docs.github.com. This is read from the text; nothing was executed.

Is Gating Deid Leakage 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 Gating Deid Leakage use?

Gating Deid Leakage 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 Gating Deid Leakage use?

About 1.7k tokens (SKILL.md is roughly 7k 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 Gating Deid Leakage?

Skills that share tags, products or a category with Gating Deid Leakage: Simple Modern Uv (jlevy/simple-modern-uv, 301 stars), Megatron Core Testing Guide (NVIDIA/Megatron-LM, 18k stars), Code Patterns (Aedelon/claude-code-blueprint, 120 stars) and Langchain CI Integration (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gating Deid Leakage?

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.