Drop-in replacement for OpenAI, Anthropic, and Gemini SDKs. PHI is automatically redacted before reaching any LLM provider. All processing happens locallyโno Redact API keys, no signup. Uses your existing LLM provider keys.
# BEFORE - PHI goes directly to OpenAI from openai import OpenAI # AFTER - PHI is automatically redacted from redact_proxy import OpenAI # Everything else stays exactly the same client = OpenAI() response = client.chat.completions.create( model="gpt-4", messages=[{"role": "user", "content": "Patient John Smith, DOB 01/15/1980, has diabetes."}] ) # What OpenAI actually receives: # "Patient [NAME_a1b2c3], DOB [DATE_d4e5f6], has diabetes."
DE-ID removes PHI permanently. Our RE-ID SDK creates reversible tokens - LLM never sees PHI, but you can restore it. pip install redact-proxy[reid]
Redact-Proxy wraps your LLM SDK and intercepts all requests before they leave your machine.
# Your original message: "Patient John Smith, SSN 123-45-6789, was seen on 01/15/2024 at Springfield Medical Center. Contact: (555) 123-4567" # What OpenAI receives: "Patient [NAME_a1b2c3], SSN [SSN_d4e5f6], was seen on [DATE_g7h8i9] at [FACILITY_j0k1l2]. Contact: [PHONE_m3n4o5]"
Zero infrastructure. Zero signup. Just change your import.
Change one import statement. All your existing code works exactly the same, but now PHI is protected.
No API keys, no cloud services, no Docker containers. Everything runs locally in your Python environment.
All redaction happens locally before any network request. Your PHI never touches third-party servers.
Pattern-based detection adds ~8ms latency. Transformer mode available for higher accuracy.
Same API, same methods, same parameters. Works with OpenAI, Anthropic, and Google Gemini.
MIT licensed core. Inspect the code, contribute, or fork it. No vendor lock-in.
Understand exactly what happens to PHI at each step.
All detection and redaction happens in your application's memory. No external service calls.
Only redacted text goes to the LLM provider. Original PHI never leaves your machine.
PHIโplaceholder mappings are stored in memory only and cleared after each request completes.
Debug logging is disabled by default. If enabled, ensure your logs are stored securely.
PHI can still leak through other parts of your application.
Covers all HIPAA Safe Harbor identifiers plus clinical extensions.
Three detection engines for different use cases.
Patterns + Presidio. Best for structured EMR data with labels.
spaCy NER + patterns. Good for mixed content types.
Clinical NER model. Best for free-text narratives without structured labels.
# Configure detection mode from redact_proxy import OpenAI client = OpenAI( redact_mode="fast" # or "balanced" or "accurate" )
Same API you're already using. Just change the import.
Build AI scribes and documentation assistants that process patient encounters without sending PHI to cloud LLMs. Perfect for ambient listening apps.
Analyze clinical notes with GPT-4 or Claude without IRB concerns. Extract insights from medical records while maintaining patient privacy.
Build symptom checkers and health assistants. Patients can describe conditions freely knowing their information stays private.
Add AI features to your EHR or practice management system. Process clinical data with LLMs while staying HIPAA compliant.
| Task | DIY Approach | Redact-Proxy |
|---|---|---|
| Setup time | Days to weeks | 5 minutes |
| Code changes | Wrap every API call | Change 1 import |
| PHI patterns | Write your own regex | 18 types included |
| Maintenance | Ongoing updates needed | pip upgrade |
| Testing | Build test suite | Validated on clinical data |
| Multi-provider | Implement per provider | OpenAI, Anthropic, Gemini |
No additional dependencies beyond your existing LLM SDK.
pip install redact-proxy
Just change where you import from. That's it.
# Change this: from openai import OpenAI # To this: from redact_proxy import OpenAI
Your existing code now automatically redacts PHI before sending to any LLM.
# Your existing code works unchanged client = OpenAI() response = client.chat.completions.create( model="gpt-4", messages=[ {"role": "user", "content": "Patient John Smith, SSN 123-45-6789, has diabetes."} ] ) # OpenAI receives: "Patient [NAME_a1b2c3], SSN [SSN_d4e5f6], has diabetes." # PHI never leaves your machine
Run de-identification locally with no limits. Need to restore original PHI? Add RE-ID.
De-identification only
DE-ID + Re-identification
Need Cloud Workspace, HIPAA Chat, or BAA? See full platform pricing →
Get started in 60 seconds. No signup required.