scrub-pii-from-text

Mask PII in text with a Python scrubber using Luhn validation.

29|8|Updated Jul 5, 2026
One-click install
npx skills add https://github.com/ContextJet-ai/awesome-llm-observability --skill scrub-pii-from-text
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scrub-pii-from-text
Source: https://github.com/ContextJet-ai/awesome-llm-observability/tree/main/skills/scrub-pii-from-text
Command: npx skills add https://github.com/ContextJet-ai/awesome-llm-observability --skill scrub-pii-from-text

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill is designed to prevent personally identifiable information (PII) from being logged or sent to third-party systems, ensuring compliance with regulations and protecting user data.

Core Features & Use Cases

  • PII Masking: Masks sensitive information like emails, credit cards, SSNs, and more within text.
  • Luhn Check: Ensures only valid credit card numbers are masked.
  • Use Case: Use this Skill before logging data to tracing systems or sending it to third-party models, particularly for finance, healthcare, and regulated apps.

Quick Start

Run python scripts/pii_scrub.py on the text containing PII to remove it.

Frequently Asked Questions about scrub-pii-from-text

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mask personally identifiable information like credit card numbers and SSNs in text logs?

To mask personally identifiable information in text logs, you can run a Python scrubber script that detects and replaces sensitive data. It targets emails, credit cards, SSNs, phone numbers, IPv4 addresses, and IBANs with placeholder tags.

Does the PII scrubber validate credit card numbers before masking them?

Yes, the PII scrubber applies a Luhn check to ensure only valid credit card numbers are masked. This prevents false positives from accidentally redacting benign number sequences in your text.

What's the best way to remove sensitive data before sending text to third-party models?

The best way to remove sensitive data before sending text to third-party models is using a Python-based scrubber script. It replaces targeted financial and healthcare PII with placeholder tags to ensure regulation compliance.

Can I use this Python script to mask data for finance and healthcare compliance?

Yes, you can use this Python script to mask data for finance and healthcare compliance. It specifically targets sensitive information like SSNs and IBANs, replacing them with placeholders to protect user data.

What specific types of sensitive data does the text scrubber detect and replace?

The text scrubber detects and replaces email addresses, credit card numbers, US Social Security numbers, phone numbers, IPv4 addresses, and IBANs. All detected sensitive data is replaced with generic placeholder tags.