PII Detection API

    Real-time PII Detection API
    for prompts and LLM responses

    Scan every prompt — and every model response — for emails, phones, SSNs, IBANs, contracts and custom entities, before and after they reach OpenAI, Anthropic or Gemini. One REST call or one MCP tool, P95 under 80ms in both directions.

    Detection engine, built for production — both directions

    Not another regex library. A hybrid engine that combines deterministic rules with NLP models, tuned for enterprise LLM traffic — applied to the prompt that goes in and to the response that comes back.

    P95 < 80ms

    Edge-deployed detection engine, applied to both directions — prompt in and response out. No noticeable latency added to your LLM calls.

    Hybrid regex + NLP

    Rule-based patterns for structured entities plus NLP models for names, addresses and unstructured PII.

    Reversible tokenization

    Get back tokens instead of masked text. Reveal originals later via controlled RPC with full audit.

    REST + MCP

    Standard REST endpoint or Model Context Protocol tool for agents. Same detection engine either way.

    One endpoint. Every entity.

    Send text, get structured entities with type, position, confidence and an aggregate risk score.

    POST https://api.privaro.ai/v1/detect
    Authorization: Bearer YOUR_API_KEY
    Content-Type: application/json
    
    {
      "text": "Contact John Doe at john@acme.com or +34 600 123 456"
    }
    
    // Response
    {
      "entities": [
        { "type": "PERSON", "value": "John Doe", "start": 8, "end": 16, "confidence": 0.97 },
        { "type": "EMAIL", "value": "john@acme.com", "start": 20, "end": 33, "confidence": 1.0 },
        { "type": "PHONE", "value": "+34 600 123 456", "start": 37, "end": 52, "confidence": 0.99 }
      ],
      "risk_score": 0.72
    }

    Why regex alone misses 40% of PII

    Pattern matching catches the easy entities. Contextual PII — names, addresses, medical conditions, contract clauses — requires language understanding. Privaro combines both in a single hybrid engine.

    Entity typeRegexPrivaro hybrid NLP
    Email addresses
    Credit cards / IBANs
    Full names (contextual)✗
    Addresses✗
    Medical conditions✗
    Contract clauses✗
    Spanish DNI / NIEPartial(with checksum)
    Custom entities✗(configurable)

    Supported entity types

    Every detection result includes the entity type, exact position, and a confidence score — ready to route through your pipeline's policy engine.

    PERSON_NAME
    EMAIL_ADDRESS
    PHONE_NUMBER
    NATIONAL_ID (DNI/NIE/SSN/passport)
    IBAN / CREDIT_CARD
    DATE_OF_BIRTH
    IP_ADDRESS
    MEDICAL_RECORD
    CONTRACT_CLAUSE
    CUSTOM (regex + NLP)

    Detect, or protect and relay

    Use /v1/detect to inspect a prompt, or /v1/proxy/protect to tokenize sensitive entities and forward the sanitized text to the LLM in one call.

    // Option A: detect only (inspect what's in a prompt)
    POST /v1/detect
    { "text": "Call Maria at maria@company.com" }
    
    // Option B: protect + relay (tokenize and forward to the LLM)
    POST /v1/proxy/protect
    {
      "text": "Call Maria at maria@company.com",
      "pipeline_id": "YOUR_PIPELINE_ID",
      "provider": "openai",
      "model": "gpt-4o"
    }
    
    // Response includes the LLM answer with tokens re-identified
    {
      "result": "I'll contact Maria at maria@company.com",
      "entities_detected": 2,
      "risk_score": 0.68,
      "audit_log_id": "log_abc123"
    }

    Performance

    < 80ms
    P95 latency
    texts up to 4k tokens
    F1 ≥ 0.95
    Detection accuracy
    benchmark on EU financial corpus
    500 req/s
    Throughput
    per tenant, horizontal scaling
    99.9%
    Availability SLA
    Railway + Supabase redundancy

    Compliance-ready by default

    GDPR Article 25 — data minimization
    EU AI Act — record-keeping
    SOC 2 controls in-scope

    Pairs natively with the Privaro AI Governance Platform for policy enforcement, token vault and audit trails.

    Frequently asked questions

    Try the PII Detection API

    Free tier includes 10k detections/month. No credit card required.

    Request API access