PIIGuard / Detectors
Detects email addresses using RFC 5321/5322 structural validation. Both simple and quoted local parts are supported. Always returns confidence 1.0 — there are no false positives on a structurally valid email.
Endpoint: POST /v1/pii/detect/email
Validation & Confidence
RFC 5321/5322 structure + domain label validation. Rejects addresses with invalid domain structures (e.g. missing TLD, consecutive dots).
Always 1.0. Severity: medium.
Example
from instructeer.guards import PIIGuard
# api_key = os.environ["INSTRUCTEER_API_KEY"]
pii = PIIGuard(api_key="rg_your_key")
result = pii.detect_email("Reach me at john.doe@example.com or support@company.co.uk")// Response
{
"entity_type": "EMAIL_ADDRESS",
"value": "john.doe@example.com",
"severity": "medium",
"confidence": 1.0
}Notes
- Quoted local parts: "first.last"@example.com is detected correctly.
- Subdomains: user@mail.sub.example.com — multiple subdomain levels supported.
- Display names: John Doe <john@example.com> — the address is extracted from angle brackets.