benchmark-pii-recall

benchmark-pii-recall is a skill for Claude Code from maziyarpanahi/openmed. It costs 57 tokens per session (964 once invoked), scanned A, original, Apache-2.0.

A benchmark for measuring how often an OpenMed model finds known personally identifying information in synthetic test text. Synthetic data is made for testing and does not describe real people.

In plain words
What is it for?
Use it to test label-aware exact-span and character recall across identifier types, boundaries, languages, scripts, devices, or quantized models, and to enforce a minimum recall requirement.
Why use it?
It reveals missed identifiers before a model, threshold, backend, or compressed version is released, where a missed identifier can create a privacy failure.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the openmed-skills plugin — 74 skills shipped together

Good fit Use it to test label-aware exact-span and character recall across identifier types, boundaries, languages, scripts, devices, or quantized models, and to enforce a minimum recall requirement.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maziyarpanahi/openmed/benchmark-pii-recall
About the project

OpenMed is local-first healthcare AI software that extracts clinical information and removes personally identifying details from clinical text on hardware controlled by the user. Healthcare developers use its Python runtime, Apple Silicon and mobile SDKs, and browser support for on-device clinical NER and PII de-identification.

maziyarpanahi/openmed · 5,290 stars · on GitHub · openmed.life

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add maziyarpanahi/openmed --skill benchmark-pii-recall
Clone the repo
git clone --depth 1 https://github.com/maziyarpanahi/openmed

Made for: Claude Code.

Or install openmed-skills, the plugin that ships this one along with the rest of its 74 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for benchmark-pii-recall

README.md
[![agentmods](https://agentmods.dev/badge/skills/maziyarpanahi/openmed/benchmark-pii-recall/github.svg)](https://agentmods.dev/skills/maziyarpanahi/openmed/benchmark-pii-recall)
Your own site
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/benchmark-pii-recall"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/benchmark-pii-recall/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for benchmark-pii-recall

Your own site · 80×15
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/benchmark-pii-recall"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/benchmark-pii-recall.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 964 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.00964
Opus 5 $0.00028 $0.00482
Sonnet 5 $0.00011 $0.00193
Haiku 4.5 $0.00006 $0.00096

Measured 11d ago against content hash 82c6022df1fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

benchmark-pii-recall scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/benchmark-pii-recall/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Benchmark PII recall

Measure PII recall before optimizing F1, size, or latency. A missed direct identifier is a privacy failure even when aggregate F1 improves.

Procedure

  1. Build synthetic fixtures with exact offsets and canonical PII labels.
  2. Include direct identifiers, boundary cases, languages/scripts, and the target device or quantization.
  3. Run extract_pii at the candidate threshold.
  4. Normalize prediction labels and score each document separately.
  5. Aggregate counts only; do not persist raw text or identifier surfaces.
  6. Fail the release when the recall floor or zero-critical-leak requirement is not met.

Runnable synthetic benchmark

Install the model runtime first with python -m pip install "openmed[hf]".

from openmed import extract_pii
from openmed.core.labels import normalize_label
from openmed.eval import compute_character_recall, compute_exact_span_f1

MODEL = "OpenMed/OpenMed-PII-SuperClinical-Small-44M-v1"
RECALL_FLOOR = 0.99
FIXTURES = [
    {
        "text": (
            "Call the synthetic clinic at 212-555-0198 or email "
            "[email protected]."
        ),
        "spans": [
            ("PHONE", "212-555-0198"),
            ("EMAIL", "[email protected]"),
        ],
    },
    {
        "text": (
            "The synthetic callback number is 415-555-0136 and the contact "
            "address is [email protected]."
        ),
        "spans": [
            ("PHONE", "415-555-0136"),
            ("EMAIL", "[email protected]"),
        ],
    },
]

true_positives = false_positives = false_negatives = 0
covered_graphemes = total_graphemes = 0

for fixture in FIXTURES:
    text = fixture["text"]
    gold = []
    for label, surface in fixture["spans"]:
        start = text.index(surface)
        gold.append(
            {"start": start, "end": start + len(surface), "label": label}
        )

    result = extract_pii(
        text,
        model_name=MODEL,
        confidence_threshold=0.5,
        lang="en",
    )
    predicted = [
        {
            "start": entity.start,
            "end": entity.end,
            "label": normalize_label(entity.label),
        }
        for entity in result.entities
        if entity.start is not None and entity.end is not None
    ]

    exact = compute_exact_span_f1(gold, predicted, source_text=text)
    recall = compute_character_recall(gold, predicted, source_text=text)
    true_positives += exact.true_positives
    false_positives += exact.false_positives
    false_negatives += exact.false_negatives
    covered_graphemes += int(recall.numerator)
    total_graphemes += int(recall.denominator)

exact_recall = true_positives / max(true_positives + false_negatives, 1)
grapheme_recall = covered_graphemes / max(total_graphemes, 1)
print(
    {
        "documents": len(FIXTURES),
        "exact_span_recall": exact_recall,
        "grapheme_recall": grapheme_recall,
        "false_positives": false_positives,
        "false_negatives": false_negatives,
    }
)
assert grapheme_recall >= RECALL_FLOOR, "PII recall floor not met"

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 122 lines · 57 tokens per session scan A 82c6022df1fd

Subscribe to this mod's changes

benchmark-pii-recall is a skill published in the GitHub repository maziyarpanahi/openmed (5,290 stars, last pushed today), licensed Apache-2.0. It adds 57 tokens to every session and 964 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

add-new-model

Use this skill when the user wants to add or port a new model architecture to MLX-VLM — mapping a Hugging Face modeltype to a new file under mlxvlm/models, writing the ModelConfig, matching layer/weight names, reusing a similar existing model, adding a test class, and validating the port. Covers vision-language…

Blaizzy/mlx-vlm · 83 tokens

benchmarking

Use this skill when the user wants to benchmark an MLX-VLM change and present the numbers in a PR — fork-vs-main A/B comparisons, isolated-module micro-benchmarks, median-of-N timing with warmup, peak-memory reporting, correctness checks, parameter sweeps, and self-contained reproducible bench scripts to paste into a…

Blaizzy/mlx-vlm · 74 tokens

convert-quantize

Use this skill when the user wants to convert a Hugging Face model to MLX or quantize/dequantize one with mlxvlm.convert, including bits and group size, quant modes (affine, mxfp4, nvfp4, mxfp8), RTN vs AWQ, mixed-bit recipes, dtype casts, calibration (text or multimodal), local vs Hub paths, revisions, uploading to…

Blaizzy/mlx-vlm · 99 tokens

server-inference

Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlxvlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.

Blaizzy/mlx-vlm · 80 tokens

cli-inference

Use this skill when the user wants to run or debug MLX-VLM inference from the command line, including uv run mlxvlm.generate, image/audio/video inputs, local model paths, Hugging Face model IDs, deterministic repro commands, and CLI errors around processors, prompts, model loading, or missing weights.

Blaizzy/mlx-vlm · 67 tokens

contributing

Use this skill when the user wants to contribute to MLX-VLM — opening a PR, where model code/config/tests go, backward-compatible config args, running the test suite, code formatting and the pre-commit hooks (black, clang-format), and PR expectations (tests, review, perf evidence). Use it to set up a change so it…

Blaizzy/mlx-vlm · 76 tokens