How to Build HIPAA-Compliant Software, Step by Step

HIPAA-compliant software development means building software that protects patient data the way the HIPAA Privacy, Security and Breach Notification Rules require. In practice that comes down to eight steps: confirm you handle protected health information, run a risk analysis, sign agreements with every vendor that touches that data, build in the technical safeguards, keep that data out of logs and notifications, host it on services that support HIPAA, keep records, and plan for a breach before launch.
This guide walks through each step for web and mobile apps, with the rule behind it. It is written for founders and CTOs scoping a healthcare product, and it is a practical guide, not legal advice.
What HIPAA-compliant software development means
HIPAA protects protected health information (PHI): health data that can be tied to a person, such as a diagnosis, a prescription or an appointment linked to a name or email. In software it is usually electronic PHI (ePHI), and the Security Rule is the part that governs how you store, move and access it.
The rules apply to covered entities (health plans, clearinghouses and most healthcare providers) and to their business associates. A software company becomes a business associate when, on a covered entity's behalf, it "creates, receives, maintains, or transmits protected health information", in the words of the definition in 45 CFR 160.103. Hosting a clinic's patient portal, building a telehealth app for a provider or running a SaaS product that stores patient records all fit that description.
Step 1: Confirm you handle PHI, and for whom
Start by mapping the data, because it decides whether HIPAA applies at all. List every piece of health information the product collects, where it comes from and who the customer is. If the data belongs to a covered entity and your software handles it on their behalf, you are a business associate and the Security Rule applies to you directly.
Write this down early. The data map becomes the input for the risk analysis in the next step, and it tells you which parts of the system need the strictest controls. Data you never collect needs no protection, so this is also the moment to drop fields the product does not really need.
Step 2: Run a risk analysis before you design
A risk analysis is a required part of the Security Rule, not a nice-to-have. The administrative safeguards in 45 CFR 164.308 make it the first implementation specification under the security management process, and it is marked Required.
For a new product, do it at design time. Walk through each place ePHI is stored or travels, list what could go wrong (a stolen laptop, a misconfigured storage bucket, an over-privileged support account), and decide how each risk is reduced. The answers shape the architecture: where data is encrypted, who can see what, and what gets logged. A risk analysis done after launch tends to produce a list of expensive retrofits instead.
Step 3: Sign a BAA with every vendor that touches PHI
Every service that creates, receives, stores or transmits PHI for you needs a business associate agreement (BAA). The Security Rule lists business associate contracts among its administrative safeguards, and a vendor that maintains PHI on your behalf falls under the same business associate definition you do.
That list is usually longer than teams expect:
- cloud hosting, databases and file storage;
- email and SMS providers that send messages containing PHI;
- customer support and ticketing tools where agents see patient details;
- error tracking, logging and analytics services, if PHI can reach them;
- backup and disaster recovery services.
Check this before you pick a tool, not after. Not every vendor will sign a BAA, and some only offer one on specific plans. A service that will not sign must never receive PHI, which sometimes means choosing a different provider or redesigning a feature so the data never reaches it.
Step 4: Build in the technical safeguards
The technical safeguards in 45 CFR 164.312 set five standards. Each has implementation specifications marked Required or Addressable. Here is what they mean in code:
| Standard | Specifications in the rule | What it means in your software |
|---|---|---|
| Access control | Unique user identification (Required), emergency access procedure (Required), automatic logoff (Addressable), encryption and decryption (Addressable) | Individual accounts, never shared logins; role-based permissions; a controlled "break-glass" path for emergencies; session timeouts; encrypted storage |
| Audit controls | Standard with no separate specifications | A record of who viewed, created, changed or deleted PHI, and when, kept where ordinary users cannot edit it |
| Integrity | Mechanism to authenticate ePHI (Addressable) | Protection against PHI being altered or destroyed without anyone noticing: checksums, versioning, no silent overwrites |
| Person or entity authentication | Standard with no separate specifications | Proof that a user is who they claim to be; multi-factor sign-in is a common way to meet it, though the current rule does not name it |
| Transmission security | Integrity controls (Addressable), encryption (Addressable) | TLS on every connection that carries PHI, including calls between your own services |
Addressable does not mean optional
The word trips up many teams. Under 45 CFR 164.306(d), an addressable specification must be assessed. If it is reasonable and appropriate, you implement it. If it is not, you document why and implement an equivalent alternative where that is reasonable. For encryption in a modern cloud product, it is very hard to argue that encrypting PHI is unreasonable, so plan to encrypt it at rest and in transit.
The rules may tighten. In January 2025, HHS published a proposed update to the Security Rule to strengthen the protection of ePHI. Check its status when you scope the project; building to the stricter reading now is cheaper than retrofitting later.
Step 5: Keep PHI out of the places it leaks
In many products, PHI escapes not through the database but through side channels that software developers add for convenience, often months after the core security work is done. Check each of these:
- Logs. Request and error logs that capture full payloads end up storing diagnoses, names and dates of birth in plain text, often in a service with no BAA. Log identifiers, not records.
- Crash reporting and analytics. Screen names, URLs and event properties can carry PHI to a third party. Strip it before it leaves the app, or keep these tools off screens that show patient data.
- Push notifications. A notification shows on a locked screen for anyone to read. "You have a new message" is safe; "Your test results for HIV are ready" is not.
- Email and SMS. Send a link to sign in and view the details instead of putting the details in the message.
- URLs. Patient names or record details in a URL end up in browser history, server logs and analytics.
- Test and staging environments. Copies of production data in a test database spread PHI to places with weaker controls. Use synthetic data, or data de-identified under 45 CFR 164.514, which allows either removing 18 categories of identifiers or an expert determination that the risk of re-identification is very small.
Encrypting the database is the easy part. Keeping PHI out of logs, notifications and analytics is where much of the compliance work goes.
Step 6: Choose hosting and services that support HIPAA
Host PHI only on infrastructure whose provider signs a BAA, and configure it to the same standard as your code. A signed BAA does not make every service compliant by default: check which services the agreement covers, and set each one up correctly before it holds patient data.
In practice that means encryption at rest for databases, file storage and backups; TLS for data in transit; private networking for databases; and access to the cloud console limited to named people. The Security Rule's administrative safeguards also require a contingency plan, so tested backups and a documented recovery process belong in the first release, not the second. The remote physiotherapy app case study shows what this looks like in a real build: a HIPAA-compliant back end on AWS, with data encrypted on devices and in the cloud, and every transfer over SSL.
Compliance work also changes the budget. Security reviews, audit logging and the extra testing push a healthcare product toward the higher end of its range, as the software development cost guide explains for regulated builds generally.
Step 7: Document, test and keep records
HIPAA expects evidence, not just good intentions. Your policies, your risk analysis, decisions about addressable specifications and records of security activity all count as documentation. Under 45 CFR 164.316, it has to be kept for six years from the date it was created or last in effect, whichever is later.
Treat this as part of the build. Keep the risk analysis next to the architecture documents, record why each addressable specification was handled the way it was, and make security testing part of your quality assurance, before launch and after every major change. The Security Rule also requires periodic evaluation, so schedule a review rather than waiting for a customer's security questionnaire to force one.
Step 8: Plan your breach response before launch
Decide now who does what if PHI is exposed, because the deadlines are fixed. The breach notification rules set them out:
- Individuals must be notified "without unreasonable delay and in no case later than 60 calendar days after discovery of a breach" (45 CFR 164.404).
- The media must also be notified when a breach involves more than 500 residents of a state or jurisdiction (164.406).
- HHS must be notified at the same time as individuals for breaches involving 500 or more people. Smaller breaches go in a log reported within 60 days after the end of each calendar year (164.408).
These duties apply to unsecured PHI, which 45 CFR 164.402 defines as PHI not made "unusable, unreadable, or indecipherable to unauthorized persons" by a method set out in HHS guidance. Encryption done to that guidance is one more reason to encrypt PHI even though the rule labels it addressable. Your audit logs matter here too: they are how you find out what was accessed, by whom, and how many people are affected.
HIPAA compliance for web applications vs mobile apps
The rules are the same for web applications and mobile apps; the places data escapes are not. On a phone, the device itself becomes part of the risk, which is why healthcare mobile app development needs a few controls a web app does not.
Mobile apps
- Data stored on the phone, including caches and offline copies, must be encrypted and cleared on sign-out.
- Lost and shared devices are common, so use short sessions, biometric or PIN re-entry for sensitive screens, and server-side session revocation.
- Push notifications and app-switcher screenshots can show PHI; keep notification text generic and hide sensitive screens when the app goes to the background.
- Third-party SDKs for analytics, ads or crash reporting run inside your app and can collect what is on screen. Review every one.
Web apps
- Automatic logoff after inactivity matters more on shared clinic computers.
- Session cookies should be secure and HTTP-only, and pages with PHI should not be cached by the browser.
- Tracking scripts and marketing pixels on pages that show patient data can send that data to third parties. Keep them off authenticated pages.
- Exports and printouts create copies outside your controls; log them and limit who can make them.
HIPAA compliance checklist for software development
Use this as a recap before you start building, and again before launch:
- The data map lists every piece of PHI, its source and the covered entity it belongs to.
- A risk analysis is done and recorded, and it shaped the architecture.
- Every vendor that touches PHI has signed a BAA, and the covered services are confirmed.
- Access control, audit logs, integrity checks, authentication and TLS are built in, and each addressable specification has a recorded decision.
- Logs, analytics, crash reports, notifications, emails, URLs and test data are free of PHI.
- Hosting is covered by a BAA, encrypted at rest and in transit, with tested backups and a recovery plan.
- Policies, decisions and security records are kept for six years, and a periodic evaluation is scheduled.
- A breach response plan names who acts, and how individuals, HHS and the media are notified within the deadlines.
If you are scoping a healthcare product and want the architecture, vendor list and safeguards right from the first release, see our healthcare solutions or talk through your project.
FAQs
