--- id: microsoft-security-utilities-secret-masker version: "1.0.0b4" license: MIT license_treatment: permissive maintenance: aging --- # microsoft-security-utilities-secret-masker — A tool for detecting and masking secrets License: permissive · Maintenance: aging · Downloads: 5.5M/mo ## What it is and what it does This is a Microsoft-authored library for detecting and redacting sensitive information like API keys, credentials, and tokens from text. It ships with pre-built regex patterns organized by confidence level (precisely classified vs. unclassified), and provides two masking strategies: simple symbol replacement or SHA256 hashing. The library has no external runtime dependencies, making it lightweight to integrate. The package is in beta (1.0.0b4) and maintenance is aging. It's positioned for internal Microsoft use but is publicly available. If you need to sanitize logs, audit trails, or user input before storage or transmission, this library offers a straightforward regex-based approach with Microsoft's curated detection rules. Use it for: - Sanitize application logs before shipping them to external monitoring or storage systems - Redact credentials and tokens from error messages or debug output shown to users - Mask sensitive data in database exports or backups before sharing with third parties - Clean user-generated content in support tickets or feedback forms - Prepare training datasets by removing secrets before publishing or sharing ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Detects and masks sensitive data in text using regex patterns, with built-in rules for common secret types and options to replace matches with symbols or SHA256 hashes. Yes, if you need straightforward secret detection and masking with no external dependencies and trust Microsoft's regex patterns. The beta status and aging maintenance mean it's stable enough for production but unlikely to evolve further—suitable for teams already using Microsoft tooling or those with simple, well-defined secret types. Not recommended if you need active maintenance, custom pattern tuning, or support for emerging secret formats. ## Install pip install microsoft-security-utilities-secret-masker uv add microsoft-security-utilities-secret-masker poetry add microsoft-security-utilities-secret-masker ## Installing microsoft-security-utilities-secret-masker Before you install: Low install friction with no runtime dependencies. Package is in beta (1.0.0b4) and aging—last release was 522 days ago, suggesting limited active maintenance. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install microsoft-security-utilities-secret-masker from microsoft_security_utilities_secret_masker import SecretMasker, load_regex_patterns_from_json_file patterns = load_regex_patterns_from_json_file('PreciselyClassifiedSecurityKeys.json') secret_masker = SecretMasker(patterns) detected = secret_masker.detect_secrets("input text") masked = secret_masker.mask_secrets("input text") Verify before relying: - Whether the built-in detection rules are comprehensive for your specific secret types - Current maintenance status and whether updates are planned beyond the beta release - Performance characteristics when processing large volumes of text - Accuracy of regex patterns and false-positive rates in production use ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 5.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags detect secrets in text, mask sensitive data, regex-based secret detection, redact credentials, hide api keys and tokens, data masking library, secret redaction, secret-detection, data-masking, log-sanitization [View on SkillFed](https://skillfed.io/packages/microsoft-security-utilities-secret-masker) · [View on PyPI](https://pypi.org/project/microsoft-security-utilities-secret-masker/)