HIPAA Patient Data Sharing
This page walks through a complete HIPAA compliance policy for a healthcare AI agent — the policy, the tests, and the key learnings that make it work reliably with automated reasoning.
The Policy
curl -s -N -X POST https://api.icme.io/v1/makeRules \
-H 'Content-Type: application/json' \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"policy": "HIPAA Minimum Necessary PHI Disclosure Policy\n\nRule 1: Patient data may only be shared with a covered entity or business associate that has a signed BAA, or when a valid signed patient authorization covers the specific disclosure.\nRule 2: The purpose of the disclosure must be treatment, payment, or healthcare operations (TPO). Any other purpose — including research, marketing, or employment screening — must be rejected unless a valid patient authorization is on file.\nRule 3: The data shared must be limited to the minimum necessary to accomplish the stated purpose. Requests that include historical records, unrelated conditions, or fields beyond what the purpose requires must be rejected.\nRule 4: If the patient has filed an active restriction request that covers this recipient or purpose, the action must be rejected regardless of all other conditions.\nRule 5: If the recipient is a covered entity with a signed BAA, the purpose is TPO, the data is limited to the minimum necessary, and no active patient restriction applies — the disclosure is permitted."
}'Tests
✅ SAT — Authorized referral, current visit only, no restriction
curl -s -N -X POST https://api.icme.io/v1/checkIt \
-H 'Content-Type: application/json' \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"policy_id": "YOUR_POLICY_ID",
"action": "Share the patient'\''s current medication list and today'\''s visit notes with the referring cardiologist at Midwest Heart Associates, a covered entity with a signed BAA. The purpose is treatment — direct patient care coordination for a cardiology referral. Only the fields relevant to the referral are included. No restriction request is on file for this patient."
}'🚫 UNSAT — Employer requesting records, no BAA, non-TPO purpose
🚫 UNSAT — Research request, no authorization, active restriction, excess data
How to Write Action Strings
Why the Policy Is Structured This Way
Extending This Policy
Last updated

