enforcing-nophi-logging
Skill by maziyarpanahi
Enforcing No-PHI Logging adds a redaction guard that scrubs protected health information from logs, traces and error reports in an OpenMed deployment. It is for developers whose services log clinical text or ship telemetry to outside stores.
Install enforcing-nophi-logging
Built from the published package, never by AI.
git clone --depth 1 https://github.com/maziyarpanahi/openmed /tmp/openmed && mkdir -p ~/.claude/skills && cp -r /tmp/openmed/skills/enforcing-nophi-logging ~/.claude/skills/enforcing-nophi-loggingRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install enforcing-nophi-logging in Claude Code
git clone --depth 1 https://github.com/maziyarpanahi/openmed /tmp/openmed && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/openmed/skills/enforcing-nophi-logging ~/.gemini/antigravity-cli/skills/enforcing-nophi-loggingAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install enforcing-nophi-logging in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Enforcing No-PHI Logging is an agent skill that adds a guard to logs, OpenTelemetry spans and error reports in an OpenMed deployment. It supplies a Python logging.Filter that scrubs protected health information before records are emitted. A regex pass catches structured identifiers such as SSNs, card numbers, emails and phone numbers, and the openmed.extract_pii model handles free-text PHI such as names, locations and dates.
The skill also recommends logging structured fields such as document ids, entity counts, labels and offsets instead of note text. It covers span processors and an error tracker before_send hook, and it fails closed when scrubbing errors. It is aimed at developers of OpenMed services who log clinical text or worry that stack traces leak patient data.
Written from the project's SKILL.md and checked against it.
What it can do
- Redacting logging.FilterScrubs PHI from log records before they are emitted, and drops content on scrub errors.
- Regex pre-filterFast patterns redact SSNs, card numbers, email addresses and phone numbers on every record.
- Model fallbackUses openmed.extract_pii to redact free-text PHI such as names, locations and dates.
- Structured no-PHI fieldsLogs document ids, entity counts, labels, offsets and lengths instead of the note text.
- OpenTelemetry redactionA SpanProcessor on_end hook scrubs string span attributes and events before export.
- Error tracker scrubbingA before_send hook scrubs exception messages, breadcrumbs and request bodies.
What you need
- Python
- An OpenMed deployment
Try asking
- Add a logging filter that redacts PHI from my OpenMed service logs
- Scrub patient data from OpenTelemetry spans before they are exported
- Add a Sentry before_send hook that removes PHI from error reports
Good to know
- Regex alone is not de-identification; names, locations and dates need the model.
- The model fallback costs inference per record, so it may need a level threshold.
- A filter on one handler does not protect other handlers.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/enforcing-nophi-logging/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB
Alternatives to enforcing-nophi-logging
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
enforcing-nophi-logging: common questions
Does a regex filter alone remove PHI from logs?
No. The source says regex catches structured identifiers like SSNs, card numbers, emails and phone numbers, while names, locations and dates need the openmed.extract_pii model.
What happens if the log scrubber hits an error?
It fails closed. The message content is dropped and replaced with a redacted marker, and the unscrubbed original is never emitted.
Why must the PHI filter be attached to every handler?
The source says filters on one handler do not protect others, so the guard should attach to every handler or scrub at the record or formatter layer.
How do I install enforcing-nophi-logging?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is enforcing-nophi-logging free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is enforcing-nophi-logging safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to enforcing-nophi-logging?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
