Agent skill

Evaluating With Leakage Gates

by maziyarpanahi in maziyarpanahi/openmed

Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Evaluating With Leakage Gates

skills CLI
$ npx skills add maziyarpanahi/openmed --skill evaluating-with-leakage-gates -a claude-code

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

GitHub CLI
$ gh skill install maziyarpanahi/openmed evaluating-with-leakage-gates --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/evaluating-with-leakage-gates .claude/skills/evaluating-with-leakage-gates && 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
evaluating-with-leakage-gates
GitHub stars
5.5k
Token cost
~2k tokens
SKILL.md length
655 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1.

  • Works in 7 steps: Build a synthetic golden suite. Fixtures… → Fit calibration thresholds for any… → Run the suite (run_suite /… → …
  • The user wants to run the OpenMed eval harness on a synthetic golden set
  • SKILL.md covers When to use this skill, The gates (G1a–G8), Quick start and Workflow, plus 3 more sections
  • Calls python; needs API_KEY and OPENMED_RELEASE_GATE_KEY

What it does

Evaluating With Leakage Gates is an agent skill from maziyarpanahi/openmed. Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1. Use when the user wants to run the OpenMed eval harness on a synthetic golden set, decide whether a de-id model is RELEASABLE or QUARANTINED, enforce direct-identifier recall floors, require zero critical leakage, fit calibration thresholds, or produce a signed gate report. Trigger on "release gate", "leakage", "is this model safe to…

Its SKILL.md is about 2k 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 AI & LLM Engineering, covering Performance reviews and LLM evaluation. 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 to run the OpenMed eval harness on a synthetic golden set
  • Decide whether a de-id model is RELEASABLE
  • Enforce direct-identifier recall floors
  • Require zero critical leakage

Example prompts

  • “release gate”
  • “leakage”
  • “is this model safe to ship”
  • “/evaluating-with-leakage-gates”

Requirements

  • Python 3
  • A credential in API_KEY
  • A credential in OPENMED_RELEASE_GATE_KEY

Workflow steps

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

  1. Build a synthetic golden suite. Fixtures are JSON with text and
  2. Fit calibration thresholds for any policy that masks or replaces
  3. Run the suite (run_suite / run_benchmark) to get a BenchmarkReport.
  4. Evaluate with ReleaseGate(...).evaluate(report).
  5. Read the per-gate results. Each GateCheck carries gate, passed,
  6. Fail closed. Treat anything other than RELEASABLE as a hard stop.
  7. Audit subgroups with fairness_report (see auditing-subgroup-fairness)

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
    • doi.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY
    • OPENMED_RELEASE_GATE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Evaluating With Leakage Gates loads about 2k tokens when it runs. Until then it costs about 163 tokens; SKILL.md has 655 words of instructions outside code blocks.

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

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). 655 words, ~2,033 tokens.

Download SKILL.mdSave it as .claude/skills/evaluating-with-leakage-gates/SKILL.md (or your agent's skills folder).
name
evaluating-with-leakage-gates
description
Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1. Use when the user wants to run the OpenMed eval harness on a synthetic golden set, decide whether a de-id model is RELEASABLE or QUARANTINED, enforce direct-identifier recall floors, require zero critical leakage, fit calibration thresholds, or produce a signed gate report. Trigger on "release gate", "leakage", "is this model safe to ship", "G1a", "G3", "quarantine", "recall floor", or "calibration thresholds" in an OpenMed de-id context.
license
Apache-2.0
metadata.project
OpenMed
metadata.category
evaluation-quality
metadata.pairs
adjacent
metadata.version
1.0

Evaluating with Leakage Gates

OpenMed's release gates answer one question: did any PHI leak? A de-id model with a beautiful F1 can still leak a single SSN — and that one leak is a HIPAA breach. So openmed.eval gates on residual leakage and per-label recall floors, not on aggregate F1. The candidate is either RELEASABLE or QUARANTINED; there is no partial credit.

When to use this skill

  • You have a candidate de-id or PII model and need a ship / no-ship decision.
  • You want to run the benchmark harness over a synthetic golden suite.
  • You need to enforce direct-identifier recall floors and critical_leakage == 0.
  • You need calibration thresholds (thresholds.json) before the gate will pass.
  • You want a signed, reproducible gate report for governance.

This is the flagship eval skill. For a pure NER scorecard see benchmarking-clinical-ner; for CI wiring see gating-deid-leakage.

The gates (G1a–G8)

GateChecksFloor / rule
G1aDirect & quasi identifiers (PERSON, EMAIL, PHONE, SSN, ID_NUM, DATE_OF_BIRTH, ...)recall ≥ 0.990 (v1.6) / 0.995 (v2.0); strict-no-leak policies raise the floor
G1bStructured secrets (API_KEY, ACCOUNT_NUMBER, CREDIT_CARD, IBAN)recall ≥ 0.995
G2Free-text names/locations/datesrecall ≥ 0.980 (v1.6) / 0.990 (v2.0)
G3Critical leakage (SSN, CREDIT_CARD, CVV, API_KEY, PIN, IBAN, ...)count must be exactly 0
G4Quantized recall delta vs fp parentwithin INT8 / INT4 limits
G5Latency & RAM vs device tier budgetp50/p95/RAM under tier budget
G6p50/p95 latency documentedmust be present and finite
G7Baseline regressionrecall drop ≤ 0.002/label; leakage ≤ soft ceiling 0.005 and ≤ steward target; no leakage regression vs last-green
G8Span integritypredicted spans validate (no overlaps/out-of-range)

Constants live in openmed.eval.release_gates (G1A_V16_RECALL_FLOOR, G1B_RECALL_FLOOR, G7_RECALL_DROP_LIMIT, RESIDUAL_LEAKAGE_SOFT_CEILING, ...). Confirm them there rather than hardcoding — they move per milestone.

Quick start

Run a candidate benchmark over a synthetic golden suite, then gate it:

python
from openmed.eval import run_suite, ReleaseGate, RELEASABLE

# 1) Produce a candidate BenchmarkReport from a SYNTHETIC fixtures file.
#    Each fixture carries gold PHI spans; no real patient text is committed.
report = run_suite(
    "eval/golden/phi_synthetic.json",     # user-supplied synthetic fixtures
    suite="golden",
    model_name="OpenMed/Privacy-PII-Detection",
    device="cpu",
    metadata={
        "family": "PII",
        "tier": "base",
        "policy": "hipaa_safe_harbor",
        # calibration artifacts are required for mask/replace policies (see below)
        "thresholds_path": "eval/artifacts/thresholds.json",
        "calibration_report_path": "eval/artifacts/calibration_report.json",
    },
)

# 2) Gate it. The gate reads the last-green baseline store read-only and
#    returns a signed GateReport.
gate = ReleaseGate(milestone="v1.6", policy="hipaa_safe_harbor")
decision = gate.evaluate(report)

print(decision.decision)                  # "RELEASABLE" or "QUARANTINED"
for check in decision.gate_results:
    if not check.passed:
        print(check.gate, "->", check.reason, check.details)

assert decision.decision == RELEASABLE, "do not ship a quarantined model"

CLI equivalent (fails closed, exit code 1 on quarantine):

bash
python -m openmed.eval.release_gates \
  --candidate eval/out/candidate_report.json \
  --milestone v1.6 --policy hipaa_safe_harbor \
  --output release-gate-report.json

Workflow

  1. Build a synthetic golden suite. Fixtures are JSON with text and gold_spans (offsets + labels). Use building-gold-corpus to scaffold one. Committed gold must be synthetic; DUA corpora (i2b2/n2c2) are eval-only and never committed.

  2. Fit calibration thresholds for any policy that masks or replaces:

    python
    from openmed.eval import write_calibration_artifacts
    
    paths = write_calibration_artifacts(
        calibration_samples,                 # held-out score/target samples
        artifact_dir="eval/artifacts",
        model_id="OpenMed/Privacy-PII-Detection",
        suite="golden",
        target_leakage=0.0,                   # leakage-first: drive leakage to 0
    )
    # writes thresholds.json + calibration_report.json the gate looks for

    The gate's calibration_present check fails the build if these are missing for a mask/replace policy.

  3. Run the suite (run_suite / run_benchmark) to get a BenchmarkReport.

  4. Evaluate with ReleaseGate(...).evaluate(report).

  5. Read the per-gate results. Each GateCheck carries gate, passed, reason, and details (e.g. which labels fell below the recall floor).

  6. Fail closed. Treat anything other than RELEASABLE as a hard stop.

  7. Audit subgroups with fairness_report (see auditing-subgroup-fairness) so an aggregate pass doesn't hide an under-protected group.

Show full SKILL.md (237 more words)Show less

Hand-off to / from OpenMed

  • From building-with-openmed and the de-id pipeline: you evaluate the model produced by openmed.deidentify / openmed.extract_pii.
  • To gating-deid-leakage: wrap ReleaseGate.evaluate(...) in a pytest/CLI gate so CI fails closed on regression.
  • To authoring-model-cards: feed GateReport, fairness_report, and error_report outputs into the model card's metrics and limitations sections.
  • Pairs with auditing-subgroup-fairness (fairness_report) and benchmarking-clinical-ner (error_report).

Edge cases & gotchas

  • F1 is not a gate. A model can have higher F1 and still be quarantined if it leaks one critical identifier (G3) or drops a label below its floor (G1a/G1b).
  • Calibration is mandatory for mask/replace policies. No thresholds.json → calibration_present fails → QUARANTINED.
  • Baselines are read, never written, by the gate. The gate compares against the last-green baseline store without mutating it (G7). Promote baselines in a separate, deliberate step.
  • Strict-no-leak policies raise the G1a floor and force the leakage target to
    1. Don't assume the default floor.
  • Reports must carry identity metadata (family, tier, format, eval_set_hash, leakage_fixture_hash); manifest_coherence fails without it.
  • Reports are signed (HMAC-SHA256). Set OPENMED_RELEASE_GATE_KEY for a real signing key; GateReport.verify(key) checks the repro hash and signature.
  • No raw PHI in the report. Gate evidence is offsets, hashes, and labels — never plaintext identifiers. Keep it that way in any wrapper you write.

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/evaluating-with-leakage-gates of maziyarpanahi/openmed.

Open the folder on GitHubat commit 34d7b8c

Compare with similar skills

Evaluating With Leakage Gates 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.

Evaluating With Leakage Gates compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Evaluating With Leakage Gates this skillmaziyarpanahi/openmed5.5k—~2kAutomated safety check: PassApache-2.0
Advanced Evaluationguanyang/open-agent-hub9772 repos~4.2kAutomated safety check: PassMIT
Eval Harness Firstwshobson/agents40k—~2kAutomated safety check: PassMIT
Astreawarpfront/hipfire658—~2.6kAutomated safety check: PassCustom licence
Rlt Perf OptThinkFlowLab/vllm-rlt149—~4.6kAutomated safety check: PassApache-2.0
Vss Setup Behavior AnalyticsNVIDIA-AI-Blueprints/video-search-and-summarization1.9k—~2.7kAutomated safety check: PassApache-2.0

Similar skills

  • Advanced Evaluation

    guanyang/open-agent-hub

    This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias mitigation, confidence scoring, and automated…

    977 GitHub starsUsed in 2 repos~4.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Eval Harness First

    wshobson/agents

    Build the evaluation harness that gates every fine-tuning run — golden sets, per-failure-mode graders, judge calibration, and base-model baselines.

    40k GitHub stars~2k tokensUpdated 6 days ago
    AI & LLM EngineeringAuto-check passed
  • Astrea

    warpfront/hipfire

    A skill your agent uses for hipfire quant calibration, imatrix-driven experiments, KLD/PPL quality evaluation, k-map/format selection, MQ/HFQ/HFP/MFP tradeoff work, ParoQuant-style weight transform…

    658 GitHub stars~2.6k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Rlt Perf Opt

    ThinkFlowLab/vllm-rlt

    Analyze and optimize vllm-rlt inference performance using reproducible unprofiled benchmarks, paired ops-only/full profiles, source-level attribution, and correctness checks.

    149 GitHub stars~4.6k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Vss Setup Behavior Analytics

    NVIDIA-AI-Blueprints/video-search-and-summarization

    A skill your agent uses to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration).

    1.9k GitHub stars~2.7k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • L3 recipe that runs quark.onnx.AutoSearchPro end-to-end on a user .onnx model: intake → preset selection (or custom search space) → calibration / eval data reader → standalone autosearch script…

    182 GitHub stars~3.4k tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-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 Evaluating With Leakage Gates

What does Evaluating With Leakage Gates do?

Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1. Evaluating With Leakage Gates is an agent skill from maziyarpanahi/openmed. Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1.

When should I use Evaluating With Leakage Gates?

Evaluating With Leakage Gates fits situations like: the user wants to run the OpenMed eval harness on a synthetic golden set; decide whether a de-id model is RELEASABLE; enforce direct-identifier recall floors; require zero critical leakage.

How do I install Evaluating With Leakage Gates in Claude Code?

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

How do I install Evaluating With Leakage Gates in Codex?

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

Can I use Evaluating With Leakage Gates 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 evaluating-with-leakage-gates -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/evaluating-with-leakage-gates, .gemini/skills/evaluating-with-leakage-gates, .github/skills/evaluating-with-leakage-gates and .opencode/skills/evaluating-with-leakage-gates in your project.

What does Evaluating With Leakage Gates need to run?

Going by SKILL.md and its folder, Evaluating With Leakage Gates needs the command-line tools its instructions call (python) and credentials named API_KEY and OPENMED_RELEASE_GATE_KEY. Our summary lists: Python 3; A credential in API_KEY; A credential in OPENMED_RELEASE_GATE_KEY.

Does Evaluating With Leakage Gates access the network?

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

Is Evaluating With Leakage Gates 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 Evaluating With Leakage Gates use?

Evaluating With Leakage Gates 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 Evaluating With Leakage Gates use?

About 2k tokens (SKILL.md is roughly 8.1k 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 Evaluating With Leakage Gates?

Skills that share tags, products or a category with Evaluating With Leakage Gates: Advanced Evaluation (guanyang/open-agent-hub, 977 stars), Eval Harness First (wshobson/agents, 40k stars), Astrea (warpfront/hipfire, 658 stars) and Rlt Perf Opt (ThinkFlowLab/vllm-rlt, 149 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Evaluating With Leakage Gates?

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.