HIPAA Requirements Overview
HIPAA requires:- Administrative Safeguards — Policies, procedures, training
- Physical Safeguards — Facility access controls, workstation security
- Technical Safeguards — Access controls, encryption, audit logging
- Business Associate Agreements (BAAs) — With all vendors handling PHI
PHI Handling in ClinicalPilot
Where PHI Flows
ClinicalPilot uses Microsoft Presidio to scrub PHI before data reaches any LLM. This includes names, dates, MRNs, addresses, phone numbers, and SSNs.
Technical Safeguards
1. Access Control (§164.312(a)(1))
Implement User Authentication
ClinicalPilot does not include built-in authentication. You must add authentication before production deployment. Recommended: OAuth2 with JWTUnique User Identification
Each user must have a unique ID. Log all actions:Emergency Access Procedure
Define break-glass access for emergencies:- Super admin account (disabled by default)
- Audit log of all emergency access
- Time-limited emergency sessions
2. Audit Controls (§164.312(b))
Log All PHI Access
- Access: User viewed a SOAP note
- Modify: User edited patient data
- Delete: User deleted a record
- Export: User exported data to PDF
- Failed access: Authentication failures
Audit Log Retention
HIPAA requires:- Minimum 6 years retention
- Tamper-proof storage (write-once, append-only)
- Regular review (quarterly recommended)
3. Integrity (§164.312(c)(1))
Data Integrity Controls
- Checksums: Verify data has not been altered
- Digital signatures: Sign SOAP notes with cryptographic signatures
- Version control: Track all edits to patient records
4. Transmission Security (§164.312(e)(1))
Encryption in Transit
TLS 1.2+ is required for all network communication. Nginx configuration:API Communication
Alternatives:- Use local LLMs (MedGemma via Ollama) — no data leaves your network
- Use Azure OpenAI (has BAA available) instead of public OpenAI API
- Self-host open-source LLMs (Llama 3.1, Mistral) on your infrastructure
5. Encryption at Rest (§164.312(a)(2)(iv))
All stored PHI must be encrypted.Database Encryption (LanceDB)
LanceDB stores data as files. Encrypt the entire volume: Linux (LUKS):- AWS: Use EBS encryption (enabled by default)
- Azure: Use Azure Disk Encryption
- GCP: Use persistent disk encryption
Log Encryption
Encrypt audit logs:6. Anonymization (§164.514)
HIPAA allows de-identified data to be exempt from most regulations. ClinicalPilot uses Microsoft Presidio to remove 18 PHI identifiers:- Names
- Dates (except year)
- Phone numbers
- Addresses
- Email addresses
- SSNs
- MRNs
- Device IDs
- URLs
- IP addresses
- Biometric IDs
- Photos
- Account numbers
- Certificate/license numbers
- Vehicle IDs
- Web URLs
- Fax numbers
- Any unique identifying number
Verify Anonymization
Test Presidio output:Business Associate Agreements (BAAs)
You must sign BAAs with all vendors who access PHI:If you use local LLMs only (MedGemma via Ollama), you can avoid BAAs with LLM providers entirely, as no data leaves your network.
Risk Assessment
HIPAA requires periodic Security Risk Assessments.Checklist
- Identify all systems that handle PHI
- Document data flows (where PHI travels)
- Assess risks (unauthorized access, data breaches, etc.)
- Implement safeguards (encryption, access controls, etc.)
- Test incident response plan (ransomware, data breach)
- Review annually or when systems change
Tools
- NIST Cybersecurity Framework
- HHS Security Risk Assessment Tool
- Third-party auditors (healthcare IT compliance firms)
Incident Response Plan
Prepare for breaches:- Detection: Monitor for unauthorized access (SIEM, IDS)
- Containment: Isolate affected systems
- Notification: Notify affected individuals within 60 days (HIPAA Breach Notification Rule)
- Remediation: Patch vulnerabilities, reset credentials
- Documentation: Record all actions taken
Example Breach Scenarios
| Scenario | Response |
|---|---|
| Laptop with PHI stolen | Encrypt all endpoints; notify affected patients |
| Ransomware attack | Restore from backup; notify HHS if >500 individuals affected |
| Unauthorized API access | Revoke API keys; audit access logs; notify users |
| Presidio anonymization failure | Stop all processing; review anonymization logic; re-anonymize data |
Self-Assessment
Use this checklist before production deployment:Administrative Safeguards
- Security officer designated
- Workforce trained on HIPAA
- Policies documented (access control, incident response, etc.)
- BAAs signed with all vendors
- Annual risk assessment scheduled
Physical Safeguards
- Servers in locked facility (or cloud with physical security)
- Workstations have automatic screen locks
- Access logs reviewed (who entered server room)
Technical Safeguards
- User authentication enabled (OAuth2, SAML)
- Unique user IDs assigned
- Audit logging configured (all PHI access)
- Encryption in transit (TLS 1.2+)
- Encryption at rest (disk encryption)
- PHI anonymization verified (Presidio tests)
- LLM provider BAAs signed (if using cloud APIs)
- API rate limiting enabled (DDoS protection)
- Regular backups (encrypted, tested)
- Intrusion detection system (IDS) deployed
HIPAA-Compliant Deployment Example
Scenario: Hospital deploys ClinicalPilot for clinical decision support. Setup:- Infrastructure: AWS GovCloud (HIPAA-eligible)
- Compute: EC2 instances with encrypted EBS volumes
- LLM: Azure OpenAI (BAA signed) instead of public OpenAI
- Vector DB: LanceDB on encrypted EFS
- Authentication: Okta SSO with MFA
- Audit Logs: AWS CloudWatch Logs (6-year retention)
- Network: VPC with private subnets, no internet access
- Monitoring: AWS GuardDuty for threat detection
- Backups: Daily encrypted snapshots to S3 (with versioning)
- Incident Response: PagerDuty alerts for suspicious activity
Alternative: Air-Gapped Deployment
For maximum security, deploy ClinicalPilot completely offline:- Local LLM (MedGemma via Ollama)
- No external APIs (disable PubMed, FDA, RxNorm)
- Local drug database (DrugBank CSV, RxNorm offline files)
- Self-hosted observability (Langfuse on-premises)
- No internet access for application servers
Resources
- HHS HIPAA for Professionals
- NIST Cybersecurity Framework
- HITRUST CSF (healthcare-specific security framework)
- OCR Audit Protocol
Next Steps
Production Deployment
Deploy ClinicalPilot with HIPAA safeguards
Observability
Set up audit logging with LangSmith