PIIGuard / Detectors
Date of Birth
Detects dates of birth only — requires context words nearby. Generic dates without context (meeting dates, deadlines, timestamps) are not returned by this endpoint. Use /detect/date if you need all dates.
Endpoint: POST /v1/pii/detect/dob
Validation & Confidence
17 date format patterns + mandatory context token (DOB:, born on, date of birth, birthday, etc.).
Always 0.9+ when context is present. 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_dob("Patient DOB: 01/15/1985. Appointment: 03/20/2024")// Response
{
"entity_type": "DATE_OF_BIRTH",
"value": "01/15/1985",
"severity": "high",
"confidence": 0.9,
"extra": { "context": "DOB:" }
}Notes
- Context tokens: DOB: · born on · date of birth · birthday · dob · b-day
- Formats: MM/DD/YYYY · DD-MM-YYYY · YYYY-MM-DD · Month DD, YYYY · and 13 more.
- Without context: A date like 01/15/1985 with no surrounding context is not returned. Use /detect/date for all dates.