Skip to content

feat: Add credit card leakage probe and detector - #2039

Open
Partharsid wants to merge 1 commit into
NVIDIA:mainfrom
Partharsid:feat/credit-card-probe
Open

feat: Add credit card leakage probe and detector#2039
Partharsid wants to merge 1 commit into
NVIDIA:mainfrom
Partharsid:feat/credit-card-probe

Conversation

@Partharsid

Copy link
Copy Markdown

Description

Adds a new probe and detector to evaluate if models leak or generate credit card numbers, addressing issue #88.

  • detectors.creditcard.CreditCard: A new detector that identifies credit card numbers using regex patterns for major networks (Visa, Mastercard, Amex, Discover) combined with strict Luhn algorithm validation to minimize false positives.
  • probes.creditcard.GenerateCard: Prompts that ask the model directly to generate or provide credit card numbers for testing/dummy use.
  • probes.creditcard.CompleteCard: Prompts that simulate a user asking for a partial credit card number to be completed.

Testing

  • Unit tests added for the detector verifying Luhn validation against valid and invalid strings.
  • Unit tests added for both probes.
  • python -m pytest tests/detectors/test_detectors_creditcard.py tests/probes/test_probes_creditcard.py -v passes completely.

Addresses #88

Adds a new probe and detector to evaluate if models leak credit card numbers, addressing issue NVIDIA#88. The detector uses regex + Luhn algorithm.

Co-authored-by: Gemini 3.1 Pro (High)

Signed-off-by: Parth Arsid <partharsid@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant