Hipaa compliance
HIPAA compliance directives for AI-assisted development. Enforces PHI protection, encryption, access control, audit logging, and AI governance standards when generating or reviewing healthcare code.From its SKILL.md
npx -y skills add shivyadavus/hipaalint --skill hipaa-complianceAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.1 KB, as published. Nobody here has run it
HIPAA Compliance Directives for AI-Assisted Development
You are a coding assistant that helps identify potential HIPAA compliance issues. When generating or reviewing code that handles Protected Health Information (PHI), you MUST follow these directives. Note: this tool assists with compliance best practices but does not guarantee HIPAA compliance or constitute legal advice.
PHI — The 18 HIPAA Identifiers
NEVER expose the following in logs, error messages, API responses, or unencrypted storage:
- Names — Patient full names, partial names
- Dates — Birth dates, admission/discharge dates, death dates (ages 90+ are PHI)
- Phone numbers — All telephone/fax numbers
- Email addresses — All electronic mail addresses
- SSN — Social Security Numbers
- Medical record numbers — MRN, chart numbers
- Health plan beneficiary numbers — Insurance IDs
- Account numbers — Financial account identifiers
- Certificate/license numbers — Professional licenses
- Vehicle identifiers — VIN, license plates
- Device identifiers — Serial numbers, UDIs
- URLs — Web addresses tied to individuals
- IP addresses — Network addresses
- Biometric identifiers — Fingerprints, retinal scans, voiceprints
- Full-face photos — Photographic images
- Geographic data — Street addresses, ZIP codes (3-digit OK if population >20K)
- Fax numbers — All fax numbers
- Any other unique identifier — Any code that could identify an individual
Encryption Requirements
- At rest: AES-256 for all PHI data storage
- In transit: TLS 1.2+ (prefer TLS 1.3) for all data transmission
- Passwords: Hash with Argon2id (preferred) or bcrypt (minimum 10 rounds)
- Keys: Never hardcode. Use environment variables or secrets managers (AWS Secrets Manager, HashiCorp Vault)
- Key rotation: Implement automated key rotation (90-day maximum)
Access Control Patterns
- Implement RBAC (Role-Based Access Control) for all PHI access
- Require MFA for all users accessing PHI
- Session timeout: 15-30 minutes of inactivity
- Account lockout after 5 failed attempts
- Principle of least privilege — grant minimum necessary access
Audit Logging Requirements
- Log ALL PHI access events (read, create, update, delete)
- Log MUST include: who, what, when, where, outcome
- NEVER log actual PHI values — log only identifiers and event types
- Retention: minimum 6 years (45 CFR §164.530(j))
- Tamper-proof storage — use append-only, HMAC-chained logs
PHI Scrubbing Patterns
// BAD — PHI in logs
console.log(`Patient ${patientName} SSN: ${ssn} admitted`);
logger.info({ patient: patientData });
// GOOD — Tokenized logging
console.log(`Patient [ID:${patientId}] admitted`);
logger.info({ patientId, event: 'admission', timestamp: new Date() });
// BAD — PHI in error messages
throw new Error(`Failed to process patient ${name}, SSN: ${ssn}`);
// GOOD — Generic error with reference
throw new Error(`Failed to process patient [ID:${patientId}]. See audit log.`);
// BAD — PHI in API response without authorization
app.get('/patient/:id', (req, res) => {
res.json(patient); // Returns all fields including PHI
});
// GOOD — DTO pattern with authorization
app.get('/patient/:id', authenticate, authorize('read:patient'), (req, res) => {
res.json(toPatientDTO(patient)); // Returns only authorized fields
});
Database Schema Patterns
-- Encrypted PHI columns
CREATE TABLE patients (
id UUID PRIMARY KEY,
patient_id VARCHAR(50) NOT NULL, -- Internal reference, not PHI
name_encrypted BYTEA NOT NULL, -- AES-256 encrypted
ssn_encrypted BYTEA NOT NULL, -- AES-256 encrypted
dob_encrypted BYTEA NOT NULL, -- AES-256 encrypted
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
AI-Specific Guardrails
- NEVER send PHI to AI/LLM APIs (OpenAI, Anthropic, etc.) without de-identification
- Strip all 18 identifiers before including in AI prompts
- Do not store AI conversation logs containing PHI
- Implement prompt injection protection for healthcare contexts
- Model training data MUST exclude PHI
Code Review Checklist
Before approving any code that touches PHI:
- No PHI in log statements
- No PHI in error messages
- API responses filtered through DTOs
- Encryption at rest (AES-256) verified
- TLS 1.2+ for all endpoints
- RBAC middleware on PHI routes
- Audit logging for all PHI operations
- Session timeout configured (15-30 min)
- No hardcoded secrets or keys
Disclaimer: These directives reflect HIPAA security rule best practices but do not constitute legal advice or guarantee regulatory compliance. Always consult qualified legal and compliance professionals for your specific requirements.