Skip to content

PII/PHI Detection

Automatically detect and handle sensitive information in documents.

Supported Entity Types

CategoryEntities
PersonalPERSON, EMAIL, PHONE, ADDRESS
FinancialCREDIT_CARD, BANK_ACCOUNT, SSN
MedicalMEDICAL_RECORD, DIAGNOSIS, MEDICATION
LegalCASE_NUMBER, ATTORNEY
CustomUser-defined patterns

Detection Engine

GateFlow uses Microsoft Presidio with custom enhancements:

  • 50+ built-in recognizers
  • ML-based entity classification
  • Context-aware detection
  • Multilingual support

Configuration

Enable Detection

bash
curl -X POST https://api.gateflow.ai/v1/data/documents \
  -H "Authorization: Bearer gw_prod_..." \
  -F "file=@document.pdf" \
  -F 'pii={"detect": true, "action": "redact"}'

Actions

ActionDescription
detectIdentify only, don't modify
redactReplace with [REDACTED]
maskReplace with asterisks
encryptEncrypt in place
tokenizeReplace with reversible token

Custom Patterns

json
{
  "pii": {
    "custom_patterns": [
      {
        "name": "EMPLOYEE_ID",
        "pattern": "EMP-\\d{6}",
        "action": "mask"
      }
    ]
  }
}

Detection Results

json
{
  "pii_detected": true,
  "entities": [
    {
      "type": "SSN",
      "text": "[REDACTED]",
      "position": {"start": 145, "end": 156},
      "confidence": 0.98,
      "action_taken": "redacted"
    }
  ]
}

Next Steps

Built with reliability in mind.