PIIGuard / Detectors

Driver's License

Detects US driver's license numbers. 50+ state formats with no checksum — confidence depends heavily on format type and context. Digit-only licenses without context are filtered by default to avoid noise.

Endpoint: POST /v1/pii/detect/dl

Validation & Confidence

Format pattern (alpha-numeric vs digit-only) + context keywords (license, DL, driver's license, etc.).

Alpha-numeric + context: 0.6. Digit-only + context: 0.3. Without context: 0.01–0.3. 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_dl("DL: A1234567")
// Response
{
  "entity_type": "US_DRIVER_LICENSE",
  "value": "A1234567",
  "severity": "high",
  "confidence": 0.6,
  "extra": { "format": "alpha_numeric", "has_context": true }
}

Notes

  • Why low base confidence: A 7-digit number could be a PA license or an order number. Without context, it's impossible to tell.
  • State-specific apps: If your input is known to contain driver's licenses, lower min_confidence to 0.1 to catch digit-only formats.