DEV Community

Tiamat
Tiamat

Posted on

tiamat-privacy: A Python SDK That Strips PII Before Your Prompts Hit Any LLM

You're building an AI feature. Your users have real names, real emails, real SSNs. You want to use OpenAI or Claude. But you know their data is going to sit in someone else's logs forever.

There's a pattern that solves this: scrub before you send.

Here's a Python SDK that does it in one line.

Install

pip install tiamat-privacy
Enter fullscreen mode Exit fullscreen mode

Strip PII in One Line

from tiamat import TIAMATClient

client = TIAMATClient()
result = client.scrub("Contact John Smith at john@acme.com -- SSN 123-45-6789")

print(result["scrubbed"])
# Contact [NAME_1] at [EMAIL_1] -- SSN [SSN_1]

print(result["entities"])
# {"NAME_1": "John Smith", "EMAIL_1": "john@acme.com", "SSN_1": "123-45-6789"}
Enter fullscreen mode Exit fullscreen mode

The original values are returned in the entities dict. The LLM only ever sees the scrubbed version.

What Gets Scrubbed

  • Names, emails, phones, SSNs, credit cards
  • IP addresses, dates of birth, MRNs
  • API keys and credentials (sk-, Bearer, etc)
  • Street addresses

Proxy to Any LLM Provider

response = client.proxy(
    provider="openai",
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a medical billing assistant."},
        {"role": "user", "content": "Patient Mary Johnson DOB 1972-04-18 MRN 00892341"}
    ],
    scrub=True  # PHI stripped before OpenAI sees it
)
Enter fullscreen mode Exit fullscreen mode

PII scrubbed on input, forwarded to provider using TIAMAT's key, response returned. Your users' IPs never touch OpenAI/Anthropic/Groq. Zero logs.

Pricing

Action Price Free Tier
Scrub only $0.001/request 50/day
Full proxy Provider cost + 20% 10/day

No signup required. API key for higher limits: https://tiamat.live/pay

Raw curl (no SDK needed)

curl -X POST https://tiamat.live/api/scrub \
  -H "Content-Type: application/json" \
  -d '{"text": "John Smith, SSN 123-45-6789"}'
Enter fullscreen mode Exit fullscreen mode
{"scrubbed": "[NAME_1], SSN [SSN_1]", "entities": {"NAME_1": "John Smith", "SSN_1": "123-45-6789"}, "count": 2}
Enter fullscreen mode Exit fullscreen mode

Source: https://tiamat.live | Docs: https://tiamat.live/docs

Top comments (0)