June 6, 202610 min readBy Infiniti Tech Partners
HIPAA-Compliant Software Architecture: Patterns That Hold Up

HIPAA compliance is not a feature you add before launch — it is an architecture you commit to from the first schema. Healthtech teams that treat it as a checklist to satisfy at the end end up re-platforming, because the cheap mistakes (PHI in logs, shared databases, no audit trail) are baked into the foundation. Here are the patterns that genuinely hold up when an auditor or a breach tests them, framed for engineers building software that touches protected health information (PHI).

Start with a signed BAA and a clear PHI boundary

Every vendor that stores, processes, or transmits PHI on your behalf must sign a Business Associate Agreement — your cloud provider, your logging service, your email sender, your analytics. If a service touches PHI without a BAA, you are non-compliant by definition, regardless of how good your code is. Equally important: draw an explicit boundary around where PHI lives. The fewer systems inside that boundary, the smaller your audit scope and your breach surface.

Encryption everywhere — and key management that proves it

Encrypt PHI at rest (database, object storage, backups, snapshots) and in transit (TLS 1.2+ on every hop, including service-to-service inside the VPC). That part is table stakes. The part that fails audits is key management: keys in a managed KMS with rotation, access to the keys logged and least-privilege, and no plaintext PHI in places encryption doesn't reach — caches, message queues, search indexes, and especially logs.

Access control: least privilege, enforced server-side

  • Role-based access tied to job function, reviewed on a defined cadence, with onboarding/offboarding automated so access dies with the account.
  • Enforcement server-side, never in the client. A hidden UI button is not access control.
  • Break-glass access for emergencies that is logged, alerted, and reviewed after the fact.
  • Unique user identity for every human and every service — no shared accounts, ever, because shared accounts destroy your audit trail.

Audit logging is the control auditors actually test

HIPAA requires that you can answer 'who accessed which patient's PHI, when, and what did they do.' That means an immutable, tamper-evident audit log capturing every read and write of PHI — append-only storage, separate from application logs, retained per your policy (typically six years). Crucially, the audit log itself must contain no PHI in a way that widens exposure, and it must be queryable, because the first thing a breach investigation needs is that trail.

Isolate PHI and minimize what you keep

Separate PHI from non-PHI at the data layer — a dedicated, tightly-scoped datastore beats PHI sprinkled across every table. Tokenize or pseudonymize where the full record isn't needed (analytics, non-clinical features). Apply data minimization: don't collect or retain PHI you don't need, and define retention and secure-deletion policies. The PHI you never stored can never be breached, and the PHI you isolated keeps your audit scope small.

Patterns that quietly cause breaches

  • PHI in application logs or error trackers (Sentry, CloudWatch) — the single most common real-world HIPAA leak.
  • Non-production environments seeded with real patient data instead of synthetic data.
  • Third-party scripts or analytics on pages that render PHI, shipping it to vendors with no BAA.
  • Backups and database snapshots that are encrypted but world-readable to too-broad IAM roles.

How Infiniti Tech Partners builds healthtech

We architect PHI boundaries, encryption, access control, and audit logging in from the first commit, deploy into BAA-covered infrastructure in your own accounts, and hand over the documentation an auditor will ask for — not a binder written after the fact. If you're building healthtech and want the compliance baked into the architecture rather than bolted on before launch, start a conversation.

Have a related problem you're working on?

Talk to a senior engineer — usually within one business day.

Start a conversation