> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gurubase.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# PII Masking

> Step-by-step guide to protecting your sensitive data

## PII Masking

PII (Personally Identifiable Information) masking automatically redacts sensitive data from your content to protect privacy and comply with data protection regulations.

### How PII Masking Works

PII masking operates across three key areas:

* **Questions asked**: User queries are scanned and sensitive data is masked before processing
* **File attachments**: Documents uploaded during question asking are processed for PII removal
* **Data source indexing**: All data sources are masked during the indexing process

When a regex pattern matches content, it's replaced with `<<label>>` format (e.g., `<<EMAIL>>`, `<<SSN>>`).

### Configuration

<Frame>
  <img src="https://mintcdn.com/gurubase/Lgkv_yjf_52FH5tq/images/pii-masks.png?fit=max&auto=format&n=Lgkv_yjf_52FH5tq&q=85&s=435cbf53affbca3dc8fde74e0f7a2926" alt="PII Mask Configuration" width="1038" height="1120" data-path="images/pii-masks.png" />
</Frame>

Configure PII masks using regex patterns:

* **Case sensitive**: All pattern matching is case-sensitive
* **PCRE 2 standard**: Follows Perl Compatible Regular Expressions 2 specification
* **Validation**: Test your regex patterns at [regex101.com](https://regex101.com/) before implementation

### Example Results

<Frame>
  <img src="https://mintcdn.com/gurubase/Lgkv_yjf_52FH5tq/images/unmasked-content.png?fit=max&auto=format&n=Lgkv_yjf_52FH5tq&q=85&s=74b552811fbf916539e9b09c4c50ebc2" alt="Content Before PII Masking" width="3024" height="1668" data-path="images/unmasked-content.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/gurubase/Lgkv_yjf_52FH5tq/images/masked-content.png?fit=max&auto=format&n=Lgkv_yjf_52FH5tq&q=85&s=817e008d87e7c154e539ed9b394dd641" alt="Content After PII Masking" width="3020" height="1646" data-path="images/masked-content.png" />
</Frame>

The masking process automatically identifies and replaces sensitive information while preserving the overall context and readability of your content.
