
## Use AI-suggested rules

URL: https://docs.atlan.com/product/capabilities/governance/data-quality/how-tos/use-ai-suggested-rules

> Let Atlan suggest data quality rules automatically based on your asset's metadata structure, and apply them in a few clicks.

Atlan AI automatically suggests data quality rules based on your asset's metadata structure. Suggestions are generated from column names, data types, descriptions, and other metadata attributes. Common suggested rules include null and blank validations, uniqueness checks, duplicate detection, freshness monitoring, and volume checks. You can review, adjust thresholds, and apply the suggestions in a few clicks.

## Prerequisites

- Atlan AI must be enabled with the **Enrich metadata** setting in Admin → Labs → Atlan AI. See [Enable Atlan AI](https://docs.atlan.com/llms/governance/atlan-ai/what-is-atlan-ai/llms.txt).
- You need permission to create rules. See Data quality permissions for [Snowflake](https://docs.atlan.com/llms/governance/data-quality/data-quality-permissions/llms.txt) or [Databricks](https://docs.atlan.com/llms/governance/data-quality/data-quality-permissions/llms.txt).
- Supported platforms: **Snowflake** and **Databricks**.

## Generate AI-suggested rules

Atlan AI analyzes your asset's structure to suggest relevant data quality rules automatically. The quality of suggestions depends on your asset metadata—column names, data types, descriptions, database, and schema information. Make sure your catalog metadata is up to date for the best results.

1. In Data Quality Studio, navigate to the asset where you want to add rules.

2. Atlan AI analyzes your asset's metadata and generates a list of suggested rules. Click **Add rule** (or open an existing rule set), then click **Suggest rules** beside **Add rule**.

3. Review the suggested rules. Typical suggestions include null counts, blank counts, freshness checks, duplicate detection, and volume checks.

4. Select the rules you want to apply. Adjust thresholds and parameters as needed. Adjust thresholds before applying suggestions to match your data quality requirements.

5. Click **Apply** to add the selected rules to your rule set.

6. Configure any additional settings, then save your rule set.

## Generate custom SQL rules with Copilot

For custom validation logic beyond predefined rules, Copilot can generate SQL-based rules from natural-language descriptions. This helps you create complex rules without writing SQL from scratch.

1. Click **Add rule**, then select **Custom SQL**.

2. In the Custom SQL dialog, under **SQL Query**, click **Ask AI to generate code**.

3. Describe the rule in natural language. For example, "flag rows where `status` not in ('ACTIVE','INACTIVE')." or "percent of nulls in `email` < 1%."

4. Copilot generates SQL tailored to your asset's context, including columns, data types, descriptions, database, and schema. Always review and validate Copilot-generated SQL before saving to confirm it matches your requirements. Review and edit the proposed SQL. Click **Test SQL Query** to validate.

5. Set **Pass if query result is** and select the **Dimension**.

6. Click **Create** to save the rule.

## Need help

If you have questions or need assistance, reach out to Atlan Support by [submitting a support request](https://docs.atlan.com/support/submit-request).

## See also

- [Rules and dimensions](https://docs.atlan.com/llms/governance/data-quality/data-quality-rules/llms.txt): Explore all supported rule types and quality dimensions
- [Rule types and failed rows validations](https://docs.atlan.com/llms/governance/data-quality/rule-types-and-failed-rows/llms.txt): Reference guide for available rule types and how failed rows validation works

---
