feat(probes): add propile_sensitive probe for sensitive PII extraction#1953
Open
frangelbarrera wants to merge 1 commit into
Open
feat(probes): add propile_sensitive probe for sensitive PII extraction#1953frangelbarrera wants to merge 1 commit into
frangelbarrera wants to merge 1 commit into
Conversation
Extends ProPILE (Kim et al. 2023, arXiv:2307.01881) to cover sensitive PII types that the base module's Ethics section explicitly excludes: SSN (US), IBAN, passport number, date of birth, and driver's license (US). The base module (garak/probes/propile.py, PR NVIDIA#1594) deliberately scopes its bundled data to email/phone/address and leaves the sensitive-PII gap documented; this module fills that gap without modifying the base module. The module ships two probe classes: - PIILeakSensitiveTwin: twin elicitation (name -> 1 sensitive PII type) - PIILeakSensitiveTriplet: triplet elicitation (name + auxiliary email/phone -> 1 sensitive PII type) Both classes: - Subclass PIILeakProbeMixin + Probe (reuse existing template/data loading and the probe() guard that skips execution when prompts is empty) - Reuse the existing garak.detectors.propile.PIILeak detector — its _generic_partial_match Jaro-Winkler fallback already handles arbitrary PII types beyond email/phone/address, so no new detector is needed - Ship active=False (consistent with the base ProPILE classes, ethically conservative for sensitive-PII probing) - Use synthetic data only: SSN 000-00-0000 (US-SSA-invalid placeholder), IBAN XX00... (XX is not a valid ISO 13616 country code), passport X00000000, driver license X0000000, fictional DOBs. No real victim PII is shipped - Document a DOB-coverage limitation in the module docstring: Jaro-Winkler similarity falls below the 0.7 partial_threshold for some reformatted dates (e.g., "January 1, 1990" vs canonical "1990-01-01"); verbatim matches are reliably detected (sim = 1.0) Non-overlapping with: - PR NVIDIA#1594 (ProPILE base module) — extends rather than modifies; new module file, new data directory, no edits to propile.py or its data - Draft PR NVIDIA#1407 (generic pii.ContainsPII detector + personal.PII probe) — different module path, detector surface, and scope (ProPILE twin/triplet recipe for specific sensitive types vs generic PII detection) - Issue NVIDIA#88 / PR NVIDIA#1748 (credit cards) — credit card numbers are explicitly out of scope for this module Closes NVIDIA#219 (partial — covers sensitive PII types not in original ProPILE) Validation: - pip install -e .[tests,lint] - pytest tests/probes/test_probes_propile_sensitive.py — 20/20 pass - pytest tests/probes/test_probes_propile.py — 24/24 pass (no regression) - pytest tests/detectors/test_detectors_propile.py — 12/12 pass - pytest tests/test_docs.py — 671/671 pass (docstring + RST) - black --config pyproject.toml --check — clean Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Frangel Raúl Crespo Barrera <frangelbarrera@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Following up on my comment on #219 (July 8) — no response there, but since the issue is tagged
good first issueand has been dormant for 10 months, I'm opening this PR directly. Happy to address any scope concerns here.This PR adds
garak/probes/propile_sensitive.py, extending the ProPILE methodology (Kim et al. 2023, arXiv:2307.01881) to cover sensitive PII types that the base module's Ethics section explicitly excludes: SSN (US), IBAN, passport number, date of birth, and driver's license (US).What does this PR do?
garak/probes/propile_sensitive.pywith two probe classes:PIILeakSensitiveTwin: twin elicitation (name → 1 sensitive PII type)PIILeakSensitiveTriplet: triplet elicitation (name + auxiliary email/phone → 1 sensitive PII type)garak/data/propile_sensitive/with synthetic data (20 records, 5 sensitive PII types per record) and 25 prompt templates (15 twin + 10 triplet)tests/probes/test_probes_propile_sensitive.py(20 tests, all passing)docs/source/probes/propile_sensitive.rst+ toctree entry indocs/source/index_probes.rstBoth probe classes:
PIILeakProbeMixin + Probe(reuse existing template/data loading and theprobe()guard)garak.detectors.propile.PIILeakdetector — its_generic_partial_matchJaro-Winkler fallback (threshold 0.7) already handles arbitrary PII types, so no new detector is neededactive=False(consistent with the base ProPILE classes)000-00-NNNN(area/group reserved invalid), IBANXX00BANK…(XX is not a valid ISO 13616 country code), passportX00000000, driver licenseX0000000, fictional DOBs. No real victim PII is shippedRelated issue
Closes #219 (partial — covers sensitive PII types not in original ProPILE)
Non-overlap with existing work
propile.pyor its data filespii.ContainsPIIdetector +personal.PIIprobe, dormant since 2025-10-20) — different module path, different detector surface, different scope (ProPILE twin/triplet recipe for specific sensitive types vs generic PII detection). This PR also addresses the review feedback @jmartin-tech left on feat(probes): add PII leakage probe #1407: prompts and detector criteria are separate, PII samples are clearly-invalid synthetic placeholders, matching uses Jaro-Winkler similarity rather than full-string equality, and tests do not reuse the data file as detection criteriaType of change
Testing
All validation run locally with
pip install -e .[tests,lint]:No API keys required for the test suite (uses
MagicMockconfig + direct-Attempt pattern fromtests/detectors/test_detectors_propile.py:23-31).AI assistance disclosure
This PR was developed with assistance from Claude (Anthropic), in compliance with
AGENTS.md. Claude was used to draft initial module scaffolding, suggest test fixtures consistent with existing garak probe tests, and verify docstring/RST format againsttests/test_docs.py. Every changed line was reviewed, understood, and accepted by the human submitter, who wrote the design, the prompt templates, and the test assertions. The commit carries aCo-authored-by: Claudetrailer; the human is the sole signatory of the DCOSigned-off-by:trailer.Checklist
Signed-off-by:in commit)Co-authored-by: Claudein commit + statement above)feat(probes): ...)black --checkcleannltkfor Jaro-Winkler viapropile.PIILeakdetector)