Before you beginSet up the Maple Market governance lab
Identify sensitive data before choosing a control
Customer tables arrive from several systems. Searching for column names like EMAIL can miss a field named CONTACT_VALUE. Classification collects evidence about what a column contains. A semantic category describes the kind of value, such as a name or an email address. A privacy category describes how it relates to a person, such as an identifier. A number may be sensitive by business context even if it is not recognized as an identifier.
Start with a manual review of a few fictional rows. A steward checks field purpose, likely sensitivity and exceptions. Then use Snowflake Sensitive Data Classification, an Enterprise Edition feature, to suggest categories by examining metadata and samples. Keep a record of the approved labels. These labels do not change query results on their own.
| Field | Example | Teaching classification | Handling |
|---|---|---|---|
| FULL_NAME | Asha Rao | Candidate NAME; identifier | Full contact only for Support |
| asha@example.invalid | Candidate EMAIL; identifier | Mask by role and verified flag | |
| PHONE | +1-202-555-0101 | Candidate PHONE_NUMBER; identifier | Full contact only for Support |
| CREDIT_LIMIT | 2500 | Sensitive financial data by business policy | Keep out of the contact view |
| CONTACT_VERIFIED | TRUE | Operational flag | Use for policy input. Omit from the consumer view. |
Run a one-time classification and review the output
Use the setup’s owner role and the approved active warehouse. Call SYSTEM$CLASSIFY with auto_tag false to review recommendations first. In the returned object, open classification_result, then the column name and recommendation. Read semantic_category, privacy_category, confidence and coverage. Coverage describes the share of sampled values that matched. This tiny synthetic sample and reserved email domains may not match the patterns or confidence needed for automated detection.
Compare suggestions with the steward table. A false positive could be a product code mistaken for a phone. A false negative could be a field the classifier could not recognize from a sparse or unusual sample. Spot-check with the data owner in an approved role, document exceptions and avoid copying source values into tickets.
| Column | Possible recommendation | Steward decision |
|---|---|---|
| EMAIL / IDENTIFIER | Approve restricted handling | |
| PHONE | PHONE_NUMBER / IDENTIFIER | Confirm the field meaning |
| CREDIT_LIMIT | No recommendation | Retain restricted financial label |
USE ROLE M18_OWNER;
CALL SYSTEM$CLASSIFY('LS_M18_GOV_LAB.CORE.CUSTOMERS', {'auto_tag': false});Configure recurring classification with a profile
A profile stores scope and behavior so someone does not have to run a scan for every new table. Run this optional Enterprise example in the lab only. An administrator grants SNOWFLAKE.CLASSIFICATION_ADMIN, CREATE SNOWFLAKE.DATA_PRIVACY.CLASSIFICATION_PROFILE on the GOV schema and APPLY TAG on ACCOUNT to M18_OWNER. Setting the database profile requires EXECUTE AUTO CLASSIFICATION on the database, which its owner has by default, and ownership or the appropriate instance role on the profile.
CUSTOM gives the lab a known scheduling setup. Zero minimum age includes newly eligible objects. Validity of 30 days is for classification results, not data retention or a fixed run interval. auto_tag false leaves tagging under steward control. classify_views false limits the scope to eligible tables. There is an initial delay, so the result does not appear immediately.
Give the lab role access to create and apply the profile
Run only as an authorized administrator in the isolated lab. The account-level tag grant is also needed for the optional automatic propagation exercise.
USE ROLE ACCOUNTADMIN;
GRANT DATABASE ROLE SNOWFLAKE.CLASSIFICATION_ADMIN TO ROLE M18_OWNER;
GRANT CREATE SNOWFLAKE.DATA_PRIVACY.CLASSIFICATION_PROFILE
ON SCHEMA LS_M18_GOV_LAB.GOV TO ROLE M18_OWNER;
GRANT APPLY TAG ON ACCOUNT TO ROLE M18_OWNER;Create the review profile and set its database scope
USE ROLE M18_OWNER;
USE SCHEMA LS_M18_GOV_LAB.GOV;
CREATE SNOWFLAKE.DATA_PRIVACY.CLASSIFICATION_PROFILE CUSTOMER_REVIEW(
{'scheduling_mode':'CUSTOM',
'minimum_object_age_for_classification_days':0,
'maximum_classification_validity_days':30,
'auto_tag':false, 'classify_views':false});
SELECT CUSTOMER_REVIEW!DESCRIBE();
ALTER DATABASE LS_M18_GOV_LAB
SET CLASSIFICATION_PROFILE = 'LS_M18_GOV_LAB.GOV.CUSTOMER_REVIEW';Read a stored result and stop the background configuration
Run the CALL after the automated classification has had time to run. A missing or empty result calls for checking start time, object type, age, access and classifier support. Run the UNSET after you finish reading results. Disable the profile when the lab ends and revoke any lab-only grants through the administrator.
CALL SYSTEM$GET_CLASSIFICATION_RESULT('LS_M18_GOV_LAB.CORE.CUSTOMERS');
ALTER DATABASE LS_M18_GOV_LAB UNSET CLASSIFICATION_PROFILE;Turn reviewed classifications into a protection decision
Run the tag lesson’s setup first. After approval, mark the remaining customer fields, salary and the buyer email as restricted using the custom tag. This gives the audit a stable inventory. A classification profile can optionally use auto_tag true to set system labels and a tag map to map semantic categories to custom labels. Turn auto-tagging on only with an approved mapping and a test for existing policies. Current automatic scheduling Autopilot and AI-assisted classification modes are documented as open preview; this lab uses neither.
The consumer view will omit CREDIT_LIMIT. The email masking policy changes the value readers see. Recheck both at the query surface where people work. If a team adds the omitted column to a view later, repeat the access tests.
- Inspect a sampleSuggest categories to Review suggestions
- Review suggestionsApprove labels to Apply controls
- Apply controlsEnforce and verify to Test under real roles
- Inspect a sample
- Look at the field and its purpose.
- Review suggestions
- Confirm meaning and record exceptions.
- Apply controls
- Use tags, grants and policies for their specific jobs.
- Test under real roles
- Verify allowed and restricted output.
USE ROLE M18_OWNER;
ALTER TABLE LS_M18_GOV_LAB.CORE.CUSTOMERS MODIFY COLUMN FULL_NAME
SET TAG LS_M18_GOV_LAB.GOV.SENSITIVITY = 'restricted';
ALTER TABLE LS_M18_GOV_LAB.CORE.CUSTOMERS MODIFY COLUMN PHONE
SET TAG LS_M18_GOV_LAB.GOV.SENSITIVITY = 'restricted';
ALTER TABLE LS_M18_GOV_LAB.CORE.CUSTOMERS MODIFY COLUMN CREDIT_LIMIT
SET TAG LS_M18_GOV_LAB.GOV.SENSITIVITY = 'restricted';
ALTER TABLE LS_M18_GOV_LAB.CORE.EMPLOYEES MODIFY COLUMN SALARY
SET TAG LS_M18_GOV_LAB.GOV.SENSITIVITY = 'restricted';
ALTER TABLE LS_M18_GOV_LAB.CORE.SALES MODIFY COLUMN BUYER_EMAIL
SET TAG LS_M18_GOV_LAB.GOV.SENSITIVITY = 'restricted';Recognize an internal customer code with a custom classifier
A company-specific code can identify a customer even when it has no standard format. In this optional Enterprise example, Maple Market uses MM- followed by four digits. The administrator grants the owner the SNOWFLAKE.CLASSIFICATION_ADMIN database role and CREATE SNOWFLAKE.DATA_PRIVACY.CUSTOM_CLASSIFIER on the GOV schema. The regular expression checks the entire value. THRESHOLD is the fraction of sampled values required to match the rule.
The pattern query returns five matches out of six. LIST verifies the saved rule. A classify call can recommend MAPLE_CUSTOMER_CODE for LOCAL_CODE, but the result is still a sampled suggestion. A code with the same shape in a different dataset may have a different meaning. Use owner review before applying a label.
USE ROLE M18_OWNER;
USE SCHEMA LS_M18_GOV_LAB.GOV;
CREATE TABLE LOCAL_CUSTOMER_CODES (LOCAL_CODE VARCHAR);
INSERT INTO LOCAL_CUSTOMER_CODES VALUES
('MM-0101'),('MM-0102'),('MM-0103'),('MM-0104'),('MM-0105'),('bad-code');
SELECT COUNT(*) AS MATCHES FROM LOCAL_CUSTOMER_CODES
WHERE LOCAL_CODE REGEXP '^[Mm][Mm]-[0-9]{4}$';
CREATE SNOWFLAKE.DATA_PRIVACY.CUSTOM_CLASSIFIER MAPLE_IDS();
CALL MAPLE_IDS!ADD_REGEX(
SEMANTIC_CATEGORY => 'MAPLE_CUSTOMER_CODE', PRIVACY_CATEGORY => 'IDENTIFIER',
VALUE_REGEX => '^MM-[0-9]{4}$', COL_NAME_REGEX => '^LOCAL_CODE$', THRESHOLD => 0.8);
SELECT MAPLE_IDS!LIST();
CALL SYSTEM$CLASSIFY('LS_M18_GOV_LAB.GOV.LOCAL_CUSTOMER_CODES',
{'custom_classifiers':['LS_M18_GOV_LAB.GOV.MAPLE_IDS'], 'auto_tag':false});Interview practice
Explain the decision and the evidence you would use to test it.
Does classification protect an email?
It describes the data. I still need approved grants and a policy or a view that controls how readers get it.
How do you compare manual and automated classification?
I use a targeted manual scan to review the suggestion and check known fields. I use a profile for repeated discovery and record owner-approved exceptions when it misses a business-sensitive field.
A classifier misses a credit limit. What happens next?
I check the field purpose with Finance, apply our restricted business tag and keep the column out of reporting. Then I verify the rule with a reader role. I track the discovery gap without dropping the protection.
Words used in this lesson
- Semantic category
- What the values represent, such as an email address.
- Privacy category
- How a classified field relates to an individual.
- Classification profile
- Saved instructions for recurring classification.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Snowflake sensitive data classification and profiles
From a classification suggestion to a tested rule
The steward approves the label, and a separate step enforces access.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- From a classification suggestion to a tested rule
The steward approves the label, and a separate step enforces access.
Inspect a sample → Review suggestions → Apply controls → Test under real roles
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
All records are fictional. Outputs are expected or simulated. Live practice needs an authorized scratch account, test roles, an approved warehouse and the editions listed in the lesson.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
Choose a control for an analyst who needs email domains but cannot see mailbox names.
Compare your reasoning
Expose the permitted output through a masking policy checked using the analyst role. Review whether the domain itself is sensitive.
Connect this lesson to the learning path
Official sources and curriculum
Module 18 · See module scope
By Rohit Ray · Independent educational lesson · Explore this visual lab