phi-deidentifier

phi-deidentifier is a skill for Claude Code, Codex from microsoft/cat-agent-skills. It costs 153 tokens per session (2,333 once invoked), scanned A, original, MIT.

An offline tool for removing patient and other identifying details from clinical text, notes, transcripts, and documents. It can produce HIPAA Safe Harbor output or a Limited Data Set, along with a record of what was removed and what needs human review.

In plain words
What is it for?
Use it to redact patient names and other identifiers before exporting or reusing health-related content, and to create an audit manifest of the redactions.
Why use it?
It helps prevent private health information (PHI) and personally identifiable information (PII) from being shared in samples, tests, analytics, or demonstrations. It does not replace a legal or clinical review.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Use it to redact patient names and other identifiers before exporting or reusing health-related content, and to create an audit manifest of the redactions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/cat-agent-skills/phi-deidentifier
About the project

microsoft/cat-agent-skills is a static website that catalogs reusable instruction sets and related packages for AI agents. People use it to search, filter, rate, and download skills for Cowork, Copilot Studio, and Scout, along with Copilot plugins and Scout automations. The catalogue entries are the skills, instructions, plugins, and settings displayed by the site.

microsoft/cat-agent-skills · 93 stars · on GitHub

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 microsoft/cat-agent-skills --skill phi-deidentifier
Clone the repo
git clone --depth 1 https://github.com/microsoft/cat-agent-skills

Made for: Claude Code, Codex.

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 phi-deidentifier

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/cat-agent-skills/phi-deidentifier/github.svg)](https://agentmods.dev/skills/microsoft/cat-agent-skills/phi-deidentifier)
Your own site
<a href="https://agentmods.dev/skills/microsoft/cat-agent-skills/phi-deidentifier"><img src="https://agentmods.dev/badge/skills/microsoft/cat-agent-skills/phi-deidentifier/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 phi-deidentifier

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/cat-agent-skills/phi-deidentifier"><img src="https://agentmods.dev/badge/skills/microsoft/cat-agent-skills/phi-deidentifier.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 153 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,333 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.
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.00153 $0.02333
Opus 5.5 $0.00061 $0.00933
Sonnet 5.5 $0.00031 $0.00467
Haiku 4.5 $0.00015 $0.00233

Measured 1mo ago against content hash ebe91fe0d266, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

phi-deidentifier 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/deidentify.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

submissions/phi-deidentifier/SKILL.md · 178 lines

How it starts

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

PHI De-identifier

De-identify clinical / health text to the HIPAA Safe Harbor standard (or a Limited Data Set) using the bundled, offline scripts/deidentify.py. Every run produces two things: the redacted text and an audit manifest listing what was removed, by category, plus anything that needs human review.

When to use

  • "De-identify / anonymise / scrub / redact this note (or file / folder)."
  • "Remove patient identifiers before I share this."
  • "Make this Safe Harbor compliant" or "produce a limited data set."
  • Preparing PHI-free samples for demos, test fixtures, analytics, or model prompts.

Do not use it to answer clinical questions or to claim legal certification — it is a mechanical redactor plus an audit trail for a human to verify.

How to run it

Always call the bundled script; never improvise redaction logic.

# Safe Harbor (default): writes NOTE.deid.txt + NOTE.manifest.json next to input
python scripts/deidentify.py NOTE.txt

# Limited Data Set: retains dates and city/state/ZIP, strips direct identifiers
python scripts/deidentify.py NOTE.txt --mode limited

# Inline text, machine-readable result to stdout
python scripts/deidentify.py --text "John Doe, SSN 123-45-6789" --json

# HYBRID name recall: pass the person names YOU (the agent) spotted in free prose
python scripts/deidentify.py --text "<text>" --names "Rafael Alcaraz,Ngozi Okafor" --json

# STRUCTURED / JSON input: redact by FIELD NAME (MRN, City, Employer, DOB, ...)
# Use this whenever the input is a JSON object or a key/value record — NOT free text.
python scripts/deidentify.py intake_record.json --format record --json

# ALSO emit a reversible token->value crosswalk (SENSITIVE — re-identifying)
python scripts/deidentify.py NOTE.txt --map crosswalk.json

Steps:

  1. Identify the input (a file path, a folder, or inline text) and the target standard: Safe Harbor (default) or Limited Data Set (--mode limited).
  2. Pick the right mode for the shape of the input. If the input is a structured record — a JSON object, or clear Field: value key/value pairs (e.g. an intake record, an API payload, an exported row) — run it with --format record. Record mode maps each field by its NAME (MRN, City, Employer, DOB, SSN, …) and redacts deterministically; free-text mode will MISS quoted/structured identifiers like "MRN": "33108876" because there is no adjacent label to anchor on. Use the default (free-text) mode only for prose. Still run the name-recall pass on any free-text field VALUES (e.g. a ChiefComplaint or Notes field that contains a person's name).
  3. Name-recall pass (do this every time on free prose). Before running, read the text yourself and list every PERSON name and PLACE (city / facility) you can identify — including unusual or non-English names that a regex or the bundled lexicon would miss (e.g. "Rafael Alcaraz", "Okafor"). This is the model/agent contribution to the hybrid; you are the recall booster.
  4. Run scripts/deidentify.py, passing the names from step 3 via --names "Name One,Name Two" (or a --names-file with {"names":[...], "places":[...],"orgs":[...]}). The script deterministically redacts every occurrence, tokenizes consistently, runs its guard, and writes the manifest. The script — not your paraphrase — is the auditable system of record.
  5. Return the redacted text exactly as produced, and summarise the manifest: how many identifiers of each category were removed.
  6. Surface needs_human_review. Names caught heuristically, and any unknown capitalised text flagged for review, are listed there — tell the user these must be verified before release, and that bare names in free prose may still be missed.
  7. Only write the --map crosswalk when the user explicitly needs to re-identify later; warn that it is sensitive and must be stored securely, separately from the de-identified output.

Read the full file on GitHub · 178 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 178 lines · 153 tokens per session scan A ebe91fe0d266

Subscribe to this mod's changes

phi-deidentifier is a skill published in the GitHub repository microsoft/cat-agent-skills (93 stars, last pushed today), licensed MIT. It adds 153 tokens to every session and 2,333 once invoked, about $0.0006 per session on Opus 5.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-09-21.

Related

Other skills, from other repositories

fto-triage

Freedom-to-operate triage — a structured first look at potentially blocking patents, not an FTO opinion. Use when a product, process, or feature is being evaluated for blocking patents, when asked whether anything stops a launch, or to build a claim-chart first pass against the most plausible patents before patent…

anthropics/claude-for-legal · 81 tokens

legal-hold

Issue, refresh, release, or report on legal holds — drafts the hold notice as .docx, updates legalhold fields in log.yaml, and calendars the next refresh. Use when the user says "issue a hold", "refresh hold", "release hold", or asks for a portfolio-wide hold status report.

anthropics/claude-for-legal · 68 tokens

specification-writing

A workflow for writing complete patent specifications from patent claims and an invention disclosure. It adapts the document to a chosen jurisdiction, such as the US, Europe, or China.

wanshuiyin/Auto-claude-code-research-in-sleep · 49 tokens

terms-of-service

Draft terms of service and a companion privacy notice matched to the product's form and feature modules, not legal advice, delivered as a Word document.

genspark-ai/genoffice · 32 tokens

x-scorecard

OpenSSF Scorecard for assessing open source project security. Check security best practices and compliance. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 57 tokens

ai-risk-management

Apply the NIST AI Risk Management Framework (AI RMF 1.0) and adjacent guidance to AI / ML systems — model lifecycle governance, fairness and bias evaluation, robustness, transparency, accountability, third-party model risk, monitoring for drift, and AI incident response. Broader than prompt-injection (which is the…

briiirussell/cybersecurity-skills · 180 tokens