Hipaa

From tinh2/skills-hub-registry · View interactive version

Hipaa is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Deep HIPAA Security Rule technical audit mapping code-level findings to 45 CFR sections. Triggers: building or auditing healthcare apps, EHR integrations, FHIR APIs, telehealth platforms.

How to use this skill

Skill file

You are in AUTONOMOUS MODE. Do NOT ask questions. Audit every HIPAA Security Rule safeguard systematically against the actual codebase.

TARGET:

$ARGUMENTS

If no arguments provided, audit the entire project in the current working directory against all HIPAA Security Rule safeguards. If a specific safeguard category is named (e.g., "technical only", "audit controls"), focus there but still note cross-cutting gaps.

============================================================

PHASE 0: SYSTEM CHARACTERIZATION

============================================================

Before auditing, characterize the system:

  1. Detect the tech stack (package.json, requirements.txt, pom.xml, go.mod, etc.).
  2. Identify the system architecture:
  1. Map PHI-containing components:
  1. Identify covered entities vs business associates in the architecture.

============================================================

PHASE 1: ADMINISTRATIVE SAFEGUARDS (45 CFR 164.308)

============================================================

Scan for administrative safeguard implementation in code and configuration:

SECURITY MANAGEMENT PROCESS (164.308(a)(1)):

security review artifacts in the codebase.

disciplinary workflow code.

WORKFORCE SECURITY (164.308(a)(3)):

Verify deactivated accounts cannot authenticate.

INFORMATION ACCESS MANAGEMENT (164.308(a)(4)):

SECURITY AWARENESS (164.308(a)(5)):

history enforcement.

SECURITY INCIDENT PROCEDURES (164.308(a)(6)):

CONTINGENCY PLAN (164.308(a)(7)):

EVALUATION (164.308(a)(8)):

compliance scan configurations in CI/CD.

============================================================

PHASE 2: PHYSICAL SAFEGUARDS (45 CFR 164.310)

============================================================

Scan for physical safeguard implementation (in infrastructure config and code):

FACILITY ACCESS CONTROLS (164.310(a)(1)):

WORKSTATION USE AND SECURITY (164.310(b)/(c)):

DEVICE AND MEDIA CONTROLS (164.310(d)(1)):

============================================================

PHASE 3: TECHNICAL SAFEGUARDS (45 CFR 164.312)

============================================================

This is the primary code audit phase. Scan deeply for each technical safeguard:

ACCESS CONTROL (164.312(a)(1)):

Unique User Identification:

Emergency Access Procedure:

Automatic Logoff:

Encryption and Decryption:

AUDIT CONTROLS (164.312(b)):

Comprehensive Audit Logging:

IP address, user agent.

Audit Log Protection:

Audit Log Review:

INTEGRITY (164.312(c)(1)):

Data Integrity Mechanisms:

Electronic PHI Integrity:

PERSON OR ENTITY AUTHENTICATION (164.312(d)):

Authentication Strength:

Flag MD5, SHA-1, SHA-256 without salt/stretching.

Session Management:

TRANSMISSION SECURITY (164.312(e)(1)):

Encryption in Transit:

Integrity Controls:

Network Controls:

============================================================

PHASE 4: PHI DATA FLOW ANALYSIS

============================================================

Trace PHI through the entire system:

INGESTION:

PROCESSING:

STORAGE:

TRANSMISSION:

DISPOSAL:

============================================================

SELF-HEALING VALIDATION (max 2 iterations)

============================================================

After producing the security analysis, validate thoroughness:

  1. Verify every category in the audit was actually checked (not skipped).
  2. Verify every finding has a specific file:line location.
  3. Verify severity ratings are justified by impact assessment.
  4. Verify no false positives by re-reading flagged code in context.

IF VALIDATION FAILS:

============================================================

OUTPUT

============================================================

HIPAA Security Rule Technical Audit

Project: [name]

Stack: [detected technologies]

PHI-Containing Components: [count] models, [count] services, [count] endpoints

Date: [date]

Safeguard Summary

| Safeguard Category | Section | Status | Critical | High | Medium | Low |

|---|---|---|---|---|---|---|

| Administrative — Security Management | 164.308(a)(1) | [PASS/WARN/FAIL] | N | N | N | N |

| Administrative — Workforce Security | 164.308(a)(3) | [PASS/WARN/FAIL] | N | N | N | N |

| Administrative — Info Access Mgmt | 164.308(a)(4) | [PASS/WARN/FAIL] | N | N | N | N |

| Administrative — Security Awareness | 164.308(a)(5) | [PASS/WARN/FAIL] | N | N | N | N |

| Administrative — Incident Procedures | 164.308(a)(6) | [PASS/WARN/FAIL] | N | N | N | N |

| Administrative — Contingency Plan | 164.308(a)(7) | [PASS/WARN/FAIL] | N | N | N | N |

| Physical — Facility Access | 164.310(a)(1) | [PASS/WARN/FAIL] | N | N | N | N |

| Physical — Workstation Security | 164.310(b)/(c) | [PASS/WARN/FAIL] | N | N | N | N |

| Physical — Device/Media Controls | 164.310(d)(1) | [PASS/WARN/FAIL] | N | N | N | N |

| Technical — Access Control | 164.312(a)(1) | [PASS/WARN/FAIL] | N | N | N | N |

| Technical — Audit Controls | 164.312(b) | [PASS/WARN/FAIL] | N | N | N | N |

| Technical — Integrity | 164.312(c)(1) | [PASS/WARN/FAIL] | N | N | N | N |

| Technical — Authentication | 164.312(d) | [PASS/WARN/FAIL] | N | N | N | N |

| Technical — Transmission Security | 164.312(e)(1) | [PASS/WARN/FAIL] | N | N | N | N |

PHI Data Flow Map

Ingestion: [sources] -> Processing: [services] -> Storage: [databases/caches] -> Transmission: [destinations]

Disposal: [retention policy and mechanism]

Detailed Findings

For each safeguard with WARN or FAIL:

[Safeguard — CFR Section]

| # | Severity | File | Line | Requirement | Gap | Remediation |

|---|----------|------|------|-------------|-----|-------------|

| 1 | Critical | path/to/file.ts | 42 | 164.312(a)(2)(iv) | PHI stored unencrypted | Implement AES-256 field-level encryption |

Encryption Assessment

| Layer | Method | Algorithm | Key Management | Status |

|---|---|---|---|---|

| Database at rest | [TDE/column/app-level/none] | [AES-256/etc.] | [KMS/env/hardcoded] | [OK/FAIL] |

| File storage | [SSE/client-side/none] | [AES-256/etc.] | [KMS/etc.] | [OK/FAIL] |

| In transit | [TLS version] | [cipher suite] | [cert source] | [OK/FAIL] |

| Backups | [encrypted/unencrypted] | [algorithm] | [key source] | [OK/FAIL] |

Access Control Matrix

| Role | PHI Read | PHI Write | PHI Delete | Admin | Audit View |

|---|---|---|---|---|---|

| [role] | [yes/no] | [yes/no] | [yes/no] | [yes/no] | [yes/no] |

Risk Summary

Remediation Roadmap

[Ordered by severity and implementation dependency, with effort estimates]

============================================================

NEXT STEPS

============================================================

After reviewing the audit:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /hipaa — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

============================================================

DO NOT

============================================================

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.