> ## 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`).

<Frame>
  <img src="https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-data-source.png?fit=max&auto=format&n=1zkIry5WVGxUGJmL&q=85&s=4338bc7674db3dc67835f1768897fcff" alt="cls-data-source" width="1878" height="956" data-path="images/cls-data-source.png" />
</Frame>

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.

<Frame>
  <img src="https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-sensitive-column.png?fit=max&auto=format&n=1zkIry5WVGxUGJmL&q=85&s=8daa37da5af8071d2e91b6e4f88efe69" alt="cls-sensitive-column" width="1878" height="956" data-path="images/cls-sensitive-column.png" />
</Frame>

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

<Frame>
  <img src="https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-sql-expression.png?fit=max&auto=format&n=1zkIry5WVGxUGJmL&q=85&s=be2b848cffb27e437c26bb0e7d6deab1" alt="cls-sql-expression" width="1422" height="839" data-path="images/cls-sql-expression.png" />
</Frame>

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

<Frame>
  <img src="https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-active.png?fit=max&auto=format&n=1zkIry5WVGxUGJmL&q=85&s=a6ebb81db050b5e21a93e460adcca206" alt="cls-active" width="1878" height="956" data-path="images/cls-active.png" />
</Frame>

<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.
</Tip>

## 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**.

<Frame>
  <img src="https://mintcdn.com/wisdomai/1zkIry5WVGxUGJmL/images/cls-chat2.png?fit=max&auto=format&n=1zkIry5WVGxUGJmL&q=85&s=badccb394130f1d8aa35bae1ad97f19e" alt="cls-chat" width="822" height="778" data-path="images/cls-chat2.png" />
</Frame>

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.
</Warning>

## Next Steps

<CardGroup cols={2}>
  <Card title="Users Management" icon="users" href="/manage-account/users-management">
    Manage user roles, permissions, and access to the platform.
  </Card>

  <Card title="Basic Tutorial: Connect and Test" icon="rocket" href="/setting-up-wisdom-ai/basic-tutorial-connect-and-test">
    Walk through the initial setup to connect a data source and run your first query.
  </Card>
</CardGroup>
