phi-redaction

phi-redaction is a skill for Claude Code from aks129/HealthClawGuardrails. It costs 79 tokens per session (859 once invoked), scanned A, original, MIT.

A set of rules for removing or shortening protected health information from FHIR records. FHIR is a standard format for exchanging clinical and patient data.

In plain words
What is it for?
Redacting names, identifiers, addresses, contact details, birth dates, photos, and narrative text from FHIR resources during reads.
Why use it?
It reduces the personal information an AI agent can see when reading clinical records, while keeping some data useful for reference or analysis.

Skill for Claude Code

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

Part of the healthclaw-guardrails plugin — 14 skills, 3 MCP servers shipped together

Good fit Redacting names, identifiers, addresses, contact details, birth dates, photos, and narrative text from FHIR resources during reads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aks129/healthclawguardrails/phi-redaction
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 aks129/HealthClawGuardrails --skill phi-redaction
Clone the repo
git clone --depth 1 https://github.com/aks129/HealthClawGuardrails

Made for: Claude Code.

Or install healthclaw-guardrails, the plugin that ships this one along with the rest of its 14 skills, 3 MCP servers.

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-redaction

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/aks129/healthclawguardrails/phi-redaction"><img src="https://agentmods.dev/badge/skills/aks129/healthclawguardrails/phi-redaction.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 859 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.00079 $0.00859
Opus 5 $0.00039 $0.00430
Sonnet 5 $0.00016 $0.00172
Haiku 4.5 $0.00008 $0.00086

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

Security

Grade A, and why

phi-redaction 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 5d 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/phi-redaction/SKILL.md · 105 lines

How it starts

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

PHI Redaction for FHIR Resources

Standard redaction profile for Protected Health Information (PHI) applied on all read paths in the FHIR MCP guardrail stack. This is a technical minimization preview, not a legal Safe Harbor determination.

When to Use This Skill

  • You need to understand how PHI is stripped from FHIR resources
  • You are building a pipeline that must redact clinical data before AI access
  • You need to implement or audit de-identification logic for FHIR

Redaction Rules

All redaction is applied at read time, not at storage time.

Names (HumanName)

  • Family name: Kept as-is
  • Given names: Truncated to first initial + period (e.g., "John" -> "J.")
  • Text: Removed

Identifiers

  • Value: Removed (e.g., {"system": "…/us-ssn", "value": "123-45-6789"} -> {"system": "…/us-ssn"})
  • System and type: Kept for reference

Addresses

  • Line and text: Removed
  • City, state, country: Kept (for demographic analysis)

Telecom (Phone, Email)

  • Value: Replaced with [Redacted]
  • System and use: Kept

Birth Date

  • Truncated to year only (e.g., "1985-03-15" -> "1985")

Photos

  • Removed entirely from the resource

Text Narratives

  • Replaced with: <div xmlns="http://www.w3.org/1999/xhtml">[Redacted]</div>
  • Status set to empty

Notes and Comments

  • Replaced with [Redacted]

Contained Resources

  • All contained resources are redacted recursively

Implementation Pattern (Python)

import json

def apply_redaction(resource):
    """Deep-copy the resource and redact PHI fields."""
    redacted = json.loads(json.dumps(resource))
    _redact_fields(redacted)
    for contained in redacted.get('contained', []):
        if isinstance(contained, dict):
            _redact_fields(contained)
    return redacted

Key implementation notes:

  • Always deep-copy before redacting (never modify the stored resource)
  • Redact contained resources recursively
  • Apply on ALL read paths: direct reads, search results, context envelopes, upstream proxy responses

Read the full file on GitHub · 105 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. 5d ago Changed a36ae88710da
  2. 11d ago First seen · 105 lines · 79 tokens per session scan A 40aa33b99b05

Subscribe to this mod's changes

phi-redaction is a skill published in the GitHub repository aks129/HealthClawGuardrails (30 stars, last pushed today), licensed MIT. It adds 79 tokens to every session and 859 once invoked, about $0.0004 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

healthcare-fhir

Design RESTful clinical data exchanges using HL7 FHIR standards.

andreibesleaga/GABBE · 17 tokens

auditing-deid-leakage

Adversarially scan already-de-identified clinical text for residual identifiers and emit a leakage report that blocks release on any hit. Use after OpenMed de-identification when the user asks to verify a redaction, prove no PHI/PII leaked, gate a dataset before sharing, or run a second-pass detector. Covers format…

maziyarpanahi/openmed · 171 tokens

auditing-deidentification-runs

Produce a signed, reproducible, no-PHI audit trail for an OpenMed de-identification run via deidentify(audit=True). Use when the user needs compliance evidence, a tamper-evident record of what was redacted and why, to verify nothing was changed, to retain proof for HIPAA/GDPR audits, or to review de-id decisions…

maziyarpanahi/openmed · 155 tokens

configuring-privacy-policies

Select and customize OpenMed's seven bundled privacy policy profiles for de-identification, and build custom surrogate generators. Use when the user asks which policy fits HIPAA Safe Harbor vs Expert Determination vs GDPR vs PIPEDA vs a research limited dataset vs strict no-leak, wants to pass policy= to deidentify()…

maziyarpanahi/openmed · 143 tokens

generating-synthetic-surrogates

Replace detected PHI with realistic, type-matched fake values in OpenMed so clinical notes stay readable and parseable instead of full of [REDACTED] markers. Use when the user wants surrogate names, MRNs, addresses, or dates rather than opaque masks, needs consistent fake identities across a document, must keep notes…

maziyarpanahi/openmed · 145 tokens

pseudonymizing-for-gdpr

Apply GDPR-grade pseudonymization to clinical or personal text with OpenMed, keeping a separately-held re-linkage key so the data can be controlled-re-linked later. Use when the user must process EU personal/health data under GDPR, asks for pseudonymization vs anonymization, needs Art. 4(5) / Art. 9 / Recital 26…

maziyarpanahi/openmed · 158 tokens