Devrise Blog

How to Build a HIPAA-Compliant Healthcare App

A practical step-by-step guide to scoping PHI, designing the three required safeguard layers, managing Business Associate Agreements, and sustaining compliance through launch and beyond.

Compliance
Duy
Published at Aug 3, 2026

Any application that stores, transmits, or processes Protected Health Information (PHI) on behalf of a hospital, clinic, insurer, or pharmacy must meet HIPAA's requirements before it handles a single patient record. Getting there is not a one-time checklist; it is an engineering and operational discipline that runs from the first design decision through every release that follows. This guide walks through what the law requires, how to design for it, and the concrete steps a development team takes to reach and maintain compliance.

What HIPAA Requires of Your App

Protected Health Information

PHI is any individually identifiable health information linked to a past, present, or future medical condition, treatment, or payment. The category is broader than most teams expect:

  • Clinical data: diagnoses, prescriptions, lab results, treatment plans
  • Identifiers: name, phone number, email address, date of birth
  • Financial data: insurance information, account numbers, billing records
  • Technical identifiers: IP addresses, device identifiers, biometric data, photographs

If your application collects, stores, or transmits any of these in connection with health care, it handles PHI and HIPAA applies. This includes not just covered entities — hospitals, clinics, and insurers — but also business associates: the development companies, cloud providers, analytics platforms, and any other vendor that processes PHI on a covered entity's behalf.

The Three Rules

HIPAA's framework rests on three rules that any compliant application must address.

The Privacy Rule governs how PHI may be used and disclosed. It establishes patient rights — to access their own records, request corrections, and receive notice of how their data is used. Your application design must implement these rights: data access endpoints, correction workflows, and privacy notices.

The Security Rule specifies the administrative, physical, and technical safeguards required to protect electronic PHI (ePHI). This is where most engineering work lives.

The Breach Notification Rule requires covered entities and their business associates to notify affected individuals and HHS within 60 days of discovering a breach. That clock starts at discovery — not at the conclusion of your investigation.

The Three Safeguard Layers

The Security Rule organizes its requirements into three categories. A compliant application must address all three; gaps in any one are audit findings.

Administrative Safeguards

Administrative safeguards are policies and procedures — not code — but they drive every technical decision that follows.

  • Risk analysis: A written assessment documenting the threats to ePHI in your system, the likelihood of each threat, and the controls addressing them. HIPAA requires this before you go live and again whenever the system changes significantly. The document itself is a required artifact — auditors ask for it first.
  • Access management: Documented rules defining who can access which PHI, under what circumstances, and how access is revoked when a role changes.
  • Workforce training: All staff with PHI access must receive regular HIPAA training. Annual refreshes are the minimum standard.
  • Incident response: Named owners, documented escalation paths, and pre-approved communication templates ready before a breach occurs — not assembled during one.
  • Business Associate Agreement (BAA) management: A register of every vendor with PHI access and a signed BAA for each one.

Technical Safeguards

These are the controls your engineering team builds into the application and infrastructure.

Control Requirement
Unique user IDs Every account maps to one individual — no shared logins
Role-Based Access Control Least-privilege access by job function
Multi-factor authentication Required for administrative and clinical roles
Automatic logoff Enforced on inactivity on both web and mobile
Encryption at rest AES-256 or equivalent for all ePHI storage
Encryption in transit TLS 1.2 or higher for all network communication
Audit logging Immutable logs capturing reads, writes, and configuration changes
Data integrity controls Mechanisms detecting unauthorized modification of ePHI

Mobile applications carry one additional requirement: any PHI cached or stored locally on a device must be encrypted at rest with device-level controls. Applications must also implement appropriate handling for compromised devices.

Physical Safeguards

For cloud-native applications, the hosting provider handles data centre infrastructure under its own BAA. Your team retains responsibility for workstation and mobile device controls, tested backup and disaster recovery procedures, emergency access procedures for critical clinical scenarios, and the handling of PHI in development and staging environments.

Building a HIPAA-Compliant App: Step by Step

Step 1: Scope PHI and Map Data Flows

Before writing a line of code, document every category of PHI the application will touch and trace the full lifecycle: where it enters, where it is stored, how it moves between services, and how it is deleted or de-identified. The output is a written PHI data flow diagram. You cannot design safeguards for data flows you have not mapped, and this diagram becomes the foundation of your risk analysis.

Step 2: Perform a Formal Risk Analysis

Review the data flow diagram against known threat categories: unauthorized access, data interception in transit, ransomware and data destruction, insider misuse, and infrastructure failure. For each threat, document the likelihood, the potential impact, and the control you plan to implement. Write this down in a dated document. A missing or undated risk analysis is a finding on its own — it is not sufficient to demonstrate that the analysis was done verbally or informally.

Step 3: Choose HIPAA-Eligible Infrastructure and Sign BAAs

Not every service from a cloud provider is covered by the provider's BAA. Before routing any ePHI to a cloud service, confirm it appears on the provider's published list of eligible services. AWS publishes its HIPAA Eligible Services reference; Microsoft documents covered Azure services in its compliance offerings; Google Cloud lists eligible services in its Healthcare compliance guide.

Sign the BAA with your chosen provider before any production PHI flows through it. If your application integrates with EHR systems, plan FHIR API support at architecture time — retrofitting an integration layer after data models are established is significantly more expensive.

Step 4: Implement Technical Controls

Build the controls defined in the technical safeguards layer. A few architecture patterns make this more reliable:

Authentication and access: Use a centralized policy engine for access decisions rather than scattering authorization checks across services. Issue short-lived authentication tokens with refresh flows; enforce logoff at the server, not only in the UI.

Encryption: Use cloud-managed key services (AWS KMS, Azure Key Vault, Cloud KMS) rather than hardcoded keys. Never store unencrypted PHI in local device storage, application caches, or development environments.

Audit logging: Build an immutable, append-only audit log pipeline that ships records to a separate, write-protected service — AWS CloudTrail, Azure Monitor Logs, or Google Cloud Audit Logs. The application should not be able to delete its own audit records.

For AI or machine learning features that process PHI, add access logging at the model level and document how PHI enters and exits the model pipeline.

Step 5: Apply a Secure Development Lifecycle

Integrate compliance into your engineering process rather than treating it as a final audit:

  • Run static analysis and dependency scanning on every pull request
  • Require security-trained reviewers on code paths that handle ePHI directly
  • Use synthetic or de-identified data in development and staging; if real PHI is needed for testing, treat that environment as a production environment with all corresponding controls
  • Include a compliance check in pre-release validation alongside functional testing
  • Maintain change control procedures for production deployments so every change is reviewed before it touches live PHI

Step 6: Test and Validate Before Launch

Before accepting production PHI, complete:

  • External penetration test by a firm with healthcare experience
  • Vulnerability scans across every infrastructure component
  • Compliance audit verifying each Security Rule control is implemented and documented
  • BAA verification: confirm every vendor in the production stack has a signed agreement
  • Configuration review covering secrets management, logging coverage, encryption settings, and access policies

Common failure modes discovered at this stage: storage buckets missing server-side encryption, analytics SDKs transmitting device identifiers alongside PHI, logging pipelines that strip PHI from application logs but leave it exposed in infrastructure logs, and admin access roles left over from development that were never tightened.

Step 7: Operate Ongoing Compliance

Launch is the beginning, not the end. Sustained compliance requires:

  • Real-time anomaly detection for unusual access patterns in audit logs, with documented review procedures and named owners
  • Annual risk assessments updated as the application evolves — not recycled from the previous year unchanged
  • Quarterly BAA reviews and renewals as vendor relationships change
  • Workforce training refreshes whenever roles change or new staff join

The 60-day breach notification window under the Breach Notification Rule starts at discovery. Build incident response procedures around fast triage with pre-approved communication templates — the investigation continues in parallel with notification, not in sequence before it.

Common Mistakes That Lead to Enforcement Actions

Treating compliance as a launch checklist. Enforcement consistently targets organizations with a compliant launch but no ongoing maintenance program. The risk analysis, BAA register, and audit log reviews all require periodic updates as the application and its threat landscape evolve.

Missing BAAs with downstream vendors. Push notification services, error tracking SDKs, analytics platforms, and customer support systems are all business associates if PHI passes through them. Each needs a signed BAA. Many teams audit their primary cloud provider carefully and then overlook a dozen smaller tools in the same stack.

Using non-eligible cloud services. A service from a HIPAA-capable cloud provider is not automatically covered by the provider's BAA. Logs routed to non-eligible monitoring endpoints, files cached in non-eligible CDN tiers, or backups in non-eligible archive storage are out-of-scope for the BAA and create compliance exposure.

Broad access roles left from development. Admin roles granted during development and never tightened before launch are a recurring audit finding. Every production role needs documented justification, a minimum-necessary scope, and a named owner.

Skipping mobile-specific controls. Automatic logoff, encrypted local storage, and device-level access controls must be tested on real hardware in realistic conditions. Simulator and emulator testing does not expose the same failure modes as a real device.

Compliance Is an Engineering Discipline

HIPAA compliance is not a status you achieve and hold. It is a set of practices — risk analysis, access control, encryption, audit logging, BAA management, and ongoing testing — that must run continuously as the application evolves. Teams that build these practices into their engineering culture before writing production code spend significantly less time and money retrofitting them later. The common thread across avoidable enforcement situations is not a single missed control; it is an organization that treated compliance as a project milestone rather than an ongoing operating discipline.