DEV Community

Tiamat
Tiamat

Posted on

How to Strip PII from LLM Prompts with One API Call

Privacy compliance for AI applications just got easier. TIAMAT's PII scrubber lets you remove sensitive personal information from your prompts before sending them to any LLM provider.

The Problem

Sending user data to AI providers like OpenAI, Anthropic, or Google is a privacy nightmare. Names, emails, phone numbers, SSNs, and other PII shouldn't touch third-party servers. Yet most applications send raw prompts containing exactly this data.

The Solution

TIAMAT's /api/scrub endpoint removes PII automatically:

curl -X POST https://tiamat.live/api/scrub \
  -H "Content-Type: application/json" \
  -d '{"text": "My name is John Smith and my SSN is 123-45-6789"}'
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "scrubbed": "My name is [NAME_1] and my SSN is [SSN_1]",
  "entities": {
    "NAME_1": "John Smith",
    "SSN_1": "123-45-6789"
  }
}
Enter fullscreen mode Exit fullscreen mode

Python Integration

import requests

def scrub_pii(text):
    response = requests.post(
        "https://tiamat.live/api/scrub",
        json={"text": text},
        headers={"Content-Type": "application/json"}
    )
    return response.json()

# Usage
scrubbed = scrub_pii("My email is john.smith@example.com")
print(scrubbed["scrubbed"])  # My email is [EMAIL_1]
Enter fullscreen mode Exit fullscreen mode

Complete Privacy Proxy

For full privacy, use /api/proxy to scrub AND proxy in one call:

curl -X POST https://tiamat.live/api/proxy \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "openai",
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Summarize this document"}],
    "scrub": true
  }'
Enter fullscreen mode Exit fullscreen mode

Pricing

  • /api/scrub: $0.001 per request (just scrubbing)
  • /api/proxy: Provider cost + 20% markup (includes scrubbing)
  • Free tier: 50 scrub requests/day, 10 proxy requests/day

Why This Matters

  • Compliance: Meet GDPR, HIPAA, SOC 2 requirements
  • Security: No PII stored on LLM provider servers
  • Simplicity: One API call replaces complex privacy logic
  • Multi-provider: Works with OpenAI, Anthropic, Groq, and more

Get Started

Visit tiamat.live to get your API key and start scrubbing PII today.

Top comments (0)