Direct answer: Claude Code and OpenAI’s Codex can be used in a HIPAA-eligible way — but only under specific enterprise-tier configurations with an executed Business Associate Agreement (BAA), never on their default consumer plans, and never for the local machine or third-party tools the agent touches along the way.

  • Both Anthropic and OpenAI now publish official HIPAA/BAA configuration guidance for their coding agents — Anthropic’s Business Associate Agreements documentation for Claude Enterprise and the Claude Developer Platform, and OpenAI’s HIPAA Eligible Products and Functionality guide covering Codex Local.
  • Claude Code is only covered under Anthropic’s BAA when Zero Data Retention (ZDR) is active on a qualifying Claude Enterprise or Developer Platform account with an executed BAA in place.
  • Codex Local (the CLI, IDE, and desktop client) is HIPAA-eligible only when signed into a HIPAA-eligible ChatGPT account — ChatGPT Enterprise with Regulated Workspace, ChatGPT for Healthcare — or when using a customer-provided API key on an account provisioned with Modified Retention and a signed BAA.
  • Neither vendor’s BAA covers what happens on your own machine. OpenAI states this explicitly: the BAA “does not apply to the execution of the Codex Local Client on Customer’s client machines or to any Third-Party Services accessed by the Codex Local Client.”
  • Free and default consumer tiers of both tools — Claude Free/Pro/Max, ChatGPT Free/Plus/Team without Enterprise — are not BAA-covered, and coding sessions may be used to improve the underlying models unless you opt out or use a privacy mode.
  • A BAA with your AI coding agent does not make your finished application HIPAA compliant. The agent writes code; a separate, properly configured hosting environment is what actually protects PHI once the app is live.

Ready to move your AI-coded app to a compliant home?
Book a Free 15-Minute Consultation →

How Claude Code and Codex Compare on HIPAA Eligibility

🔄 Rotate your phone for a better view of the comparison table.
Claude Code (Anthropic) Codex (OpenAI)
BAA available Yes — Claude Enterprise / Claude Developer Platform, reviewed case-by-case Yes — ChatGPT Enterprise (Regulated Workspace), ChatGPT for Healthcare, or API with Modified Retention
Condition for BAA to apply Zero Data Retention (ZDR) must be active on the account Account must be signed into a HIPAA-eligible ChatGPT tier, or the API key's org must be provisioned with Modified Retention
Free/consumer tier covered? No — Free, Pro, and Max plans are excluded No — Free, Plus, and standard Team plans are excluded
Local workstation covered by BAA? Not explicitly addressed in Anthropic's public documentation as of this writing — treat it as your responsibility No — OpenAI states this in writing; execution on the customer's machine falls outside the BAA
Third-party tools / MCP servers the agent calls Outside BAA scope Outside BAA scope
Default use of sessions for model training Yes, unless you opt out or use Incognito/ZDR Governed by the account's retention settings; default consumer use is not protected

Both companies updated their compliance posture on this within the past year, and both note that requirements have shifted more than once as agentic coding tools matured. Don’t rely on a screenshot from six months ago — check the current guide before you put real PHI anywhere near either tool.

What Gil Vidals Says

In a live session specifically on vibe coding, Gil Vidals walked through exactly this scenario — a founder hitting an error, and reaching for an AI coding agent to debug it with real patient data still in the prompt:

“If you’re a provider and you’re working on your application and you’re experiencing a problem and you say, ‘Wow, well whenever I put Jane Doe’s name in with her phone number and her social security number, my application crashes. Why is that?’ … you might feel tempted to copy and paste all that — copy and paste Jane Doe’s information, copy and paste the error, throw that into something like Claude and say, ‘Hey, how come this is crashing my application?’ Well, as soon as you’ve taken that PHI and you’ve brought it over to Claude, they have that information logged now and they will train their next generation model on that… unless you have a very expensive plan with Claude or OpenAI where they have signed a BAA and they have zero retention policies, you need to be really careful on what you’re putting into that prompt box.”

That lines up exactly with what both vendors now document: coverage exists, but only on specific enterprise tiers with the right retention settings active — not by default. Gil made the same point another way, on the broader question of whether HIPAA compliance is ever really “done”:

“The HIPAA compliance world is not a one and done. You don’t just hit a button and you’re done. It’s a continual process.”

A BAA with Anthropic or OpenAI addresses one layer — how your prompts and coding sessions are handled by the vendor. It says nothing about where the resulting application lives once you ship it.

Using Claude Code or Codex to Build a Healthcare App: What to Actually Do

  1. Confirm your tier before you type a single PHI-related prompt. Are you on Claude Enterprise or the Developer Platform with ZDR active? Are you signed into ChatGPT Enterprise, ChatGPT for Healthcare, or an API account with Modified Retention? If not, don’t paste real patient data into the agent — full stop.
  2. Get the BAA executed first, not after you’ve already used the tool. Both vendors require the agreement to be in place before PHI processing is covered; retroactive coverage isn’t how a BAA works.
  3. Separate “the agent is covered” from “my app is compliant.” Even with a fully executed BAA on Claude Code or Codex, the application it generates still needs to run somewhere HIPAA compliant — that’s a distinct decision, and it’s the one most vibe coders skip.
  4. Lock down the local workstation. Since neither vendor’s BAA extends to your own machine, encryption at rest, access controls, and standard endpoint security on the device running the agent are on you.
  5. Audit every third-party tool and MCP server the agent can reach. Coding agents increasingly call out to other services mid-session. Each of those integrations sits outside the BAA unless you’ve separately vetted it.
  6. Re-check the vendor’s HIPAA documentation before every major project, not just once. Both companies have revised these terms multiple times in the last year as agentic tools evolved.

Your AI Prototype Works. Is It Ready for Healthcare?

HIPAA Vault reviews your architecture, addresses compliance gaps, and deploys your application into secure, managed infrastructure.

Book a Free 15-Minute Consultation

From Agent to Production: Where HIPAA Vault Fits

Getting a BAA in place with Anthropic or OpenAI solves the prompt-handling question. It doesn’t solve where your finished, PHI-handling application actually runs. That’s a separate infrastructure decision — one that needs a signed BAA of its own, isolated architecture, encryption, monitoring, and ongoing patching, exactly as Gil Vidals describes above.

Built something with Claude Code or Codex that needs a compliant home? HIPAA Vault can review your architecture, scope out exactly what needs to change, and deploy it to a BAA-covered production environment

Book a Free 15-Minute Consultation →

Questions to Ask Before You Put PHI Near a Coding Agent

  • Is my account actually provisioned with Zero Data Retention (Claude) or Modified Retention (OpenAI API), or am I assuming it is?
  • Has the BAA been fully executed, or is it “in progress” — and am I treating those as the same thing?
  • Who is responsible for securing the workstation or IDE the agent runs on — has anyone actually done that?
  • What third-party tools, plugins, or MCP servers can this agent call, and have any of them been vetted for PHI exposure?
  • Once the code is written, where is it actually going to be hosted — and does that host sign a BAA?

FAQ


For informational purposes only, not legal advice — consult qualified counsel before processing PHI with any AI coding tool. Reflects Anthropic’s and OpenAI’s published documentation as of the publish date and the perspective of Gil Vidals, CTO and Co-Founder of HIPAA Vault.