Governance starts with discovery.
Before a single masking policy can be authored, the governance team needs to know what data exists, where it lives, what category it falls into (PII, PHI, financial), what objects depend on it, and which queries touched it.
Snowflake collapses these four needs into four built-in facilities:
- object tags
- the classification system
- Access History plus the lineage graph
- the Object Dependencies view
Each surfaces metadata that downstream policies consume, and each writes into SNOWFLAKE.ACCOUNT_USAGE for long-horizon audit.
Limits and quotas
The trade-off is that all four facilities have latency, eventual consistency, or edition tier constraints. The exam tests the boundary cases:
- classification only runs on tables under the schema or database where AUTO_TAG is enabled
- Object Dependencies excludes external function endpoints
- Access History latency runs up to 180 minutes for object-level reads
- tag inheritance walks from account through database, schema, table, and column in that order
A practitioner who treats the four as a single magic layer will pick wrong answers.
Object tagging mechanics
A tag is a schema-level object with an optional ALLOWED_VALUES list. Once created, the same tag can be applied to any number of objects: warehouses, databases, schemas, tables, views, columns, pipes, stages, masking policies, and even other tags.
Tags inherit downward through the object hierarchy. A tag set on a database flows to every schema and every table inside it, until an overriding value at a lower level replaces it.
Inheritance is read-only at the lower level: TAG_REFERENCES reports both directly assigned tags and inherited tags, but only the assignment at the binding scope can be unset.
CREATE OR REPLACE TAG governance.tags.cost_center
ALLOWED_VALUES 'finance', 'marketing', 'eng', 'ops'
COMMENT = 'Chargeback dimension for warehouse and storage metering';
ALTER WAREHOUSE etl_wh SET TAG governance.tags.cost_center = 'eng';
ALTER DATABASE customer_db SET TAG governance.tags.cost_center = 'marketing';
ALTER TABLE customer_db.public.orders
MODIFY COLUMN customer_email SET TAG governance.tags.pii_category = 'email';
The metadata layer behind tags is the SNOWFLAKE.ACCOUNT_USAGE.TAG_REFERENCES view plus the per-database INFORMATION_SCHEMA.TAG_REFERENCES table function. The account-level view has a latency of up to 2 hours, which matters when an auditor expects a freshly assigned tag to appear in a discovery query and finds nothing. For point-in-time freshness, INFORMATION_SCHEMA.TAG_REFERENCES_ALL_COLUMNS('customer_db.public.orders', 'TABLE') returns the live state.
💡 Exam Trap: Tag references through
ACCOUNT_USAGE.TAG_REFERENCESlag by up to 2 hours. Test questions that ask for the canonical real-time inventory of tagged columns expect theINFORMATION_SCHEMA.TAG_REFERENCES_ALL_COLUMNStable function orSYSTEM$GET_TAG('tag_name', 'object_name', 'object_domain'), not the account-level view.
📊 Limit: A single object may carry up to 50 unique tag keys; the value string is capped at 256 characters; allowed-value lists may hold up to 300 string values per tag.
System tags ship under SNOWFLAKE.CORE. The four most exam-relevant are SEMANTIC_CATEGORY (broad categories such as IDENTIFIER, QUASI_IDENTIFIER, SENSITIVE), PRIVACY_CATEGORY (PII, indirect identifier, sensitive), DATA_QUALITY (used by Data Metric Functions), and the data-clean-room provenance tags. Custom tags coexist with system tags on the same column.
Data classification workflow
Classification populates the two system tags SEMANTIC_CATEGORY and PRIVACY_CATEGORY automatically.
How it works
Two execution paths exist.
- The first is on-demand classification through
EXTRACT_SEMANTIC_CATEGORIES, which scans a sample of rows and returns a JSON document of inferred categories per column. - The second is automatic classification, configured by setting the
AUTO_TAGparameter on a schema (or database) toTRUE.
Once enabled, Snowflake samples newly created tables in scope and writes the system tags asynchronously through the serverless classification service.
ALTER SCHEMA customer_db.public SET AUTO_TAG = TRUE;
ALTER SCHEMA customer_db.public SET CLASSIFICATION_PROFILE = 'governance.profiles.gdpr_profile';
-- Manual on-demand path:
SELECT EXTRACT_SEMANTIC_CATEGORIES('customer_db.public.orders', 10000);
-- Apply the categories detected above as system tags:
CALL ASSOCIATE_SEMANTIC_CATEGORY_TAGS(
'customer_db.public.orders',
EXTRACT_SEMANTIC_CATEGORIES('customer_db.public.orders')
);
A Classification Profile is the configuration object that pins which categories to detect, which custom classifiers to apply, the sampling row count (default 10,000, maximum 100,000), and the minimum statistical confidence required before a category is asserted.
Custom classifiers are created with SNOWFLAKE.DATA_PRIVACY.CUSTOM_CLASSIFIER and supply a regex plus a semantic and privacy category label.
They run alongside the built-in classifiers; conflicts resolve in favor of the highest-confidence match.
💡 Exam Trap: Automatic classification skips tables that already have explicit
SEMANTIC_CATEGORYorPRIVACY_CATEGORYvalues on any column. The presence of one manual tag suppresses the auto-scan on the whole table. Strip manual values from tables you want re-classified, or move them to a different schema.
⚠️ Anti-Pattern: Running
EXTRACT_SEMANTIC_CATEGORIESinside a Task that fires every minute. The function reads sampled rows, consumes warehouse credits per call, and produces unstable output when sample data varies. Schedule classification on a daily or weekly cadence, or rely on automatic classification with a Classification Profile.
Data lineage tracking
Lineage answers "which objects fed this column, and which downstream consumers read it." Snowflake exposes lineage through three surfaces.
- The Snowsight Catalog UI renders an interactive graph of upstream and downstream objects.
- The programmatic surface is the
SNOWFLAKE.CORE.GET_LINEAGEtable function plus theACCESS_HISTORYview inACCOUNT_USAGE, which records every query and the base objects it read or wrote.
Object-level Access History latency runs from 45 minutes up to 180 minutes; column-level Access History writes are batched on a separate cadence and may take longer.
-- Upstream lineage two hops back from a target table:
SELECT *
FROM TABLE(SNOWFLAKE.CORE.GET_LINEAGE(
'analytics.public.daily_revenue',
'TABLE',
'UPSTREAM',
2
));
-- Which queries read a PII column in the last 30 days:
SELECT user_name, query_id, query_start_time, direct_objects_accessed
FROM SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY
WHERE query_start_time > DATEADD(day, -30, CURRENT_TIMESTAMP())
AND ARRAY_CONTAINS('customer_db.public.orders.customer_email'::variant,
direct_objects_accessed);
Column-level lineage is captured only when ENABLE_COLUMN_LINEAGE is TRUE (the account default) and the query references the column in a SELECT, INSERT ... SELECT, MERGE, CREATE TABLE AS, or CREATE VIEW AS. Inserts from VALUES literals or Snowpipe loads do not create column lineage edges because no source column exists.
This matters when a chain like RAW -> STAGED -> CURATED is built with Snowpipe at the leaf and the lineage graph appears to start one layer above the true source.
Object dependency monitoring
SNOWFLAKE.ACCOUNT_USAGE.OBJECT_DEPENDENCIES is a structural view, not a runtime view.
It records the parse-time dependencies that exist when an object is created:
- a view depends on its base tables,
- a stored procedure depends on the tables it references in DDL form,
- a masking policy depends on the columns it is attached to.
The view is the trusted source for impact analysis before a DROP or schema change, because it returns dependencies regardless of whether the dependent object has been queried.
-- Find every object that would break if I drop customer_db.public.orders:
SELECT referencing_object_domain,
referencing_database || '.' || referencing_schema || '.' || referencing_object_name AS dependent,
dependency_type
FROM SNOWFLAKE.ACCOUNT_USAGE.OBJECT_DEPENDENCIES
WHERE referenced_object_name = 'ORDERS'
AND referenced_schema_name = 'PUBLIC'
AND referenced_database_name = 'CUSTOMER_DB';
📊 Limit:
OBJECT_DEPENDENCIESlatency runs up to 3 hours. For real-time dependency checks before a destructive DDL, runSHOW OBJECTS IN ACCOUNT LIKEand the per-databaseINFORMATION_SCHEMA.OBJECT_DEPENDENCIESview which is live.
Dependencies are not recorded for external function endpoints (the function itself appears, but the remote URL is opaque), for parameters resolved at runtime (a stored procedure that builds dynamic SQL through EXECUTE IMMEDIATE will not record the runtime-resolved tables as dependencies), and for objects in databases the executing role cannot see.
Discovery flow
🎯 Scenario: A GDPR audit requests proof that every column tagged
PRIVACY_CATEGORY = 'IDENTIFIER'has had a masking policy applied within 24 hours of classification. The implementation joinsTAG_REFERENCES_ALL_COLUMNStoPOLICY_REFERENCESon the same column reference, filters wherePOLICY_NAME IS NULL, and triggers an Alert when the result set is non-empty. The Alert fires a notification integration to the security team and the masking-policy attachment is performed within the SLA.
Decision Anchor
Choose AUTO_TAG with a Classification Profile when:
- the table population in scope is large,
- ownership is distributed across teams,
- the discovery team cannot keep up with manual scans.
Choose on-demand EXTRACT_SEMANTIC_CATEGORIES when classification must run against a snapshot at a controlled point in time, such as a quarterly compliance attestation, where serverless cost predictability matters more than continuous coverage.
