phi-pii-leak-scan

Scan backend and frontend codebases for PHI and PII exposure in code, logs, serializers, and fixtures.

Updated May 11, 2026
One-click install
npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill phi-pii-leak-scan-thachrocky12345
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phi-pii-leak-scan
Source: https://github.com/thachrocky12345/local-agent-train-workstation/tree/main/.claude/skills/phi-pii-leak-scan
Command: npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill phi-pii-leak-scan-thachrocky12345

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Healthcare and user-data applications risk leaking PHI/PII through overly broad serializers, hardcoded test data, verbose logging, and frontend state caching. This Skill statically scans the codebase to find these exposures before they reach production or fail a compliance audit. ## Core Features & Use Cases - Pattern-Based Scanning: Runs targeted grep patterns for emails, phone numbers, SSNs, NPI numbers, credit cards, JWT tokens, and coordinates across Python, TypeScript, and JSON files. - Serializer and GraphQL Auditing: Detects fields = '__all__' on sensitive Django models and checks GraphQL types for exposed OAuth tokens, risk scores, and clinical notes. - Severity-Classified Reporting: Produces a markdown report classifying findings as CRITICAL, HIGH, MEDIUM, or LOW with file locations and remediation suggestions. - Use Case: Before merging a PR that touches the video_conferencing Notes serializer, run the scan scoped to that app to confirm no clinical notes fields leak into unauthenticated API responses. ## Quick Start Ask the AI to scan the backend for PHI and PII leaks and generate a severity-classified report of any findings.

Frequently Asked Questions about phi-pii-leak-scan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan a codebase for PII and PHI leaks?

Run targeted grep patterns across source files for emails, phone numbers, SSNs, credit cards, JWT tokens, and coordinates, excluding test factories and build directories. Then audit serializers and GraphQL types for overly broad field exposure on sensitive models.

How to check Django serializers for sensitive field exposure?

Search for serializers using fields = '__all__' on models containing PHI or PII, and grep for sensitive field names like tokens, risk scores, or notes appearing outside models.py and migrations. Explicit field whitelists prevent accidental exposure.

Does this scan work on both backend and frontend code?

Yes, it scans Python backend files for hardcoded PII and logging leaks, plus TypeScript and TSX frontend files for localStorage writes, console logging of user data, Redux state caching of PHI, and dangerouslySetInnerHTML usage.

What counts as a critical versus low severity PII finding?

CRITICAL findings are PHI fields like clinical notes or risk scores exposed in unauthenticated endpoints. LOW findings include verbose serializers using fields = '__all__' or console.log statements containing user objects.

Why do fixture files cause false positives in PII scans?

Fixture files often contain realistic-looking test data that triggers pattern matches. Verify emails use @example.com, phone numbers use 555- prefixes, and coordinates map to oceans; also ignore auto_now_add timestamp fields.