Skip to content

Conversation

@AnandShivansh
Copy link
Contributor

@AnandShivansh AnandShivansh commented Sep 5, 2025

Similar to the Anonymizer scanner, the Regex scanner now supports storing redacted values in a vault for later deanonymization. When a vault is provided, matched patterns are replaced with unique placeholders like [REDACTED_REGEX_1], [REDACTED_REGEX_2], etc., and the original values are stored in the vault.

Key changes:

  • Add optional vault parameter to both input and output Regex scanners
  • Store matched regex patterns in vault with unique indexed placeholders
  • Maintain backward compatibility when no vault is provided (uses [REDACTED])
  • Update llm_guard_api scanner configuration to pass vault to Regex scanners
  • Implement proper counter management to avoid placeholder conflicts

Change Description

Describe your changes

Issue reference

This PR fixes issue #XX

Checklist

  • I have reviewed the contribution guidelines
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Similar to the Anonymizer scanner, the Regex scanner now supports storing
redacted values in a vault for later deanonymization. When a vault is provided,
matched patterns are replaced with unique placeholders like [REDACTED_REGEX_1],
[REDACTED_REGEX_2], etc., and the original values are stored in the vault.

Key changes:
- Add optional vault parameter to both input and output Regex scanners
- Store matched regex patterns in vault with unique indexed placeholders
- Maintain backward compatibility when no vault is provided (uses [REDACTED])
- Update llm_guard_api scanner configuration to pass vault to Regex scanners
- Implement proper counter management to avoid placeholder conflicts
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