jpskill.com
🛠️ 開発・MCP コミュニティ

hipaa-guardian

個人情報や医療情報の漏洩リスクを検知し、HIPAAなどの医療データプライバシー規制への準拠を支援するSkill。

📜 元の英語説明(参考)

This skill should be used when the user asks to "scan for PHI", "detect PII", "HIPAA compliance check", "audit for protected health information", "find sensitive healthcare data", "generate HIPAA audit report", "check code for PHI leakage", "scan logs for PHI", "check authentication on PHI endpoints", "scan FHIR resources", "check HL7 messages", or mentions PHI detection, HIPAA compliance, healthcare data privacy, medical record security, logging PHI violations, authentication checks for health data, or healthcare data formats (FHIR, HL7, CDA).

🇯🇵 日本人クリエイター向け解説

一言でいうと

個人情報や医療情報の漏洩リスクを検知し、HIPAAなどの医療データプライバシー規制への準拠を支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o hipaa-guardian.zip https://jpskill.com/download/6149.zip && unzip -o hipaa-guardian.zip && rm hipaa-guardian.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/6149.zip -OutFile "$d\hipaa-guardian.zip"; Expand-Archive "$d\hipaa-guardian.zip" -DestinationPath $d -Force; ri "$d\hipaa-guardian.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して hipaa-guardian.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → hipaa-guardian フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

HIPAA Guardian

AIエージェント向けの包括的なPHI/PII検出およびHIPAAコンプライアンススキルです。特に開発者コードのセキュリティパターンに重点を置いています。データファイルとソースコード内のHIPAAセーフハーバー識別子18種類すべてを検出し、リスクスコアリングを提供し、検出結果をHIPAA規制にマッピングし、是正ガイダンスを含む監査レポートを生成します。

機能

  1. PHI/PII検出 - データファイルからHIPAAセーフハーバー識別子18種類をスキャンします。
  2. コードスキャン - ソースコード、コメント、テストフィクスチャ、設定ファイル内のPHIを検出します。
  3. 認証ゲート検出 - 認証なしでPHIを公開しているAPIエンドポイントを検出します。
  4. ログ安全性監査 - ログステートメントに漏洩しているPHIを検出します。
  5. 分類 - 検出結果をPHI、PII、またはsensitive_nonPHIに分類します。
  6. リスクスコアリング - 機密性と露出度に基づいて検出結果を0〜100でスコアリングします。
  7. HIPAAマッピング - 各検出結果を特定のHIPAA規則にマッピングします。
  8. 監査レポート - findings.json、監査レポート、およびプレイブックを生成します。
  9. 是正 - コード例を含む段階的な是正策を提供します。
  10. コントロールチェック - セキュリティコントロールが適切に配置されていることを検証します。

使用方法

/hipaa-guardian [command] [path] [options]

コマンド

  • scan <path> - ファイルまたはディレクトリをPHI/PIIについてスキャンします。
  • scan-code <path> - ソースコードをPHI漏洩についてスキャンします。
  • scan-auth <path> - PHIアクセス前の認証不足についてAPIエンドポイントをチェックします。
  • scan-logs <path> - ロギングステートメント内のPHIパターンを検出します。
  • scan-response <path> - APIレスポンス内のマスクされていないPHI露出をチェックします。
  • audit <path> - 完全なHIPAAコンプライアンス監査レポートを生成します。
  • controls <path> - プロジェクト内のセキュリティコントロールをチェックします。
  • report - 既存の検出結果からレポートを生成します。

オプション

  • --format <type> - 出力形式: json, markdown, csv (デフォルト: markdown)
  • --output <file> - 結果をファイルに書き込みます。
  • --severity <level> - 最小深刻度: low, medium, high, critical
  • --include <patterns> - 含めるファイルパターン
  • --exclude <patterns> - 除外するファイルパターン
  • --synthetic - すべてのデータを合成データとして扱います (安全のためのデフォルト)

ワークフロー

呼び出されたら、このワークフローに従います。

ステップ1: スキャン範囲の決定

ユーザーに以下を指定するよう求めます。

  • ターゲットパス (ファイル、ディレクトリ、またはグロブパターン)
  • スキャンタイプ (データファイル、ソースコード、またはその両方)
  • データが合成/テストデータか、潜在的に実際のPHIか

ステップ2: ファイルの検出

Globを使用して関連ファイルを検索します。

# データファイルの場合
Glob: **/*.{json,csv,txt,log,xml,hl7,fhir}

# ソースコードの場合
Glob: **/*.{py,js,ts,tsx,java,cs,go,rb,sql,sh}

# 設定ファイルの場合
Glob: **/*.{env,yaml,yml,json,xml,ini,conf}

ステップ3: PHIの検出

各ファイルについて、references/detection-patterns.mdのパターンを使用してHIPAA識別子18種類をスキャンします。

  1. 氏名 - 患者、プロバイダー、親族の氏名
  2. 地理情報 - 住所、都市、郵便番号
  3. 日付 - 生年月日、入院日、退院日、死亡日
  4. 電話番号 - すべての形式
  5. FAX番号 - すべての形式
  6. メールアドレス - すべての形式
  7. SSN - 社会保障番号
  8. MRN - 医療記録番号
  9. 健康保険ID - 保険識別子
  10. 口座番号 - 金融口座
  11. ライセンス番号 - 運転免許証、専門職
  12. 車両ID - VIN、ナンバープレート
  13. デバイスID - シリアル番号、UDI
  14. URL - ウェブアドレス
  15. IPアドレス - ネットワーク識別子
  16. 生体認証 - 指紋、網膜、音声
  17. 写真 - 顔全体画像
  18. その他の固有ID - その他の識別番号

ステップ4: 分類

各検出結果を分類します。

  • PHI - 個人にリンク可能な健康情報
  • PII - 個人を特定できるが健康関連ではない情報
  • sensitive_nonPHI - 機密性があるが個別に特定できない情報

ステップ5: リスクスコアリング

references/risk-scoring.mdの方法論を使用してリスクスコア (0-100) を計算します。

Risk Score = (Sensitivity × 0.35) + (Exposure × 0.25) +
             (Volume × 0.20) + (Identifiability × 0.20)

ステップ6: HIPAAマッピング

検出結果を以下のHIPAA規則にマッピングします。

  • references/privacy-rule.md - 45 CFR 164.500-534
  • references/security-rule.md - 45 CFR 164.302-318
  • references/breach-rule.md - 45 CFR 164.400-414

ステップ7: 出力の生成

examples/sample-finding.json形式に従って構造化された出力を作成します。

{
  "id": "F-YYYYMMDD-NNNN",
  "timestamp": "ISO-8601",
  "file": "path/to/file",
  "line": 123,
  "field": "field.path",
  "value_hash": "sha256:...",
  "classification": "PHI|PII|sensitive_nonPHI",
  "identifier_type": "ssn|mrn|dob|...",
  "confidence": 0.95,
  "risk_score": 85,
  "hipaa_rules": [...],
  "remediation": [...],
  "status": "open"
}

コードスキャン

ソースコードをスキャンする際は、以下を探します。

1. ソースコード内のハードコードされたPHI

  • SSN、MRN、氏名、日付を含む文字列リテラル
  • 機密値を持つ変数への代入
  • データベースのシード/フィクスチャデータ

2. コメント内のPHI

  • コードコメント内のサンプルデータ
  • 患者情報を含むTODOコメント
  • 実際のデータを含むドキュメンテーション文字列

3. テストデータの漏洩

  • 実際のPHIを含むテストフィクスチャ
  • 実際の患者情報を含むモックデータファイル
  • 統合テストデータ

4. 設定ファイル

  • PHIを含む.envファイル
  • 埋め込み資格情報を含む接続文字列
  • PHIとともにキャッシュされたAPIレスポンス

5. SQLファイル

  • PHIを含むINSERTステートメント
  • 実際の患者データを含むサンプルクエリ
  • データベースダンプ

詳細なパターンについては、references/code-scanning.mdを参照してください。

セキュリティコントロールチェック

これらのコントロールが適切に配置されていることを確認します。

アクセス制御

  • [ ] ロールベースアクセス制御 (RBAC) が実装されている
  • [ ] 最小必要アクセス原則が適用されている
  • [ ] アクセスログが有効になっている

暗号化

  • [ ] 保存データが暗号化されている (AES-256)
  • [ ] 転送データが暗号化されている (TLS 1.2+)
  • [ ] 暗号化キーが適切に管理されている

監査制御

  • [ ] 監査ログが実装されている
  • [ ] ログの整合性が保護されている
  • [ ] 保存ポリシーが定義されている

コードセキュリティ

  • [ ] .gitignoreが機密ファイルを除外している
  • [ ] プリコミットフックがPHIをスキャンしている
  • [ ]
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

HIPAA Guardian

A comprehensive PHI/PII detection and HIPAA compliance skill for AI agents, with a strong focus on developer code security patterns. Detects all 18 HIPAA Safe Harbor identifiers in data files and source code, provides risk scoring, maps findings to HIPAA regulations, and generates audit reports with remediation guidance.

Capabilities

  1. PHI/PII Detection - Scan data files for the 18 HIPAA Safe Harbor identifiers
  2. Code Scanning - Detect PHI in source code, comments, test fixtures, configs
  3. Auth Gate Detection - Find API endpoints exposing PHI without authentication
  4. Log Safety Audit - Detect PHI leaking into log statements
  5. Classification - Classify findings as PHI, PII, or sensitive_nonPHI
  6. Risk Scoring - Score findings 0-100 based on sensitivity and exposure
  7. HIPAA Mapping - Map each finding to specific HIPAA rules
  8. Audit Reports - Generate findings.json, audit reports, and playbooks
  9. Remediation - Provide step-by-step remediation with code examples
  10. Control Checks - Validate security controls are in place

Usage

/hipaa-guardian [command] [path] [options]

Commands

  • scan <path> - Scan files or directories for PHI/PII
  • scan-code <path> - Scan source code for PHI leakage
  • scan-auth <path> - Check API endpoints for missing authentication before PHI access
  • scan-logs <path> - Detect PHI patterns in logging statements
  • scan-response <path> - Check API responses for unmasked PHI exposure
  • audit <path> - Generate full HIPAA compliance audit report
  • controls <path> - Check security controls in a project
  • report - Generate report from existing findings

Options

  • --format <type> - Output format: json, markdown, csv (default: markdown)
  • --output <file> - Write results to file
  • --severity <level> - Minimum severity: low, medium, high, critical
  • --include <patterns> - File patterns to include
  • --exclude <patterns> - File patterns to exclude
  • --synthetic - Treat all data as synthetic (default for safety)

Workflow

When invoked, follow this workflow:

Step 1: Determine Scan Scope

Ask the user to specify:

  • Target path (file, directory, or glob pattern)
  • Scan type (data files, source code, or both)
  • Whether data is synthetic/test data or potentially real PHI

Step 2: File Discovery

Use Glob to find relevant files:

# For data files
Glob: **/*.{json,csv,txt,log,xml,hl7,fhir}

# For source code
Glob: **/*.{py,js,ts,tsx,java,cs,go,rb,sql,sh}

# For config files
Glob: **/*.{env,yaml,yml,json,xml,ini,conf}

Step 3: PHI Detection

For each file, scan for the 18 HIPAA identifiers using patterns from references/detection-patterns.md:

  1. Names - Patient, provider, relative names
  2. Geographic - Addresses, cities, ZIP codes
  3. Dates - DOB, admission, discharge, death dates
  4. Phone Numbers - All formats
  5. Fax Numbers - All formats
  6. Email Addresses - All formats
  7. SSN - Social Security Numbers
  8. MRN - Medical Record Numbers
  9. Health Plan IDs - Insurance identifiers
  10. Account Numbers - Financial accounts
  11. License Numbers - Driver's license, professional
  12. Vehicle IDs - VIN, license plates
  13. Device IDs - Serial numbers, UDI
  14. URLs - Web addresses
  15. IP Addresses - Network identifiers
  16. Biometric - Fingerprints, retinal, voice
  17. Photos - Full-face images
  18. Other Unique IDs - Any other identifying numbers

Step 4: Classification

Classify each finding:

  • PHI - Health information linkable to individual
  • PII - Personally identifiable but not health-related
  • sensitive_nonPHI - Sensitive but not individually identifiable

Step 5: Risk Scoring

Calculate risk score (0-100) using methodology from references/risk-scoring.md:

Risk Score = (Sensitivity × 0.35) + (Exposure × 0.25) +
             (Volume × 0.20) + (Identifiability × 0.20)

Step 6: HIPAA Mapping

Map findings to HIPAA rules from references:

  • references/privacy-rule.md - 45 CFR 164.500-534
  • references/security-rule.md - 45 CFR 164.302-318
  • references/breach-rule.md - 45 CFR 164.400-414

Step 7: Generate Output

Create structured output following examples/sample-finding.json format:

{
  "id": "F-YYYYMMDD-NNNN",
  "timestamp": "ISO-8601",
  "file": "path/to/file",
  "line": 123,
  "field": "field.path",
  "value_hash": "sha256:...",
  "classification": "PHI|PII|sensitive_nonPHI",
  "identifier_type": "ssn|mrn|dob|...",
  "confidence": 0.95,
  "risk_score": 85,
  "hipaa_rules": [...],
  "remediation": [...],
  "status": "open"
}

Code Scanning

When scanning source code, look for:

1. Hardcoded PHI in Source

  • String literals containing SSN, MRN, names, dates
  • Variable assignments with sensitive values
  • Database seed/fixture data

2. PHI in Comments

  • Example data in code comments
  • TODO comments with patient info
  • Documentation strings with real data

3. Test Data Leakage

  • Test fixtures with real PHI
  • Mock data files with actual patient info
  • Integration test data

4. Configuration Files

  • .env files with PHI
  • Connection strings with embedded credentials
  • API responses cached with PHI

5. SQL Files

  • INSERT statements with PHI
  • Sample queries with real patient data
  • Database dumps

See references/code-scanning.md for detailed patterns.

Security Control Checks

Verify these controls are in place:

Access Controls

  • [ ] Role-based access control (RBAC) implemented
  • [ ] Minimum necessary access principle applied
  • [ ] Access logging enabled

Encryption

  • [ ] Data encrypted at rest (AES-256)
  • [ ] Data encrypted in transit (TLS 1.2+)
  • [ ] Encryption keys properly managed

Audit Controls

  • [ ] Audit logging implemented
  • [ ] Log integrity protected
  • [ ] Retention policies defined

Code Security

  • [ ] .gitignore excludes sensitive files
  • [ ] Pre-commit hooks scan for PHI
  • [ ] Secrets management in place
  • [ ] Data masking in logs

Output Formats

findings.json

Structured array of all findings with full metadata.

audit_report.md

Human-readable report with:

  • Executive summary
  • Findings by severity
  • HIPAA compliance status
  • Risk assessment
  • Recommendations

playbook.md

Step-by-step remediation guide:

  • Prioritized actions
  • Code examples
  • Verification steps

Security Guardrails

  1. Default Synthetic Mode - Assumes data is synthetic unless confirmed otherwise
  2. No PHI Storage - Never stores detected PHI values, only hashes
  3. Redaction - All example outputs redact actual values
  4. Warning Prompts - Warns before processing potentially real PHI
  5. Audit Trail - Logs all scans (without PHI values)

References

  • references/hipaa-identifiers.md - All 18 HIPAA Safe Harbor identifiers
  • references/detection-patterns.md - Regex patterns for PHI detection
  • references/code-scanning.md - Code scanning patterns and rules
  • references/healthcare-formats.md - FHIR, HL7, CDA detection patterns
  • references/privacy-rule.md - HIPAA Privacy Rule (45 CFR 164.500-534)
  • references/security-rule.md - HIPAA Security Rule (45 CFR 164.302-318)
  • references/breach-rule.md - Breach Notification Rule (45 CFR 164.400-414)
  • references/risk-scoring.md - Risk scoring methodology
  • references/auth-patterns.md - Authentication gate patterns for PHI endpoints
  • references/logging-safety.md - PHI-safe logging patterns and filters
  • references/api-security.md - API response masking and field-level auth

CI/CD Integration

Pre-Commit Hook Installation

# Install the pre-commit hook
cp scripts/pre-commit-hook.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

# Or using pre-commit framework
# Add to .pre-commit-config.yaml:
repos:
  - repo: local
    hooks:
      - id: hipaa-guardian
        name: HIPAA Guardian PHI Scan
        entry: python scripts/detect-phi.py
        language: python
        types: [file]
        pass_filenames: true

Environment Variables

# Configure pre-commit behavior
export HIPAA_BLOCK_ON_CRITICAL=true   # Block commits with critical findings
export HIPAA_BLOCK_ON_HIGH=true       # Block commits with high severity findings
export HIPAA_SCAN_DATA=true           # Scan data files
export HIPAA_SCAN_CODE=true           # Scan source code
export HIPAA_VERBOSE=false            # Enable verbose output

GitHub Actions Integration

# .github/workflows/hipaa-scan.yml
name: HIPAA PHI Scan
on: [push, pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - name: Run PHI Scan
        run: |
          python scripts/detect-phi.py . --format markdown --output phi-report.md
      - name: Upload Report
        uses: actions/upload-artifact@v4
        with:
          name: phi-scan-report
          path: phi-report.md

Healthcare Data Format Support

Supported Formats

Format Extensions Detection
FHIR R4 .fhir.json, .fhir.xml Resource type, identifiers
HL7 v2.x .hl7, .hl7v2 MSH, PID, DG1 segments
CDA/C-CDA .cda, .ccda, .ccd ClinicalDocument, patientRole
X12 EDI .x12, .edi, .837 Transaction set headers

High-Risk FHIR Resources

  • Patient - Demographics, identifiers, contacts
  • Condition - Diagnoses, health conditions
  • Observation - Lab results, vitals
  • MedicationRequest - Prescriptions
  • DiagnosticReport - Test results

HL7 v2 PHI Segments

  • PID - Patient Identification (SSN in PID-19)
  • DG1 - Diagnosis Information
  • OBX - Observation/Result Values
  • IN1 - Insurance Information

Examples

  • examples/sample-finding.json - Example finding output format
  • examples/sample-audit-report.md - Example audit report
  • examples/synthetic-phi-data.json - Test data for validation

Scripts

  • scripts/detect-phi.py - PHI/PII detection in data files (supports FHIR, HL7, CDA formats)
  • scripts/scan-code.py - Code scanning for PHI leakage
  • scripts/scan-auth.py - Authentication gate detection for PHI endpoints
  • scripts/scan-logs.py - PHI detection in logging statements
  • scripts/scan-response.py - API response PHI exposure detection
  • scripts/generate-report.py - Report generation script
  • scripts/validate-controls.sh - Control validation script
  • scripts/pre-commit-hook.sh - Git pre-commit hook for CI/CD integration