Skip to main content
The Health Insurance Portability and Accountability Act (HIPAA) protects medical information in the United States. Any AI application that processes Protected Health Information (PHI) must comply with HIPAA’s Privacy and Security Rules. Blindfold helps by tokenizing PHI in the US region before it reaches any AI provider. The LLM only sees anonymized tokens — never real patient names, SSNs, or medical records.

Who Must Comply

Covered Entities

Healthcare providers, health plans, and healthcare clearinghouses that transmit health information electronically.

Business Associates

Any organization that creates, receives, maintains, or transmits PHI on behalf of a covered entity — including AI/software vendors.
If your AI application processes patient data for a healthcare organization, HIPAA likely applies to you.

The 18 HIPAA Identifiers

HIPAA’s Safe Harbor method (45 CFR § 164.514(b)(2)) requires removal of 18 types of identifiers for de-identification. Blindfold’s hipaa_us policy covers them:
#IdentifierBlindfold Entity TypeCovered
1NamesPerson
2Geographic subdivisions (smaller than state)Address
3Dates (except year) related to individualDate of Birth
4Phone numbersPhone Number
5Fax numbersPhone Number
6Email addressesEmail Address
7Social Security NumbersSocial Security Number
8Medical Record NumbersMedical Record Number
9Health plan beneficiary numbersHealth Insurance ID Number
10Account numbersBank Account Number
11Certificate/license numbersLicense Number
12Vehicle identifiersVehicle ID
13Device identifiersDevice ID
14Web URLsURL
15IP addressesIP Address
16Biometric identifiersBiometric Data
17Full-face photographsN/A (text-only API)
18Any other unique identifying numberCustom entities

How Blindfold Helps

Minimum Necessary Rule

HIPAA requires that only the minimum necessary PHI is used for any given purpose. With Blindfold:
Patient Data                     Blindfold US Region              AI Provider
"Patient Sarah Johnson,          "<Person_1>,                     AI sees only
 SSN 123-45-6789,         →      <Social Security Number_1>,  →  anonymized tokens
 MRN P-4532..."                   <Medical Record Number_1>..."



"Patient Sarah Johnson    ←     Detokenize with mapping    ←    "Patient <Person_1>
 is a 47-year-old..."           (PHI stays in US)                is a 47-year-old..."

Safe Harbor De-Identification

Blindfold’s tokenization satisfies the Safe Harbor method by removing all 18 identifier types. The tokenized output is considered de-identified data under HIPAA, which is no longer subject to the Privacy Rule.

US Region + hipaa_us Policy

Region Selection

Use the US region to ensure PHI is processed on US-based servers:
from blindfold import Blindfold

client = Blindfold(
    api_key="your-api-key",
    region="us",  # PHI processed in the US
)

What hipaa_us Detects

Entity TypeExamples
PersonSarah Johnson, Dr. Emily Chen
Social Security Number123-45-6789
Medical Record NumberP-4532, MRN-78901
Health Insurance ID NumberBC-9876543
Date of Birth03/15/1978
Email Addresssarah.johnson@email.com
Phone Number(555) 234-5678
Address123 Oak Street, Springfield
Medical Conditionchest pain, diabetes, hypertension
Medicationmetformin, lisinopril
Insurance CompanyBlueCross, Aetna

Code Examples

Tokenize a Patient Record

from blindfold import Blindfold
from openai import OpenAI

blindfold = Blindfold(api_key="your-key", region="us")
openai_client = OpenAI(api_key="your-openai-key")

patient_message = (
    "Patient Sarah Johnson (DOB 03/15/1978, SSN 123-45-6789, "
    "MRN P-4532) presented with chest pain. "
    "Contact: sarah.johnson@email.com, phone (555) 234-5678."
)

# Step 1: Tokenize PHI
tokenized = blindfold.tokenize(patient_message, policy="hipaa_us")

print(f"PHI detected: {tokenized.entities_count} identifiers")
for entity in tokenized.detected_entities:
    print(f"  [{entity.type}] {entity.text}")

# Step 2: Send to OpenAI — only anonymized tokens
completion = openai_client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {"role": "system", "content": "You are a healthcare records assistant."},
        {"role": "user", "content": tokenized.text},
    ],
)

# Step 3: Restore PHI in the response
restored = blindfold.detokenize(
    completion.choices[0].message.content,
    tokenized.mapping,
)
print(restored.text)

Multi-Turn PHI-Safe Conversation

Maintain PHI mappings across a multi-turn healthcare chat:
class HealthcareChatbot:
    def __init__(self):
        self.blindfold = Blindfold(api_key="your-key", region="us")
        self.openai = OpenAI(api_key="your-openai-key")
        self.conversation = [
            {"role": "system", "content": "You are a healthcare assistant."}
        ]
        self.mapping = {}  # Accumulated across turns

    def chat(self, user_message: str) -> str:
        # Tokenize new message
        tokenized = self.blindfold.tokenize(user_message, policy="hipaa_us")

        # Merge new mappings into conversation-wide mapping
        self.mapping.update(tokenized.mapping)

        # Add tokenized message to conversation
        self.conversation.append({"role": "user", "content": tokenized.text})

        # Send to AI — only tokens
        completion = self.openai.chat.completions.create(
            model="gpt-4o-mini",
            messages=self.conversation,
        )
        ai_response = completion.choices[0].message.content
        self.conversation.append({"role": "assistant", "content": ai_response})

        # Restore PHI for display
        restored = self.blindfold.detokenize(ai_response, self.mapping)
        return restored.text

Batch PHI Redaction

Permanently remove PHI from multiple records for safe storage or logging:
records = [
    "Patient: Robert Lee, SSN 111-22-3333, admitted for knee surgery.",
    "Patient: Maria Santos, DOB 11/05/1990, MRN P-2468. Allergy to penicillin.",
    "Patient: David Kim, SSN 444-55-6666, referred by Dr. Amanda Torres.",
]

# Redact all records in one call (irreversible)
batch = blindfold.redact_batch(records, policy="hipaa_us")

for i, result in enumerate(batch.results):
    print(f"Record {i+1}: {result['text']}")
    print(f"  PHI removed: {result['entities_count']} identifiers")

Three Modes of PHI Protection

ModeMethodReversibleUse Case
Tokenizeblindfold.tokenize()YesAI chat, summarization — restore PHI in responses
Redactblindfold.redact()NoLogs, storage — permanently remove PHI
Encryptblindfold.encrypt()Yes (with key)Secure archives — AES-256 encrypted PHI storage
# Reversible — PHI can be restored
tokenized = blindfold.tokenize(text, policy="hipaa_us")
# → "Patient <Person_1> (SSN <Social Security Number_1>)"
restored = blindfold.detokenize(response, tokenized.mapping)

Audit Trail

Every Blindfold API call is logged, supporting HIPAA’s audit requirements (45 CFR § 164.312(b)):
  • Who: Which API key made the request
  • What: Entity types detected and count
  • When: Timestamp of every PHI operation
  • Where: Processing region (US)
  • How: Which privacy method and policy was used
Export audit logs from the Blindfold Dashboard.

BAA Readiness

Blindfold is ready to sign a Business Associate Agreement (BAA) with covered entities and their business associates. A BAA is required under HIPAA when a third party handles PHI. Contact us at hello@blindfold.dev to request a BAA.

Cookbook Example

For a complete, runnable HIPAA healthcare chatbot, see the cookbook:

HIPAA Healthcare Chatbot Example

Full working example with US region, hipaa_us policy, single queries, multi-turn chat, and batch redaction.

HIPAA Compliance Checklist

1

Use the US region

Set region="us" to ensure PHI is processed within the United States.
2

Apply the hipaa_us policy

Use policy="hipaa_us" on all calls handling patient data.
3

Tokenize before AI calls

Always call blindfold.tokenize() before sending PHI to any AI provider.
4

Redact PHI in logs

Use blindfold.redact() to remove PHI from application logs and audit records.
5

Encrypt PHI at rest

Use blindfold.encrypt() for PHI stored in databases or file systems.
6

Sign a BAA with Blindfold

Contact hello@blindfold.dev to execute a Business Associate Agreement.
7

Implement access controls

Use separate API keys for different applications and teams.
8

Review audit logs

Regularly export and review audit logs from the dashboard.