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

# Sample Data Handling Using PII Tags

> How OpenMetadata masks sample data when PII tags are applied to a column or a whole table, how to apply PII tags, and how access control affects masked values.

# Sample Data Handling Using PII Tags

In OpenMetadata, sensitive information is protected through **automatic masking** of sample data when PII (Personally Identifiable Information) tags are applied.

## How It Works

* If a **PII tag** is applied to a **specific column**:
  * Only that column’s sample data will be **masked** and displayed as `********` in the UI.

![PII Tag Application at Column Level](https://mintcdn.com/openmetadata/x0xXkTWAgiDpM5Ry/public/images/how-to-guides/governance/pii-tags.png?fit=max\&auto=format\&n=x0xXkTWAgiDpM5Ry\&q=85\&s=82e2f8e08565bb5f76455ea3a0f4ac96)

* If a **PII tag** is applied at the **table level**:
  * **All columns** within that table will have their sample data masked automatically.

![PII Tag Application at Table Level](https://mintcdn.com/openmetadata/x0xXkTWAgiDpM5Ry/public/images/how-to-guides/governance/pii-tags2.png?fit=max\&auto=format\&n=x0xXkTWAgiDpM5Ry\&q=85\&s=6d6fa28e392c9b13620f49cd5bd3bffb)

This behavior ensures that sensitive data is not exposed through sample data views in OpenMetadata.

## Example

| Column Name | Tag | Sample Data Displayed |
| - | - | - |
| email | PII.Sensitive | `********` |
| phoneNumber | PII.Sensitive | `********` |
| age | (None) | 25 |

When the tag is applied at the **table level**, the result would be:

| Column Name | Tag | Sample Data Displayed |
| - | - | - |
| email | Inherited from Table | `********` |
| phoneNumber | Inherited from Table | `********` |
| age | Inherited from Table | `********` |

## How to Apply PII Tags

1. Navigate to the **column** or **table** in the OpenMetadata UI.
2. Apply the **PII.Sensitive** tag via the tagging options.

![PII.Sensitive Tagging](https://mintcdn.com/openmetadata/x0xXkTWAgiDpM5Ry/public/images/how-to-guides/governance/pii-tags1.png?fit=max\&auto=format\&n=x0xXkTWAgiDpM5Ry\&q=85\&s=fa9085b5693d1b174deb8538ab568668)

3. Ensure auto-classification or manual tagging captures the correct columns during ingestion.

## Access Control

Two separate controls protect sample data:

* **Permission to view sample data.** Sample data has its own `ViewSampleData` operation, and `ViewAll` includes it. A user without it still sees the **Sample Data** tab, but the tab shows a permission-denied message. You can't hide the tab for a role.
* **PII masking.** A column tagged `PII.Sensitive` is masked unless the user is an admin, a bot, or an owner of the table. Having `ViewSampleData` alone doesn't unmask the values.

| User | Has `ViewSampleData` | Sees `PII.Sensitive` values |
| - | - | - |
| Admin, bot, or table owner | Yes | Unmasked |
| Any other user | Yes | Masked (`********`) |
| Any other user | No | Nothing. The tab shows a permission-denied message. |

For sensitive environments:

1. Tag sensitive columns, or the whole table, with `PII.Sensitive`.
2. Restrict who can view sample data. The default `OrganizationPolicy-ViewAll-Rule` gives every user `ViewAll`, which includes `ViewSampleData`. Add a `Deny` rule for `ViewSampleData` to the roles that shouldn't see it, as in [Use Case 11](https://docs.open-metadata.org/v2.1.x/how-to-guides/admin-guide/roles-policies/use-cases.md#use-case-11-set-up-a-data-owner-role-that-hides-observability), or edit that rule.
3. Make sure only the people who need to see the real values own sensitive tables.

For more information about permissions, see [Resource Scope and Operations Reference](https://docs.open-metadata.org/v2.1.x/how-to-guides/admin-guide/roles-policies/resource-scope.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.