Snowflake CLI
database.snowflake
Protects modern `snow sql` queries, files, stdin, nested sources, data, ingestion, compute, and account privileges
- 51blocking rules
- 0safe patterns
- 10Critical
- 27High
- 14Medium
[packs]
enabled = ["database.snowflake"]Evaluated when a command contains snow, snowsql, Snow, SNOW, DROP, drop, TRUNCATE, truncate, DELETE, delete.
Blocking rules
Each rule ID is database.snowflake:<name>. Use it in allowlists and [policy.rules].
Criticalcli-object-drop-databasesnow object drop database/schema removes the object and everything inside it.
Explanation
Dropping a database or schema removes ALL contained objects (tables, views, stages, pipes, tasks, functions). Time Travel/UNDROP recovery is conditional on retention, edition, and privileges - it is not a substitute for preventing the drop. Verify with `snow object list database` / `snow object describe` and consider `CREATE DATABASE <name>_backup CLONE <name>` first.
Criticaldelete-allDELETE without a top-level WHERE clause removes every row.
Explanation
Add a reviewed WHERE predicate and run the equivalent SELECT and COUNT first.
Criticaldrop-databaseDROP DATABASE removes the database and every contained schema and object.
Explanation
Snowflake Time Travel and UNDROP are conditional on object support, retention, privileges, and subsequent operations; they are not a substitute for preventing the drop.
Criticaldrop-schemaDROP SCHEMA removes the schema and can remove all contained objects.
Explanation
Review the schema contents, prefer RESTRICT where supported, and clone the schema before broad DDL.
Criticaldrop-tableDROP TABLE removes the active table and its data.
Explanation
Verify the fully qualified target, inspect retention, and create a zero-copy clone before dropping the table.
Criticalreplace-databaseCREATE OR REPLACE DATABASE replaces a live database.
Explanation
Create and validate a separate database or clone instead of replacing the active database in place.
Criticalreplace-schemaCREATE OR REPLACE SCHEMA replaces a live schema.
Explanation
Clone the schema and test the migration against the clone before changing production.
Criticalreplace-tableCREATE OR REPLACE TABLE replaces the active table.
Explanation
Build and validate a separate table or clone, then use a reviewed cutover operation.
Criticaltruncate-tableTRUNCATE TABLE removes every row from the target table.
Explanation
Preview the row count and clone the table before truncating it.
Criticalupdate-allUPDATE without a top-level WHERE clause modifies every row.
Explanation
Add a reviewed WHERE predicate and preview the exact target rows first.
Highalter-table-drop-columnALTER TABLE DROP COLUMN removes a column and its active data.
Explanation
Clone the table and validate all downstream consumers before removing the column.
Highalter-table-swapALTER TABLE SWAP WITH exchanges table identities atomically.
Explanation
Verify both fully qualified tables and compare row counts and schemas before swapping.
Highbroad-grantGRANT creates account-wide, all-privilege, or ACCOUNTADMIN access.
Explanation
Grant only the required privileges on specific objects to a least-privilege role.
Highbroad-revokeREVOKE removes broad privileges or role membership and can break applications immediately.
Explanation
Review current grants and identify every affected principal before revoking access.
Highcli-app-teardownsnow app teardown drops the Native App and (with --cascade) its owned objects.
Explanation
snow app teardown drops the application object and the application package's development artifacts; with --cascade it also drops objects the app owns, databases included. Anyone using the app loses access immediately.
Highcli-object-dropsnow object drop permanently removes a Snowflake object.
Explanation
snow object drop removes tables, views, stages, streams, tasks, warehouses, users, roles, integrations, and more; --force skips the confirmation prompt. Dropping shared infrastructure can break applications and automation immediately. Inspect first with `snow object describe <type> <name>`.
Highcli-spcs-dropsnow spcs ... drop removes container services infrastructure.
Explanation
Dropping an SPCS service stops and removes the running workload; dropping a compute pool removes the compute for every service on it; dropping an image repository deletes the stored images.
Highcli-stage-dropsnow stage drop removes the stage; internal staged files are not recoverable.
Explanation
Dropped stages cannot be recovered - internal stage files are gone, and workflows (COPY INTO, Snowpipe) referencing the stage break immediately. List contents first with `snow stage list-files <stage>`.
Highcli-stage-removesnow stage remove deletes files from a stage.
Explanation
Files removed from an internal stage are not covered by Time Travel. Ingestion pipelines expecting those files will silently see nothing to load. Preview with `snow stage list-files <stage>` and consider copying the files out first.
Highcopy-overwriteCOPY INTO a location with OVERWRITE = TRUE can replace exported files.
Explanation
Export to a versioned path and LIST the destination before copying.
Highdrop-data-productDROP removes a live view, materialized view, or dynamic table.
Explanation
Inspect dependencies and validate a replacement object before removing the live query surface.
Highdrop-ingestion-objectDROP removes a live stage, pipe, stream, or task.
Explanation
Inspect pipeline dependencies and state before removing an ingestion or scheduling object.
Highdrop-principalDROP USER or DROP ROLE can break services and revoke access hierarchies.
Explanation
Review grants and dependencies, then disable access reversibly before deleting a principal.
Highdrop-security-objectDROP removes a live integration, network policy, or share.
Explanation
Review all consumers, grants, and recovery options before removing the security or sharing object.
Highdrop-warehouseDROP WAREHOUSE removes compute used by applications, tasks, or users.
Explanation
Inspect warehouse consumers and prefer a reversible suspend only after reviewing active workloads.
Highexecute-taskEXECUTE TASK immediately starts a task run and may cascade a task graph.
Explanation
Inspect the task definition, owner privileges, graph dependencies, and active runs before forcing execution.
Highinsert-overwriteINSERT OVERWRITE replaces the target table's current rows.
Explanation
Write to and validate a separate table before a reviewed cutover.
Highinteractive-edit!edit executes SQL modified in an external editor that dcg cannot inspect in advance.
Explanation
Materialize the final SQL in a reviewed local file and execute it with snow sql -f.
Highpause-pipeALTER PIPE pauses ingestion and can silently make downstream data stale.
Explanation
Inspect pipe status and downstream freshness requirements before pausing ingestion.
Highput-overwritePUT with OVERWRITE = TRUE can replace files in an internal stage.
Explanation
Upload to a versioned stage path and LIST existing files first.
Highremove-stage-filesREMOVE deletes files from an internal Snowflake stage.
Explanation
LIST the exact stage path and verify retention or a backup before removing files.
Highreplace-live-objectCREATE OR REPLACE replaces a live Snowflake object and may lose grants, state, or configuration.
Explanation
Create and validate a separate object before changing the live definition.
Highshell-escape!system runs a shell command from inside the SnowSQL session, outside dcg's shell analysis.
Explanation
SnowSQL's !system passes its operand to the operating-system shell. Run that command directly in the shell instead, where dcg evaluates it like any other command.
Highstdin-unverifiedsnow sql receives SQL or a source that dcg cannot completely verify.
Explanation
Materialize the exact rendered SQL, keep all !source inputs local, and review every statement before execution.
Highsuspend-taskALTER TASK SUSPEND stops scheduled execution.
Explanation
Inspect task dependencies and active runs before suspending the task.
Highsuspend-warehouseALTER WAREHOUSE SUSPEND can interrupt active or queued workloads.
Explanation
Inspect active queries and dependent tasks before suspending compute.
Hightransfer-ownershipGRANT OWNERSHIP transfers control and can revoke or copy existing grants.
Explanation
Inventory outbound privileges and review COPY/REVOKE CURRENT GRANTS semantics before transferring ownership.
Mediumabort-query!abort cancels an active Snowflake query.
Explanation
Inspect query history and confirm the exact query ID before aborting it.
Mediumalter-columnALTER TABLE ALTER COLUMN can break writes and downstream consumers.
Explanation
Validate type, nullability, default, and policy changes against a clone first.
Mediumbounded-deleteDELETE mutates every row selected by its WHERE predicate.
Explanation
Run the equivalent SELECT and COUNT against a clone before deleting rows.
Mediumbounded-updateUPDATE mutates every row selected by its WHERE predicate.
Explanation
Preview affected rows and validate the update against a clone first.
Mediumcli-app-version-dropsnow app version drop removes a Native App version definition.
Explanation
Dropping an application package version prevents new installs and upgrades of that version; releases pinned to it break.
Mediumcli-dbt-dropsnow dbt drop removes a dbt project object from Snowflake.
Explanation
snow dbt drop removes the named DBT PROJECT object; scheduled `snow dbt execute` runs and tasks referencing it fail until it is redeployed.
Mediumcli-dcm-dropsnow dcm drop removes a DCM project object from Snowflake.
Explanation
snow dcm drop removes the named DCM PROJECT object, including its deployment history in Snowflake.
Mediumcli-snowpark-dropsnow snowpark drop removes a deployed procedure or function from Snowflake.
Explanation
snow snowpark drop function/procedure drops the named object from Snowflake. Downstream callers (tasks, other procedures, applications) fail until it is redeployed.
Mediumcopy-into-tableCOPY INTO a table can load duplicate, corrupt, or unexpected data.
Explanation
Validate the staged files and load into a clone or scratch table first.
Mediumdrop-programmable-objectDROP removes a file format, sequence, function, or procedure used by workloads.
Explanation
Inspect object dependencies and preserve the current definition before removal.
Mediumexecute-immediateEXECUTE IMMEDIATE runs generated SQL whose rendered semantics require explicit review.
Explanation
Materialize and review the exact rendered SQL, including templates and variables, before executing it.
Mediummerge-dataMERGE can update, insert, or delete rows based on source matching.
Explanation
Validate source uniqueness and preview matched and unmatched rows against a clone.
Mediumrename-objectRenaming a database, schema, or table can break fully qualified consumers.
Explanation
Inventory consumers and stage a coordinated cutover before renaming the object.
Mediumwarehouse-settingsALTER WAREHOUSE SET can create availability or cost risk.
Explanation
Review active consumers, size, scaling, and auto-suspend settings before applying changes.