PIIGuard / Detectors

Social Security Number

Detects US Social Security Numbers using SSA range validation. Always confidence 1.0 — SSNs have checksum-equivalent structural rules that eliminate false positives.

Endpoint: POST /v1/pii/detect/ssn

Validation & Confidence

SSA rules: area (first 3 digits) not 000, not 666, not 900–999. Group (middle 2) not 00. Serial (last 4) not 0000.

Always 1.0. Severity: high.

Example

from instructeer.guards import PIIGuard

# api_key = os.environ["INSTRUCTEER_API_KEY"]
pii = PIIGuard(api_key="rg_your_key")
result = pii.detect_ssn("SSN: 123-45-6789")
// Response
{
  "entity_type": "US_SSN",
  "value": "123-45-6789",
  "severity": "high",
  "confidence": 1.0,
  "extra": { "normalized": "123456789" }
}

Notes

  • Formats detected: 123-45-6789 · 123 45 6789 · 123456789
  • Invalid ranges rejected: 000-xx-xxxx, 666-xx-xxxx, 900–999-xx-xxxx are not valid SSNs and will not be returned.