{"id":"PQsvrw6hCv8","title":"What is a BAA? HIPAA, BAAs, and TEEs: Two Different Questions for AI Builders","description":"A BAA does not stop anyone from reading your users' health data. It decides who is legally on the hook when something goes wrong. Private inference answers a different question: who can technically see the bytes while a prompt is processed. If you're building anything that touches PHI, you need to know which one you actually need, and when you need both.\n\nIn this video I walk through what a business associate agreement covers (access, safeguards, breach reporting, retention, subcontractors), how it relates to HIPAA in the US and to processor terms under GDPR and CCPA, and where a TEE fits as defense in depth rather than a replacement for the contract. I also cover routing by data class instead of by feature, and why a conversation that ratchets up to a more secure lane should never ratchet back down.\n\nScope note: private inference protects the prompt while it's decrypted inside the enclave, with attestation you can verify and an operator who cannot read it. It says nothing about liability, retention terms, or what your vendor owes you contractually. A BAA covers the legal side and none of the technical side. Neither one is a substitute for the other.\n\nThis is not legal advice. Talk to a lawyer about the data your product handles. The fines for mishandling it are real.\n\nChapters\n0:00 What a BAA is and why it matters for AI routing\n0:14 Two questions: who can see the bytes, and who is liable\n0:54 What a BAA covers and who the business associate is\n1:57 What the contract actually says (access, safeguards, breach clocks)\n2:29 A BAA moves liability, it doesn't stop anyone reading data\n2:37 HIPAA in the US, and the GDPR and CCPA equivalents\n3:25 What private inference gives you technically\n3:52 How the two fit together, and when a BAA is overkill\n4:33 Route by data class, not by feature\n5:05 The ratchet: never step down in the same conversation\n5:21 Builder checklist\n6:19 Not legal advice\n6:36 Where to go next\n\nRelated videos: routing through code and architecture, and switching from OpenAI to private inference in one line.\n\nTimestamps are from the raw transcript; send edited cuts if you want them adjusted.","channel_name":"NEAR DevHub","published_at":"2026-09-16T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/PQsvrw6hCv8/hqdefault.jpg","transcript_text":"Hey folks, for this video I wanted to talk about something you may have heard of before, a BAA, which is a business associate agreement. And this is something a little bit different than private inference, but it all fits into the same idea of how you are actually routing data when you're dealing with AI. When it comes to a BAA, there's two different questions that need to be asked here. So part of it is who can see the bytes? And that's one part of it. It's answered by things like hardware encryption. And you know, I've done a video on TEEs, trusted execution environments, things like that, of who can actually get access to that information and how it's processed. The second part, which is where the BAA fits in, is who is on the hook? Who is liable? Who's legally responsible for this information? And what does that mean to be legally responsible as well? That's a really important part when we're building products that involve sensitive data. So, something to be aware of. So let's talk about like what a BAA actually is and what it covers. So typically a BAA is something that is for a clinic or the insurer or health plan that it needs to be covered or in this case like a particular app that you're building needs to be covered by the information that it's handling. So the business associate in the BAA part of it is the actual vendor that's going to touch that information. So that could be somebody like an AWS, Azure, Google Cloud, any other provider that's going to host the model that's going to process the protected health information. That's a really important piece here about this. It's a little bit different than again just normal inference because this deals with how that data is both handled, how it's destroyed, how it's uh any retention policies, uh things like that. And then if you have subcontractors that you're working with as well, that kind of falls under all of this. The contract, which is what a BAA really is, is just saying what the vendor is going to do with PHI, protected health information. So it means like again, how is it going to be able to view it, who can actually access it, nothing beyond that, what safeguards the vendor owes. So if your vendor is AWS or Azure, um, you know, what do they have in place for that? So usually it's their security policies, things like that. How they handle breach reporting. Uh when does that clock start if something happens? Uh then obviously again if subcontractors how that works as well and for you as a builder what this really means is that the BAA kind of moves liability. It doesn't stop anyone from reading data. So it's not a data protection measure. It's a liability measure. So that's a really important piece to understand here when working with this. A BAA is typically for health data because really what it's about is management from HIPAA in the United States. Uh if you're building in a different country, you're going to have some different laws. So I would always suggest talk to a lawyer to understand all of that. But I'm using this as the example as I am in the US to use to clarify that. But this is again about if you are the covered entity or you're building for one, you need to have this and again it's related to HIPAA and HIPAA recognizes this properly as the way to handle this data. But you see very similar things in like with like GDPR or CCPA of like what are those service contractor uh provider terms, you know, who's the processor, things like that. Um and again, it's all just about liability being spread out. It's important to go back and think about like what does private inference actually give you. So private inference is simply about having encryption in use uh during the prompt processing. So the prompt is decrypted inside an enclave and the memory is sealed from the host and operator and so nobody can see what's happening in that thing. You have attestations, you have things that are verifiable uh and the operator themselves cannot read it. So there is that protection. This is a technical measure to provide privacy to that data. Here's kind of how this looks. Uh again you have your contract provider who's providing the BAA. You have private inference in another bucket and then you hopefully have something that maybe fits into both if you need it. If you don't need it, a BAA is overkill. Um, if you're not building with something that actually requires that kind of liability, then you don't necessarily need it. Private inference is more than enough. Um, but again, speak to a lawyer about any product you're building. It's important that they review how that data is being handled because uh there are some really big fines and penalties that can come along with mishandled data. One of the other things I've talked about in other videos is routing by the data itself and not by the feature. Uh if I'm dealing with health data, the examples I've shown in previous videos that I want to try to keep as much on device as possible. I want to be able to answer some questions locally so I don't have to send data anywhere. If I do have to send data off device, I want to make sure I know where it's being sent and why. So whether it needs to go to a protected which is that BAA provider or it needs to go to just at least something that is private using private inference or using uh anonymized queries things like that. I want to be able to know where that goes. Uh quick tip here is that again you always if you're using some kind of conversation once you ratchet up and so you go to a more secure version you never want to go down in the same conversation. That's a great way to leak data accidentally. So something to be aware of when you're building out stuff. The builder checklist is really straightforward. Um figure out who is the governing body of the data that you're processing and kind of what they expect out of there. Classify the data first. Always always understand what data is being handled and how it's being handled, where it's going to go. Uh you should always in any kind of building have some kind of classifier and then send off to different AI systems from there. If one of these regimes applies, uh, make sure that every vendor that is touching it is actually compliant with that. Again, a TEE is defense in depth. It goes on top of that if you need that agreement. It is not a standalone in for that agreement. That agreement is still there for legal uh representation. And then if you don't need any of that, you don't need a BAA in any form or something like that, uh, private inference is always going to be the strongest technical story here. Um, and we're starting to see that more and more companies are using this and so that's a great place to go. Uh, I'll reiterate again, this is not legal advice. Uh, please confirm any of this stuff with a lawyer, but just know that there's two different parts here. There's the technical piece which is handled by the hardware and attestation, but this like a BAA is about legal and who is actually, you know, liable for that data and what happens with that data. If you want to know where to go next, if you haven't already seen the videos I put together on routing both through code and through just architecture, I would suggest checking those out. Also, there's a video on how to change your APIs from like OpenAI to private inference uh in one line if that's something that you're interested in doing as well. Thanks for checking this out.","transcript_synced_at":"2026-11-03T03:46:59.474Z","segments":[{"start_seconds":0,"text":"Hey folks, for this video I wanted to talk about something you may have heard of before, a BAA, which is a business associate agreement. And this is","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=0s"},{"start_seconds":7,"text":"something a little bit different than private inference, but it all fits into the same idea of how you are actually routing data when you're dealing with","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=7s"},{"start_seconds":14,"text":"AI. When it comes to a BAA, there's two different questions that need to be asked here. So part of it is who can see the bytes? And that's one part of it.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=14s"},{"start_seconds":24,"text":"It's answered by things like hardware encryption. And you know, I've done a video on TEEs, trusted execution environments, things like that, of who","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=24s"},{"start_seconds":33,"text":"can actually get access to that information and how it's processed. The second part, which is where the BAA fits in, is who is on the hook? Who is","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=33s"},{"start_seconds":41,"text":"liable? Who's legally responsible for this information? And what does that mean to be legally responsible as well?","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=41s"},{"start_seconds":48,"text":"That's a really important part when we're building products that involve sensitive data. So, something to be aware of. So let's talk about like what","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=48s"},{"start_seconds":54,"text":"a BAA actually is and what it covers. So typically a BAA is something that is for","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=54s"},{"start_seconds":63,"text":"a clinic or the insurer or health plan that it needs to be covered or in this case like a particular app that you're","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=63s"},{"start_seconds":71,"text":"building needs to be covered by the information that it's handling. So the business associate in the BAA part of it","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=71s"},{"start_seconds":78,"text":"is the actual vendor that's going to touch that information. So that could be somebody like an AWS, Azure, Google","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=78s"},{"start_seconds":86,"text":"Cloud, any other provider that's going to host the model that's going to process the protected health information.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=86s"},{"start_seconds":93,"text":"That's a really important piece here about this. It's a little bit different than again just normal inference because this deals with how that data is both","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=93s"},{"start_seconds":101,"text":"handled, how it's destroyed, how it's uh any retention policies, uh things like that. And then if you have","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=101s"},{"start_seconds":109,"text":"subcontractors that you're working with as well, that kind of falls under all of this. The contract, which is what a BAA really is, is just saying what","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=109s"},{"start_seconds":117,"text":"the vendor is going to do with PHI, protected health information. So it means like again, how is it going to be able to view it, who can actually access it,","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=117s"},{"start_seconds":124,"text":"nothing beyond that, what safeguards the vendor owes. So if your vendor is AWS or Azure, um, you know, what do they have","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=124s"},{"start_seconds":133,"text":"in place for that? So usually it's their security policies, things like that. How they handle breach reporting. Uh when does that clock start if something","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=133s"},{"start_seconds":141,"text":"happens? Uh then obviously again if subcontractors how that works as well and for you as a builder what this really means is that the BAA kind of","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=141s"},{"start_seconds":149,"text":"moves liability. It doesn't stop anyone from reading data. So it's not a data protection measure. It's a liability measure. So that's a really important","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=149s"},{"start_seconds":157,"text":"piece to understand here when working with this. A BAA is typically for health data because really what it's about is management from HIPAA in the United","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=157s"},{"start_seconds":164,"text":"States. Uh if you're building in a different country, you're going to have some different laws. So I would always suggest talk to a lawyer to understand all of that. But I'm using this as the","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=164s"},{"start_seconds":172,"text":"example as I am in the US to use to clarify that. But this is again about if you are the covered entity or you're","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=172s"},{"start_seconds":180,"text":"building for one, you need to have this and again it's related to HIPAA and HIPAA recognizes this properly as the","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=180s"},{"start_seconds":188,"text":"way to handle this data. But you see very similar things in like with like GDPR or CCPA of like what are those","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=188s"},{"start_seconds":195,"text":"service contractor uh provider terms, you know, who's the processor, things like that. Um and again, it's all just about liability being spread out.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=195s"},{"start_seconds":205,"text":"It's important to go back and think about like what does private inference actually give you. So private inference is simply about having encryption in use uh during the prompt processing.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=205s"},{"start_seconds":216,"text":"So the prompt is decrypted inside an enclave and the memory is sealed from the host and operator and so nobody can see what's happening in that thing.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=216s"},{"start_seconds":225,"text":"You have attestations, you have things that are verifiable uh and the operator themselves cannot read it. So there is that protection.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=225s"},{"start_seconds":232,"text":"This is a technical measure to provide privacy to that data. Here's kind of how this looks. Uh again you have your","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=232s"},{"start_seconds":240,"text":"contract provider who's providing the BAA. You have private inference in another bucket and then you hopefully have something that maybe fits into both","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=240s"},{"start_seconds":248,"text":"if you need it. If you don't need it, a BAA is overkill. Um, if you're not building with something that actually requires that kind of liability, then you don't necessarily","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=248s"},{"start_seconds":257,"text":"need it. Private inference is more than enough. Um, but again, speak to a lawyer about any product you're building. It's important that they review how that data","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=257s"},{"start_seconds":265,"text":"is being handled because uh there are some really big fines and penalties that can come along with mishandled data. One of the other things I've talked about in","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=265s"},{"start_seconds":273,"text":"other videos is routing by the data itself and not by the feature. Uh if I'm dealing with health data, the examples I've shown in previous videos that I","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=273s"},{"start_seconds":281,"text":"want to try to keep as much on device as possible. I want to be able to answer some questions locally so I don't have to send data anywhere. If I do have to","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=281s"},{"start_seconds":289,"text":"send data off device, I want to make sure I know where it's being sent and why. So whether it needs to go to a protected which is that BAA provider or","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=289s"},{"start_seconds":297,"text":"it needs to go to just at least something that is private using private inference or using uh anonymized queries","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=297s"},{"start_seconds":305,"text":"things like that. I want to be able to know where that goes. Uh quick tip here is that again you always if you're using some kind of conversation once you","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=305s"},{"start_seconds":313,"text":"ratchet up and so you go to a more secure version you never want to go down in the same conversation. That's a great","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=313s"},{"start_seconds":321,"text":"way to leak data accidentally. So something to be aware of when you're building out stuff. The builder checklist is really straightforward. Um figure out who is the governing body of the data that you're processing and kind of what they expect out of there.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=321s"},{"start_seconds":334,"text":"Classify the data first. Always always understand what data is being handled and how it's being handled, where it's going to go. Uh you should always in any","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=334s"},{"start_seconds":342,"text":"kind of building have some kind of classifier and then send off to different AI systems from there. If one of these regimes applies, uh, make","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=342s"},{"start_seconds":350,"text":"sure that every vendor that is touching it is actually compliant with that.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=350s"},{"start_seconds":355,"text":"Again, a TEE is defense in depth. It goes on top of that if you need that agreement. It is not a standalone in for","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=355s"},{"start_seconds":362,"text":"that agreement. That agreement is still there for legal uh representation. And then if you don't need any of that, you don't need a BAA in any form or","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=362s"},{"start_seconds":371,"text":"something like that, uh, private inference is always going to be the strongest technical story here. Um, and we're starting to see that more and more companies are using this and so that's a","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=371s"},{"start_seconds":379,"text":"great place to go. Uh, I'll reiterate again, this is not legal advice. Uh, please confirm any of this stuff with a lawyer, but just know that there's","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=379s"},{"start_seconds":388,"text":"two different parts here. There's the technical piece which is handled by the hardware and attestation, but this like a BAA is about legal and who is","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=388s"},{"start_seconds":396,"text":"actually, you know, liable for that data and what happens with that data. If you want to know where to go next, if you haven't already seen the videos","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=396s"},{"start_seconds":404,"text":"I put together on routing both through code and through just architecture, I would suggest checking those out. Also,","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=404s"},{"start_seconds":411,"text":"there's a video on how to change your APIs from like OpenAI to private inference uh in one line if that's","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=411s"},{"start_seconds":419,"text":"something that you're interested in doing as well. Thanks for checking this out.","url":"https://www.youtube.com/watch?v=PQsvrw6hCv8&t=419s"}],"youtube_url":"https://youtube.com/watch?v=PQsvrw6hCv8","url":"https://near-pedia.xyz/videos/PQsvrw6hCv8"}