Data masking rule configuration

Updated at:

You can use natural language prompts to direct code agents, such as Qoder and CodeX, to analyze data masking requirements, perform prerequisite checks for data classification and grading, and generate a list of required masking rule parameters. This topic describes the capability's features, prerequisites, examples, and expected results, and provides a reference list of required inputs in the appendix.

Overview

The data masking rule configuration skill helps you prepare for masking sensitive columns, such as phone numbers, ID numbers, email addresses, and names, by using natural language prompts. This capability performs three primary tasks: First, it analyzes requirements by converting natural language requests about target columns, masking algorithms, application scenarios, allowlists, and validation methods into a clear parameter list. Second, it performs a prerequisite check using available data classification and grading commands to confirm that target columns have the necessary security labels, a common prerequisite for masking rules. Third, it notifies you of capability limitations by specifying which operations are not yet supported by public commands.

Use cases:

  • Prepare to configure data masking for sensitive columns, such as masking the middle four digits of a phone number, preserving only the first and last digits of an ID number, or masking part of an email address.

  • Before you configure data masking, confirm that the target columns have the required tags from data classification and grading.

  • Generate a complete list of data masking parameters for subsequent configuration on the product UI or for internal approval processes.

Note

Limitations: Currently, public commands do not support creating, updating, enabling, disabling, or deleting masking rules, nor do they manage allowlists or default masking configurations. Therefore, this skill does not create or modify any masking rules. It only analyzes requirements, performs prerequisite checks for data classification and grading, and outputs a parameter list. Although having a classification or grading tag on a column is a prerequisite for data masking, it does not mean a masking rule has been created or is active. You must configure the masking rules on the Dataphin UI or wait for the corresponding public APIs to become available.

Prerequisites

  • Your account has the required permissions for data security management in Dataphin.

  • You have identified the target columns, including the table catalog, table name, and column name.

  • Masking rules typically depend on a column's classification or grading labels. If a target column is not yet tagged, you must first complete data classification and grading.

Examples

You can describe your requirements to the agent by using natural language. The following are sample prompts you can copy and use:

  • I want to configure masking for the phone number column in this table to mask the middle four digits with asterisks. Help me list the required information.

  • First, check if this column has a classification and grading tag and whether I can configure data masking for it directly.

  • Help me create a requirements list for masking an ID number column, including the algorithm, scope, and allowlist.

Interaction steps:

  1. After you submit a masking request, the agent confirms the target columns, the desired masking algorithm, the application scenarios, and whether an allowlist is needed.

  2. The agent typically first checks if the target columns have classification or grading tags and then reports the associated binding information.

  3. If a column is not yet tagged, the agent usually advises you to complete data classification and grading before proceeding with the masking request.

  4. The agent organizes and outputs a complete parameter list for your masking requirements, while also clearly stating the limitation that current public commands do not support write operations for masking rules.

Results

After the operation is complete, you will receive the following results:

  • Output: The verification results of data classification and grading tags for the target columns, the associated classification and grading binding information, and a parameter list that includes columns, classifications, masking algorithms, scopes, application scenarios, allowlists, and validation methods.

  • Completion Status: The operation is considered successful when the prerequisite checks are complete and the requirements list is delivered. Success does not mean "a masking rule has been created."

  • Verification and Validation: You can use this list to configure masking rules on the Dataphin UI. If a column is missing the necessary tags, use the data classification and grading capability to add them before configuring data masking.

Note

This capability currently does not create or modify any masking rules. It only analyzes requirements and performs prerequisite checks. The activation of a masking rule depends on its configuration on the Dataphin UI.

Appendix: Input

The following table lists the information that may be required to configure a data masking rule. This list is for reference. The agent automatically identifies necessary information from your prompts and asks for anything missing. You do not need to provide items marked as "not required," as the system generates them automatically.

Parameter

Required

Description

Example

Tenant ID

Yes

The 19-digit ID of the target Dataphin tenant.

1234567890123456789

Table catalog

Yes

For a logical table, this is typically the English name of the business domain. For a physical table, it is the project's English name. For a data source table, it is the database or schema.

my_project

Table name

Yes

The name of the target table that contains the column to be masked.

dim_product

Field name

Yes

The name of the column to mask.

phone, id_card, email

Category ID

Conditionally required

The data category ID for the column. Masking rules are typically bound to categories. The agent can retrieve this value for you.

—

Masking algorithm

Yes

The masking algorithm to use, such as mask, hash, format-preserving encryption, or no masking. The available options depend on your tenant's enumerations.

MASK, MD5, FPE_FF1_ENCRYPT

Scope

Yes

The effective scope of the masking rule, such as a business domain, project, platform, or scenario. Applying the rule to the entire tenant by default is not recommended.

PROJECT

Application scenario

No

The use cases where data masking is applied, such as ad-hoc queries or read/write development.

TEMP_QUERY, WRITE_DEV

Allowlist account

Conditionally required

Accounts allowed to bypass data masking. An allowlist is a high-risk exception that requires separate confirmation.

—

Allowlist effective date

Conditionally required

The start and end dates for bypassing data masking for allowlisted accounts.

—