Summary
The PII guardrail currently detects 12 categories of sensitive data, but passport numbers only match when a keyword like "passport" appears nearby. Add a standalone regex pattern for common passport formats.
What to do
- Open
src/aegis/guardrails/pii.py
- Add regex patterns for common passport formats:
- US: 1 letter + 8 digits (e.g.,
A12345678)
- UK: 9 digits
- Korean: 1-2 letters + 7 digits
- Add tests in
tests/test_guardrails_pii.py
- Run
pytest tests/test_guardrails_pii.py -x to verify
Context
The existing patterns live in the PIIGuardrail class. Look at how email or ssn patterns are defined for the pattern to follow.
Acceptance criteria
Summary
The PII guardrail currently detects 12 categories of sensitive data, but passport numbers only match when a keyword like "passport" appears nearby. Add a standalone regex pattern for common passport formats.
What to do
src/aegis/guardrails/pii.pyA12345678)tests/test_guardrails_pii.pypytest tests/test_guardrails_pii.py -xto verifyContext
The existing patterns live in the
PIIGuardrailclass. Look at howemailorssnpatterns are defined for the pattern to follow.Acceptance criteria