Safeguard
Compliance•

Which dependencies need a BAA: hosted services or libraries?

A library running in your own environment differs from a hosted service that receives PHI. Learn to sort your dependencies before a hospital asks.

Safeguard Security Team
4 min read

Sort by one question: does a separate party create, receive, maintain or transmit electronic protected health information for you? A hosted API or cloud service that does is a subcontractor question. A library that runs only inside your own environment is code you operate. Confirm edge cases with counsel, since this is not legal advice.

The rule text behind the question

For business associates, the Security Rule says contracts must ensure that any subcontractors that create, receive, maintain or transmit electronic protected health information agree to comply with the applicable requirements (45 CFR 164.314(a)(2)(iii) applies the same terms to subcontractor contracts). So the practical test is about who touches the data, not about whether something is a "dependency" in a package file.

Three kinds of dependency

KindExample shapeTouches PHI outside your environment?Typical handling
Library or packageA parser, a UI kit, an ORMNo, runs in your processVulnerability and license management
Hosted service called by your codeEmail, SMS, logging, error tracking, transcriptionYes, if PHI is sentContract review, BAA if it holds PHI
InfrastructureCloud hosting, managed database, backupsYesContract review, BAA, configuration

The middle row is where teams get surprised. A library is harmless to the BAA question until it quietly sends data somewhere. Analytics SDKs, crash reporters and "telemetry" options are common examples.

How to build the map

  1. List every outbound destination your application contacts in production. Network egress logs and your SBOM together will show most of them.
  2. For each destination, ask what data can reach it. Check payloads and log lines, not just feature descriptions.
  3. Mark any destination that can receive PHI, including by accident in an error message.
  4. For each marked destination, find the agreement on file and note the date.
  5. For libraries that call out by default, check whether the call can be turned off and whether it is off.

Step 3 deserves care. If PHI can only reach a vendor through a mistake, the right fix is usually to stop the leak and also to ask whether the agreement should exist anyway.

What to tell a hospital reviewer

A reviewer wants a short list: the hosted services in your PHI path, the agreement in place for each, and a statement about libraries. You can say that libraries run inside your environment and are managed through your vulnerability process, and that you review any component that sends data off host before approval.

Try it yourself

Click through it at your own pace, or open it full screen. Use it to see how a full component list is produced, then compare it with your egress list to spot packages that talk to outside services.

Safeguard's SBOM and dependency scanning can supply the component side of that comparison. The mapping of which services may receive PHI, and whether an agreement is needed, is a decision for your compliance owner and counsel.

Quick check

Does an open source library need a BAA?

A library you run in your own environment is not a separate party receiving data, so the BAA question normally does not arise. The question changes if the library sends data to a service.

What if our error tracker captured PHI once?

Treat it as a data handling issue first: stop the leak, scrub what you can, and involve your compliance owner on whether the agreement and any notification duties apply.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.