← Back to Security & Compliance
SEC-013 Security & Compliance 22 min read For: Healthcare CTOs & Compliance Officers

HIPAA Compliance on Salesforce: The Healthcare Leader's Guide

Configuring Salesforce to protect Protected Health Information (PHI) under US federal guidelines, and auditing Business Associate Agreements.

VS

Vishal Sharma

Salesforce Architecture Specialist · Updated May 2026

What you will learn in this tutorial
  • Demystify the legal frameworks of HIPAA and the HITECH Act within a multi-tenant cloud context.
  • Define the limits and mutual obligations established by the Salesforce Business Associate Agreement (BAA).
  • Implement Shield Platform Encryption using deterministic and probabilistic cryptographic strategies for PHI.
  • Build Real-Time Event Monitoring transaction policies to detect and block unauthorised clinical data exports.
  • Configure Field Audit Trail (FAT) to establish a compliant, immutable forensic change log for up to ten years.
  • Harden external-facing Experience Cloud patient portals against access-control and data-exposure vulnerabilities.

1. HIPAA and HITECH on Salesforce: Regulatory Foundations and BAA Boundaries

For healthcare organisations operating in the United States, compliance with the Health Insurance Portability and Accountability Act (HIPAA) and the Health Information Technology for Economic and Clinical Health (HITECH) Act is a legal imperative. These regulations dictate how Protected Health Information (PHI) must be stored, processed, and transmitted. Failure to comply can result in severe financial penalties, reputational damage, and loss of clinical trust.

Salesforce is fully capable of hosting HIPAA-compliant applications, but doing so requires strict adherence to administrative, physical, and technical safeguards. The foundational step for any healthcare organisation deploying Salesforce is signing a Business Associate Agreement (BAA) with Salesforce. This agreement establishes a legally binding contract that defines each party's regulatory obligations regarding the protection of sensitive medical data.

The BAA is a legal contract that establishes Salesforce as a "business associate" of your healthcare organisation (the "covered entity"). By signing the BAA, Salesforce guarantees that its infrastructure meets the physical security and data integrity requirements of HIPAA. However, signing the BAA does not make your Salesforce implementation instantly compliant. It merely creates the legal framework under which you must configure the platform's security controls to protect PHI. Healthcare leaders must understand that compliance is an active, ongoing operational configuration process rather than a static procurement checkbox.

2. The Salesforce Shared Responsibility Model for Protected Health Information (PHI)

The cornerstone of cloud compliance is the Shared Responsibility Model. Under this framework, Salesforce guarantees the physical security of the data centres, hypervisor isolation, and the core platform infrastructure. Your organisation is responsible for how the platform is configured, who is granted access to the data, and how clinical processes are operationalised. This division of duties ensures that both the platform provider and the customer collaborate to maintain compliance.

For instance, if a system administrator accidentally opens up sharing settings on the Patient object so that all external guest users can read patient medical records, this is a breach of HIPAA caused by the customer's configuration, not Salesforce's infrastructure. To maintain compliance, healthcare organisations must map their business processes to the technical controls provided by Salesforce. This involves classifying fields containing PHI, configuring restrictive role hierarchies, enforcing multi-factor authentication (MFA), and regularly auditing access logs.

Establishing a comprehensive data classification scheme is a vital first step. Within Salesforce, fields should be tagged with metadata indicating their sensitivity (e.g., classifying a Field Usage as 'Active' and Data Sensitivity as 'Confidential' or 'PHI'). This structured labelling allows architects to apply targeted access controls, encryption, and monitoring rules to fields containing social security numbers, medical histories, or treatment plans. Regular reviews of this data mapping ensure that new custom fields are automatically captured within the organisation's security posture.

3. Architecting Shield Platform Encryption for Healthcare Data

Under HIPAA, data must be encrypted both in transit and at rest. Salesforce encrypts all data in transit using TLS 1.2 or higher. To encrypt data at rest, healthcare organisations must utilise Salesforce Shield Platform Encryption. This advanced security feature allows customers to encrypt sensitive fields, files, and attachments at the database level while preserving core platform functionalities like search, reports, and workflows.

Unlike standard classic encryption, which only masks fields on the user interface, Shield Platform Encryption encrypts the data at the database level. When architecting Shield Platform Encryption, architects must select between two primary encryption strategies: 1. Probabilistic Encryption: This method uses a unique initialisation vector for every record, meaning the same text will encrypt to different ciphertext each time. While highly secure, it blocks indexing, searching, and filtering on the encrypted fields. 2. Deterministic Encryption: This method generates static ciphertext for a given plaintext, allowing developers to run SOQL queries, execute search indexes, and use the fields in reports.

For PHI, deterministic encryption is widely preferred for key identifiers (like Medical Record Numbers or National Insurance Numbers) because it allows clinical coordinators to search for patients without exposing the data to unauthorised users. Let us see an Apex pattern that handles encrypted fields dynamically and securely:

public class PatientDataService {
    public Patient__c findPatientByMRN(String mrn) {
        // Enforcing deterministic search query on encrypted field in user mode
        List patients = [
            SELECT Id, First_Name__c, Last_Name__c, Medical_Record_Number__c, Medical_History__c 
            FROM Patient__c 
            WHERE Medical_Record_Number__c = :mrn
            WITH USER_MODE
        ];
        return patients.isEmpty() ? null : patients[0];
    }
}

Key Lifecycle Management is another critical aspect. Healthcare leaders must define policies for generating, rotating, and destroying tenant encryption keys. Under HIPAA, keys should be rotated at least annually, and older keys must be archived securely to allow decryption of legacy backups. Standardising these cryptographic procedures ensures that the organisation is prepared for compliance audits and can rapidly respond to potential key compromise scenarios.

4. Forensic Auditing with Field Audit Trail and Real-Time Event Monitoring

HIPAA requires covered entities to maintain detailed logs of who accessed clinical records and what modifications were made. The standard Salesforce history tracking only retains field changes for 18 months. To meet the rigorous auditing requirements of HIPAA (which often require up to 6 or even 10 years of audit history), organisations must implement Shield Field Audit Trail (FAT).

FAT allows you to define custom metadata policies to retain history data for up to 10 years, archiving it to cold storage while keeping it queryable via the API. This provides a reliable, immutable forensic audit trail of all changes made to patient data. Healthcare organisations can use this historical record to demonstrate compliance during regulatory audits or internal investigations.

In addition to tracking changes, healthcare organisations must monitor read access. If a user exports a report containing 10,000 patient records, this represents a massive security risk. Real-Time Event Monitoring allows you to construct transaction security policies that evaluate user behaviour in real time. If a user attempts to export data outside of normal working hours, or exceeds a specific record threshold, the policy can block the export, send an alert to the security team, or force a multi-factor challenge. Here is a conceptual Apex Transaction Security policy that checks for suspicious clinical data access:

global class PatientDataExportControl implements TxnSecurity.EventCondition {
    public boolean evaluate(SObject event) {
        switch on event {
            when ReportEvent reportEvt {
                // If user attempts to export more than 200 patient records, trigger block
                if (reportEvt.Operation == 'Export' && reportEvt.RowsProcessed > 200) {
                    return true; // Block or challenge user
                }
            }
        }
        return false;
    }
}

Optimising these policies is critical to avoid disrupting clinical workflows. By customising parameters based on roles, locations, and time-windows, organisations can establish a secure environment that protects PHI without hindering the delivery of patient care.

5. Access Control and Hardening Portal Architectures for Patients

Modern healthcare organisations leverage Experience Cloud (formerly Communities) to build portals where patients can view medical records, message doctors, and schedule appointments. Portals represent a significant compliance risk because they expose your Salesforce org to external networks, making them a prime target for malicious actors.

Architects must enforce strict data segregation in these portals. The primary rule is that guest users (unauthenticated visitors) must never have read or write access to PHI. Guest user sharing rules must be checked and locked down. For authenticated patients, access must be governed using User-Share mappings. High-Volume Customer Portal licences or Customer Community Plus licences should be configured with sharing sets or sharing groups that dynamically grant access only to records linked directly to the patient's Contact record.

Furthermore, any APEX controllers backing these portals must enforce strict object-level and field-level security checks using WITH USER_MODE or programmatic schema validation to prevent privilege escalation or IDOR vulnerabilities. Regular penetration testing and vulnerability assessments of the portal interface should be conducted to ensure that external access vectors remain secure. Customising error messages to avoid disclosing system architecture and limiting API request rates are additional best practices for hardening patient portals against cyber threats.

Key Takeaways

  • HIPAA compliance on Salesforce is a shared responsibility; the BAA covers infrastructure security, while you must secure your custom configuration.
  • Shield Platform Encryption encrypts PHI at rest, and deterministic encryption should be utilised on fields requiring search, reports, or indexing.
  • Key lifecycle management policies must be defined, including annual rotation of tenant encryption keys and secure archiving of legacy keys.
  • Shield Field Audit Trail must be configured to retain history tracking data for up to ten years to comply with healthcare auditing regulations.
  • Real-Time Event Monitoring transaction security policies should be deployed to detect, block, or challenge suspicious patient report exports.
  • Experience Cloud patient portals must be hardened by enforcing strict sharing sets, disabling guest user PHI access, and validating all Apex inputs.

Checkpoint: Test Your Understanding

What does signing a Business Associate Agreement (BAA) with Salesforce guarantee?

A. That the customer's custom apex code is automatically secured and compliant
B. That the physical and infrastructure layer of Salesforce meets HIPAA security standards
C. That patient medical record fields are automatically encrypted with Shield Platform Encryption
D. That Salesforce assumes all legal liability for any data breach or configuration exploit

Which encryption type should be used under Shield Platform Encryption for a Field like a Patient ID that users need to search for?

A. Probabilistic Encryption
B. Classic Masked Encryption
C. Deterministic Encryption
D. Standard Transport Layer Security

How can an architect prevent a standard call-centre agent from exporting massive volumes of patient data using event logs?

A. By disabling the API access checkbox on all standard user profiles
B. By writing a Real-Time Event Monitoring transaction security policy that evaluates ReportEvent parameters
C. By customising the Role Hierarchy to place agents at the absolute bottom of the organization tree
D. By configuring classic field history tracking to log data exports

Discussion & Feedback