MOFU Architecture Reference · 2026
HIPAA-Compliant SaaS Architecture: A Builder's Guide
Engineering reference for shipping a HIPAA-defensible SaaS in 2026. BAAs, encryption strategy, audit logging, access controls, BAA-eligible infrastructure, and the gotchas that fail audits.
By Bill Beltz, founder of QUANT LAB USA INC · Published May 12, 2026
Quick answer: what does HIPAA-compliant SaaS architecture require?
Six pillars: signed BAAs with every vendor that touches PHI, encryption at rest (AES-256) and in transit (TLS 1.2+), unique user IDs with MFA enforced, role-based access with minimum-necessary scoping, immutable audit logs retained for six years, and a written incident response and breach notification plan. Build on BAA-eligible infrastructure (AWS, GCP, Azure, Vercel Enterprise, Render Team+), redact PHI from logs at the application boundary, and design for "show your work" — auditors care about evidence as much as controls.
HIPAA-compliant SaaS is not a label you buy. It is a posture you build, document, and prove. The Security Rule's safeguards are deliberately principles-based, which means two clean implementations can both be defensible and look nothing alike. This guide is the architecture we ship at QUANT LAB USA when the build touches PHI.
Background: What is HIPAA compliance? and our healthcare industry page.
The six architectural pillars
- BAA coverage end-to-end. Every vendor in the PHI data path has a signed BAA. No exceptions.
- Encryption. At rest (AES-256, KMS-managed keys) and in transit (TLS 1.2+, modern ciphers).
- Identity and access. Unique IDs, MFA on workforce access, SSO for admin, RBAC with minimum-necessary.
- Audit logging. Immutable, six-year retention, anomaly alerting.
- Incident response. Written plan, breach notification timeline (60 days), tabletop exercise annually.
- Risk analysis. Annual SRA, with documented decisions on addressable vs required controls.
BAA-eligible infrastructure stack (2026)
| Layer | BAA-eligible options | Notes |
|---|---|---|
| Hosting | AWS, GCP, Azure, Vercel Enterprise, Render Team+, Fly.io | Cloudflare BAA on Enterprise only |
| Database | AWS RDS, GCP CloudSQL, Supabase Team, Neon Business | Verify the specific Postgres tier is BAA-eligible |
| Postmark with BAA, SendGrid HIPAA, Paubox | Standard SendGrid is NOT covered | |
| SMS / Telephony | Twilio with BAA, Bandwidth | Twilio BAA is opt-in via account team |
| Payments | Stripe with BAA | Standard Stripe accounts already have BAA available |
| Logging / observability | Datadog (HIPAA tier), Sentry Business+, AWS CloudWatch | Verify before sending PHI to any observability tool |
| Auth | Auth0, AWS Cognito, Okta, Clerk (with BAA) | Clerk BAA is on Enterprise |
| File storage | AWS S3, GCP Cloud Storage, Azure Blob | Cloudflare R2 is BAA on Enterprise |
| LLM / AI | OpenAI Enterprise, Anthropic via AWS Bedrock, Azure OpenAI | Self-host Llama/Mistral to avoid the question |
Encryption strategy
Layer your encryption. The standard pattern we ship:
- Volume / disk: Provider-managed (EBS encryption, GCP persistent disk encryption). Covers backups, snapshots automatically.
- Database TDE: Postgres TDE via the cloud provider's managed offering. Encrypts the data files on disk.
- Application-layer column encryption: For sensitive fields like SSN, DOB, clinical notes. Use envelope encryption with KMS-managed data encryption keys.
- TLS everywhere: TLS 1.2 minimum (TLS 1.3 preferred), HSTS with preload, no SSLv3/TLS 1.0/1.1.
- Backup encryption: Encrypted with separate keys from production. Test restore quarterly.
- Key management: AWS KMS, GCP KMS, Azure Key Vault, or HashiCorp Vault. Annual key rotation. Audit log for every key access.
Identity, access, and the minimum-necessary standard
Access controls are the most-cited HIPAA finding category. Build them at the data layer, not the UI layer. UI-only hiding is a recurring audit fail.
- Unique user IDs. No shared accounts. Service accounts get unique IDs too.
- MFA enforced. SSO with MFA for all workforce access. Hardware keys for admins where feasible.
- RBAC at the database. Use Postgres row-level security (RLS) or equivalent. Application middleware is a backup, not the primary boundary. See our multi-tenant SaaS with Postgres RLS guide.
- Just-in-time elevation. Support staff request elevated access per-incident with reason capture and time limits.
- Termination automation. When workforce members offboard, all access revokes within 24 hours, ideally same day.
- Privileged session recording. Database admin sessions, prod shell sessions, captured for review.
Audit logging architecture
Audit logs are how you prove the program works. The pattern we ship:
- Application emits structured audit events on every PHI access (read, create, update, delete).
- Events written to an append-only Postgres table with row-level immutability triggers.
- Events also forwarded to long-term archive (S3 Glacier with object-lock, BAA covered).
- Six-year retention minimum. Many programs keep ten.
- Real-time anomaly detection on unusual access patterns (volume spikes, off-hours access, geographic outliers).
- Quarterly audit log review by the privacy officer. Documented.
What to log: actor identity, action, resource ID, timestamp, IP, user agent, outcome (success/fail), and request reason for elevated-access flows. Do NOT log the PHI itself unless absolutely necessary — log the resource ID instead.
PHI redaction at the application boundary
The single most common HIPAA architecture mistake we see: PHI leaks into logs, error reports, and third-party analytics. Build redaction at the application boundary so PHI does not escape into systems without BAA coverage.
- Structured logging with explicit field allowlists. Unknown fields drop by default.
- Pre-Sentry middleware that scrubs request bodies and stack-trace variables.
- No client-side telemetry of patient inputs. PostHog and similar require careful field-level scrubbing.
- Sanitize URL paths — patient IDs in URLs end up in CDN logs.
- Audit your CDN and WAF logs. Cloudflare WAF logs without BAA coverage are a risk.
Incident response and breach notification
HIPAA mandates a 60-day breach notification window for impermissible disclosures affecting 500+ individuals. Have the plan written before you need it.
- Defined incident classification (Sev 1/2/3) with response timelines.
- Named incident commander role with delegation.
- Breach assessment protocol — what triggers the 60-day clock.
- OCR notification template ready.
- Individual notification template ready.
- Annual tabletop exercise. Document it.
- Forensic readiness — log retention, evidence collection procedure.
Risk analysis (SRA): the unsexy backbone
The Security Risk Analysis is the most-skipped HIPAA requirement and the easiest finding for an auditor. Annual SRA, documented, with risk treatment decisions, owners, and remediation timelines.
We use NIST 800-30 as the SRA methodology. Threats and vulnerabilities are inventoried, likelihood and impact scored, residual risk calculated after compensating controls, and treatment decisions logged. The output is a 30-50 page document that auditors love.
Penetration testing and vulnerability management
HIPAA does not name penetration testing explicitly, but auditors expect it. Plan on:
- Annual web application penetration test. Budget $15K to $40K. See our pentest cost guide.
- Quarterly authenticated vulnerability scans.
- Dependency scanning in CI (Snyk, Dependabot, Trivy).
- SAST in CI for code review automation.
- Documented patch SLA (critical < 7 days, high < 30 days).
See our pentest vs scan explainer for the distinction.
When to consider HITRUST
HITRUST CSF is a control framework that maps HIPAA, NIST, ISO, and others. Many large hospital systems prefer or require HITRUST i1 or r2 certification from vendors. Plan on $50K to $200K and 9 to 18 months for full HITRUST r2.
Pursue HITRUST when buyers are demanding it. Do not pursue it before then — HIPAA self-attestation plus SOC 2 Type II is usually sufficient for most healthcare buyers.
FAQ
What does HIPAA-compliant SaaS actually mean?
HIPAA does not certify software. A SaaS is 'HIPAA-compliant' when it implements the Security Rule's administrative, physical, and technical safeguards, has signed Business Associate Agreements (BAAs) with every vendor that touches PHI, and can prove the controls through documentation, audit logs, and access policies. Compliance is a posture and a paper trail, not a label.
What is a Business Associate Agreement (BAA)?
A BAA is a contract between a Covered Entity (your healthcare customer) and a Business Associate (you, the SaaS) that allocates HIPAA responsibilities and binds the BA to the same Security and Privacy Rule obligations. You sign BAAs upstream with your healthcare customers and downstream with every infrastructure vendor that processes PHI on your behalf — AWS, Vercel, Sentry, OpenAI, Twilio, etc.
Which cloud providers offer BAAs?
AWS, GCP, Azure all offer BAAs for their HIPAA-eligible service lists. Vercel offers a BAA on Enterprise plans. Cloudflare offers a BAA on Enterprise. Render offers a BAA on Team plans and above. Supabase offers a BAA on Team and Enterprise. Stripe offers a BAA. The trap: not all services within a provider are BAA-eligible — verify the specific services you use are on the list.
Do I need to encrypt PHI at rest?
Functionally yes, even though the Security Rule technically calls encryption 'addressable' rather than 'required.' Most BAAs and most state laws make encryption non-negotiable. Use AES-256 at the storage layer (database TDE or volume encryption) plus application-layer encryption for sensitive fields like SSN and clinical notes. Key management via AWS KMS, GCP KMS, or HashiCorp Vault.
Does HIPAA require multi-factor authentication?
Yes, in practice. The Security Rule requires unique user IDs and 'reasonable and appropriate' access controls. Every audit we have seen demands MFA on workforce member access to PHI systems and SSO with MFA for admin access. Skip MFA and you will fail any reasonable risk assessment.
Can I use OpenAI or other LLM APIs with PHI?
OpenAI offers a BAA on Enterprise/API tiers (with the zero-data-retention policy enabled). Anthropic offers BAAs through AWS Bedrock. Microsoft Copilot has Azure OpenAI with BAA. Self-hosted LLMs (Llama, Mistral) avoid the third-party question entirely. Do not pass PHI to any model API without a signed BAA covering it.
What about logging — can I log PHI?
Logs that contain PHI are themselves PHI. They need encryption, access controls, audit trails, and BAA coverage from your logging vendor. Better practice: redact PHI before logs leave your application. Use structured logging with explicit field allowlists and drop unknown fields by default.
How long do I need to retain audit logs?
HIPAA requires six years of retention for security incident documentation. Most teams retain access logs and audit trails for the same six years to be safe. Storage cost is trivial relative to the cost of being unable to produce an audit trail during an incident response.
What is the minimum-necessary standard?
The Privacy Rule requires that PHI access be limited to the minimum necessary to accomplish the intended purpose. In software, this translates to role-based access controls with granular permissions, just-in-time elevation for support staff, and audit logs that capture both legitimate and anomalous access patterns.
Do I need annual penetration testing for HIPAA?
HIPAA does not name 'penetration testing' explicitly, but it requires 'regular' evaluation and risk analysis. Every healthcare auditor we have worked with expects annual penetration tests on PHI-handling systems. Plan on $15K to $40K annually for a single application scope. See our penetration test cost guide for ranges.
What is HITRUST and do I need it?
HITRUST CSF is a control framework that maps HIPAA, NIST, ISO, and other standards. HITRUST certification is more expensive and rigorous than self-attestation HIPAA compliance, and many large hospital systems prefer or require it from vendors. Plan on $50K to $200K and 9 to 18 months for HITRUST. Pursue it if your buyers demand it; not before.
How long does HIPAA compliance take for a new SaaS?
From cold start to defensible HIPAA posture: 3 to 6 months for a focused SaaS with a clean stack. The work splits into engineering (encryption, access controls, audit logs, BAA-eligible infrastructure), legal (BAA templates, policy documentation), and operational (workforce training, incident response, risk analysis). We build clients to HIPAA readiness as part of every healthcare engagement.
Related reading and next steps
- Custom Business Software service
- SaaS Platform Development
- Penetration Testing service
- Healthcare industry expertise
- Multi-tenant SaaS with Postgres RLS
- Penetration Test Cost 2026
- SOC 2 Pentest Prep Guide
- Pentest vs Vulnerability Scan
- What is HIPAA compliance?
- What is Zero Trust?
- Case study — Regional Medical Billing
- Talk to an engineer
Build HIPAA-ready from day one.
Free 30-minute architecture review. We will walk through your stack, BAA coverage, and risk posture. If you are about to ship something that fails an audit, you want to know now.
More compliance + architecture reading
All postsCybersecurity Services for SaaS Startups (2026)
What security work a SaaS founder actually needs in years 1-3.
Read postPCI-DSS Compliance for SaaS Checklist
What PCI scope reduction looks like when you route payments through Stripe.
Read postRed Team vs Pen Test vs Audit
Three engagement types, three buyer profiles, and when to use each.
Read post