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

# Column-Level Security (CLS)

This tutorial demonstrates how to protect sensitive information in your datasets while still enabling high-level analysis on the unmasked columns within a row. You will learn how to configure Column-Level Security (CLS) to mask specific values based on user attributes.

## Configure CLS

Follow these steps to configure CLS:

1. Navigate to the **Data Sources** tab in your project.
2. Select the table you wish to modify (e.g., `Account`).

![cls-data-source](https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-data-source.png?fit=max\&auto=format\&n=1zkIry5WVGxUGJmL\&q=85\&s=4338bc7674db3dc67835f1768897fcff)

3. Ensure that **Show advanced options** is toggled on in the top-right corner.
4. Locate your sensitive column and click **Configure** under the **CLS Masking** column.

![cls-sensitive-column](https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-sensitive-column.png?fit=max\&auto=format\&n=1zkIry5WVGxUGJmL\&q=85\&s=8daa37da5af8071d2e91b6e4f88efe69)

5. In the **Column-Level Security** modal, provide a SQL expression that determines how the data is displayed at query time.

![cls-sql-expression](https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-sql-expression.png?fit=max\&auto=format\&n=1zkIry5WVGxUGJmL\&q=85\&s=be2b848cffb27e437c26bb0e7d6deab1)

6. Click **Save**. The status badge in the CLS Masking column will now show as Active.

![cls-active](https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-active.png?fit=max\&auto=format\&n=1zkIry5WVGxUGJmL\&q=85\&s=a6ebb81db050b5e21a93e460adcca206)

> [!TIP]
>
> If you enter an incorrect value, such as a column name that doesn't exist, the system will alert you to the error and will not let you save it.

## Verifying the Implementation

Once active, CLS functions as a global security layer. It automatically enforces your masking logic across **WisdomAI Chat**, **Dashboards**, the **SQL Playground**, and **Data Source Previews**.

![cls-chat](https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-chat2.png?fit=max\&auto=format\&n=1zkIry5WVGxUGJmL\&q=85\&s=badccb394130f1d8aa35bae1ad97f19e)

For unauthorized users, protected data will appear as hashed values. It is important to remember that CLS is applied strictly at the column level.

> [!WARNING]
>
> **Avoid Data Leakage**: If you protect a column (e.g., `Customer Name`) but leave a correlative column unprotected (e.g., `Customer Email`), an unauthorized user will see the hashed name, but the clear-text email address. Ensure you apply masking to all columns that could potentially identify the sensitive entity.

## Derived columns

CLS on a base column applies automatically to every derived column that references it. You do not need to configure anything extra on the derived column.

You cannot configure CLS directly on a derived column. To protect a derived column, apply CLS to each base column it references.

## Next Steps

> [card] [Users Management](https://docs.wisdom.ai/manage-account/users-management.md)
>
> Manage user roles, permissions, and access to the platform.

> [card] [Quickstart: Connect and Test](https://docs.wisdom.ai/setting-up-wisdom-ai/basic-tutorial-connect-and-test.md)
>
> Walk through the initial setup to connect a data source and run your first query.


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