Best for
- 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.
maziyarpanahi/openmed/skills/gating-deid-leakage/SKILL.md
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
Decision brief
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…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/maziyarpanahi/openmed --skill "skills/gating-deid-leakage"Inspect the Agent Skill "gating-deid-leakage" from https://github.com/maziyarpanahi/openmed/blob/e412ae8f3b04ae79b13663d34a422efc22109a3a/skills/gating-deid-leakage/SKILL.md at commit e412ae8f3b04ae79b13663d34a422efc22109a3a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Review the “Quick start — a pytest gate” section in the pinned source before continuing.
The harness ships a main() that fails closed (exit 1 on quarantine):
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 publis…
For the full gate semantics see evaluating-with-leakage-gates; this skill is about wiring it into CI so it fails the build.
import pytest from openmed.eval import runsuite, ReleaseGate, RELEASABLE
Permission review
The documentation asks the agent to run terminal commands or scripts.
python -m openmed.eval.release_gates \Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 84/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 4,847 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
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.
ReleaseGate, G1a–G8) enforced in CI.For the full gate semantics see evaluating-with-leakage-gates; this skill is
about wiring it into CI so it fails the build.
# 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.
The harness ships a main() that fails closed (exit 1 on quarantine):
# 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.
# .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.
building-gold-corpus. It must be disjoint from any
calibration/training data.G1A_V16_RECALL_FLOOR etc. in
openmed.eval.release_gates) and the active policy profile.critical_leakage_count == 0 and per-label recall
≥ floor. Optionally assert decision == RELEASABLE for the full G1a–G8 check.--issue-on-failure) so the regression is visible, not silently retried.evaluating-with-leakage-gates: this skill is the CI wrapper around
the same ReleaseGate.evaluate(...) call — reuse its gate semantics.building-gold-corpus: supplies the synthetic held-out fixtures the
gate runs against.authoring-model-cards: a green gate's GateReport is the evidence the
model card cites under "evaluation".enforcing-nophi-logging: the gate proves the model doesn't
leak; the logging guard proves your runtime doesn't leak.|| true the step.decision.building-gold-corpus).openmed/eval/release_gates.py (main,
ReleaseGate), openmed/eval/harness.py.Alternatives
K-Dense-AI/scientific-agent-skills
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.
mgiovani/cc-arsenal
Run the checks a GitHub Actions workflow would run, locally, when Actions is unavailable or out of quota. Parses .github/workflows/*.yml, extracts the jobs/steps that gate merges (lint, typecheck, test, build), translates them to local commands respecting the workflow's pinned node/python versions and env, executes them sequentially, and reports a parity table of what passed locally vs. what can't be replicated (service containers, secrets, matrix dimensions) and why. Activates on "CI quota", "A
PramodDutta/qaskills
Configure and generate rich Allure test reports with test categorization, historical trends, environment details, and CI/CD integration for comprehensive test visibility
muend/geoai-skills
Always invoke to review, repair, or deliver geospatial or GeoAI code, including contract compliance, security, error handling, transactions, tests, scripts, functions, notebooks, packages, CI/CD, and repository changes, even when deployment is not requested. Pair with the domain skill for ETL and other production code. Covers CRS/data invariants, dependencies, cross-platform reproducibility, automation, and shipping. Do not trigger for unrelated software or analysis requesting no code or reposit