EHR teams often run two security projects side by side: one for HIPAA because their customers are covered entities, and one for SOC 2 because those same customers ask for a report. Done separately, they double the work and still miss things.
This post maps one set of engineering controls to both, with the evidence each control should leave behind. It is written for teams building an EHR or a product that stores its data. HIPAA has no official certification, and a SOC 2 report is something your own organization obtains from a CPA firm.
How do HIPAA and SOC 2 apply to EHR security?
Building to HIPAA requirements?
Our HIPAA page explains the safeguards software teams build and how they are evidenced.
HIPAA sets legal safeguards for electronic health information, while SOC 2 is an audit report on how well a service organization's controls work. For an EHR, one set of controls can satisfy both: access, audit logging, change management, vendor management, incident response and backups. Agnotic Technologies builds those controls into the product so evidence comes from the system itself.
The HIPAA Security Rule requires administrative, physical and technical safeguards for electronic protected health information.
A SOC 2 report is an assurance report, issued by a CPA, on a service organization's controls relevant to security, availability, processing integrity, confidentiality or privacy.
Where do both start?
Both start with a risk assessment. It decides which controls matter most for your system and is the first document an auditor or a customer's security team asks for.
The HIPAA Security Rule requires an accurate and thorough risk analysis of the potential risks and vulnerabilities to the confidentiality, integrity and availability of ePHI.
Write it about your actual architecture: data stores, integrations, vendors and the people with production access. Update it when any of those change.
The control map
Each line below names a control, the HIPAA area it supports, the SOC 2 area it supports, and the evidence the system should produce.
- Access control: HIPAA access control and unique user identification; SOC 2 logical access. Evidence: role definitions, access reviews and removal records for leavers.
- Authentication: HIPAA person or entity authentication; SOC 2 logical access. Evidence: multi-factor settings and login records.
- Audit logging: HIPAA audit controls; SOC 2 system monitoring. Evidence: logs of record access and changes, kept and reviewed.
- Encryption: HIPAA encryption and transmission security; SOC 2 confidentiality and logical access. Evidence: configuration exports for storage and network encryption.
- Change management: HIPAA integrity and evaluation; SOC 2 change management. Evidence: pull requests, approvals and deploy records.
- Vendor management: HIPAA business associate agreements; SOC 2 vendor risk. Evidence: vendor list, agreements and reviews.
- Incident response: HIPAA security incident procedures; SOC 2 incident handling. Evidence: runbook, tickets and post-incident reviews.
- Backup and recovery: HIPAA contingency plan; SOC 2 availability. Evidence: backup reports and restore test results.
How do you make the system produce evidence?
Evidence collected by hand at audit time is slow and incomplete. Build it into everyday work instead.
- Access reviews: a scheduled job lists users and roles for a manager to approve.
- Deploys: every production change goes through a pipeline that records who approved it.
- Logs: audit logs go to a store engineers cannot edit, with retention set in configuration.
- Restores: a scheduled restore test writes its result to a report.
Give each evidence job an owner and an alert when it fails to run. A missing month of access reviews is a finding, and nobody notices the gap until the auditor's sample lands on it.
How should access reviews work in an EHR?
Access reviews are where both frameworks most often find gaps, because people change roles faster than permissions change. In an EHR, two kinds of access need reviewing.
- Product access: clinicians, staff and customer administrators inside the EHR, usually reviewed by each customer for their own users.
- Platform access: your engineers and support staff with access to production systems and data, reviewed by your organization.
For platform access, list every person with production rights on a schedule, have their manager confirm each one, and remove anything not confirmed. Keep standing access small and grant extra access only for a set period, with a reason recorded. Support staff who need to view a customer's records should do so through a logged, time-limited process, not a permanent admin role.
How should audit logs be designed for both?
Design them to answer one question quickly: who did what to which record, when, and from where. The same log then serves a HIPAA investigation and a SOC 2 sample.
- Fields: user, role, patient or record id, action, time, source address and the screen or API that made the request.
- Coverage: reads as well as writes, including exports, prints and API calls by outside apps.
- Storage: a separate store with write-once settings, so no engineer or administrator can alter past entries.
- Review: a scheduled report of unusual patterns, such as one user opening many charts outside their site or schedule, with each review recorded.
Keep patient data out of the log text itself. Record the record id and the action, not the note content, so the log does not become a second copy of the chart.
Which vendors need the closest review?
The ones that can see patient data, including those that see it by accident. Cloud hosting and email delivery are obvious; error tracking, session replay and support chat tools are the ones teams forget.
- List every service the product calls or loads, and mark which ones could receive patient data in any form.
- For each marked vendor, confirm an agreement is in place before production use, and record who approved it.
- Scrub patient data from error reports and analytics events in code, rather than trusting each vendor's settings.
- Review the list when a developer adds a new library or service, as part of the change approval.
How do you prepare for a first SOC 2 audit?
Start with a readiness review of the control map against what the systems actually do today. The gaps it finds become engineering tickets, and fixing them before the audit period starts is far cheaper than explaining exceptions later.
Agree the scope with your auditor early: which systems, which trust services criteria and which period. Then let the evidence jobs run through that period unchanged, because an auditor tests that controls operated, not that they exist on paper.
What does an auditor ask an engineering team for?
Mostly samples. An auditor picks items from a period and asks you to show the control worked for each one.
- Changes: a sample of production deploys, each with its review and approval.
- Joiners and leavers: a sample of people who started or left, with access granted or removed in time.
- Incidents: the tickets for security events and how each was handled.
- Backups: evidence that backups ran and that a restore was tested.
- Vendors: the list of vendors with access to data and the reviews done on them.
If your systems already produce these records, an audit request becomes a query. If they do not, it becomes a long search through chat history and email.
What does HIPAA add that SOC 2 does not?
HIPAA is specific to health information. It adds business associate agreements, breach notification duties and patient rights, such as access to records. SOC 2 does not cover those by itself.
If your customers are covered entities, you will usually be their business associate, and the agreement will set obligations a SOC 2 report does not test.
What does SOC 2 add that HIPAA does not?
SOC 2 asks an independent auditor to test whether controls operated over a period of time. That outside testing is what many buyers want, because HIPAA has no equivalent report.
It also pushes on operational habits, such as onboarding and offboarding, policy acknowledgement and vendor reviews, that engineering teams sometimes leave undocumented.
Mistakes when teams run both
- Two control sets: one spreadsheet for HIPAA and another for SOC 2, drifting apart.
- Screenshot evidence: collected once a year instead of produced by the system.
- Shared admin accounts: no way to tie a production change to a person.
- Claims ahead of reality: marketing a report or certification the company does not hold.
What are best practices for EHR security under HIPAA and SOC 2?
Run one risk assessment, keep one control list mapped to both, automate the evidence, test restores, and review access on a schedule. Describe what you do in plain terms to customers, and only claim a report once you have one in hand.
How Agnotic can help
Agnotic builds the engineering controls behind HIPAA safeguards and SOC 2 readiness: access models, audit logging, deployment pipelines, encryption and restore testing. Your organization works with its own auditor for the SOC 2 report; Agnotic does not issue or hold one on your behalf.
Prepare for SOC 2 with Agnotic
Our SOC 2 readiness engineering covers the controls and evidence your auditor will test.
Related reading on Agnotic
Security layers, audit trails and the wider compliance picture.


