What you will be able to do
- Identify every destination an unload with COPY INTO can write to and the parameter that closes each one
- Set the account-level parameters that close inline-URL, external-stage and internal-stage unload destinations
- Choose between PREVENT_UNLOAD_TO_INLINE_URL, REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION and REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION for a given exfiltration pattern
- State which unload parameters can be overridden per user and which are account-only
- Restrict Snowsight result downloads with a UI_DOWNLOAD data movement rule and name the retrieval paths that rule does not cover
Key concept
Unload destination control — An unload with COPY INTO can write to an inline cloud URL, a named external stage, or an internal stage. Each account-level exfiltration parameter closes one of those destinations, so a lockdown is only complete when every destination is either closed or tied to an approved bucket.
1.Where COPY INTO can write
Data exfiltration in Snowflake usually means one statement: COPY INTO <location>. It takes a table or any SELECT, including joins across many tables, and writes the result as files. Because the source can be an arbitrary query, any data a role can read, it can also unload.
The statement can write to three kinds of target:
- an internal stage: a named internal stage, a table stage (
@%table) or the user stage (@~), from which files are pulled down with the GET command - a named external stage that points at Amazon S3, Google Cloud Storage or Microsoft Azure
- an external location typed straight into the statement as a URL such as
's3://bucket/path', with credentials or aSTORAGE_INTEGRATIONalongside it
The third target is the most dangerous one. Anyone who holds keys for a bucket can name it inline with CREDENTIALS = (AWS_KEY_ID = ... AWS_SECRET_KEY = ...) and the data leaves the account. Credentials are only needed for private storage. They are not required for public buckets or containers, so an inline URL can send data to a world-readable bucket with no keys at all.
No single setting closes all three targets. The sections that follow go through them one at a time: inline URLs, external stages, then internal stages. A real lockdown usually combines several of these settings.
Account-level parameters are what restrict these destinations, and an account administrator sets them with ALTER ACCOUNT SET. PREVENT_UNLOAD_TO_INLINE_URL closes URLs typed into the statement. PREVENT_UNLOAD_TO_INTERNAL_STAGES closes every internal stage. REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION and REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION push external stages onto a storage integration, whose STORAGE_ALLOWED_LOCATIONS list then pins them to approved buckets.
The value set on the account is the default for everyone. The two PREVENT_ parameters can be overridden for a single user; the two REQUIRE_ parameters cannot.
Checkpoint 1 of 10· Check yourself
A role can read a sensitive table but has no cloud keys and no storage integration. Can a user with that role still send the table's data to a world-readable S3 bucket with an unload statement?
Credentials are only needed to reach private storage. An inline URL that points at a public bucket or container needs no keys, so any data the role can read can be unloaded there. That makes inline URLs the most dangerous destination to leave open.
“Required only for unloading into an external private cloud storage location; not required for public buckets/containers”Source: docs.snowflake.com
2.Blocking ad hoc unloads to inline URLs
PREVENT_UNLOAD_TO_INLINE_URL blocks ad hoc unloads, meaning COPY INTO <location> statements that put the cloud storage URL and access settings directly in the statement. With the parameter set to TRUE, every unload has to name a stage: a named internal stage, a named external stage, a table stage or the user stage. Developers who used to type COPY INTO 's3://partner-bucket/out/' ... CREDENTIALS=(...) get an error. Unloads through approved named external stages keep working.
The control is narrow on purpose. It does not look at how a named stage authenticates. A stage that was created with embedded keys still passes, because the parameter only checks whether the URL appears in the statement. The parameter also never touches stage creation. Developers who can still run CREATE STAGE can wrap the partner bucket in a new stage and unload through that. Closing that path takes the storage-integration requirements in the next section.
Checkpoint 2 of 10· Check yourself
With PREVENT_UNLOAD_TO_INLINE_URL = TRUE set on the account, which of these unload statements is rejected?
With the parameter on, every unload has to name a stage: a named internal or external stage, a table stage or the user stage. A cloud URL typed into the COPY statement is still an ad hoc inline unload, even when it uses a storage integration instead of raw keys, so it is rejected.
“TRUE: COPY INTO <location> statements must reference either a named internal (Snowflake) or external stage or an internal user or table stage.”Source: docs.snowflake.com
Checkpoint 3 of 10· Exam question
Developers in a Snowflake account on AWS can run COPY INTO 's3://partner-bucket/out/' FROM sales CREDENTIALS=(AWS_KEY_ID='...' AWS_SECRET_KEY='...') and send data to any bucket they hold keys for. The security engineer wants to block this pattern account-wide while still allowing unloads through approved named external stages. Which action achieves this?
Correct answer: B — Run ALTER ACCOUNT SET PREVENT_UNLOAD_TO_INLINE_URL = TRUE so COPY INTO <location> rejects a bucket URL typed directly in the statement
- A. This parameter only governs unloads into internal stages. A bucket URL typed straight into COPY INTO <location> is an external write and is untouched by it.
- B. Correct. The parameter rejects unloads whose destination is an inline URL, so only named stages remain usable as unload targets, which is exactly the pattern the team wants to keep.
- C. This governs CREATE STAGE statements. The statement in the scenario creates no stage at all, so the inline unload still runs.
- D. Allowed locations constrain stages that use the integration. They have no effect on an inline URL with embedded keys, which never references the integration.
Sources4
3.Requiring storage integrations: creation versus operation
A storage integration stores a Snowflake-generated cloud IAM identity, plus an optional list of allowed or blocked locations. That makes it the way to tie stages to approved buckets (see storage integrations and allowed storage locations). Two account parameters make integrations mandatory, and they act at different moments.
REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION acts when a stage is created. With it set to TRUE, a CREATE STAGE for an external stage on private cloud storage must reference a storage integration as its credentials. A Terraform module that still writes CREDENTIALS=(AWS_KEY_ID=... AWS_SECRET_KEY=...) into new stages fails. Internal stages are not affected, because they have no cloud credentials. This parameter is not retroactive: stages that already exist with embedded keys keep working.
REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION acts at run time, on both loading and unloading. With it set to TRUE, any load or unload against private cloud storage must go through a named external stage that references a storage integration. If the named stage references explicit credentials instead, the statement fails with a user error. This is the setting that breaks the nightly COPY INTO @legacy_ext_stage until the stage is rebuilt on an integration. It applies to loads as well, so ingestion pipelines that use legacy stages will break at the same moment.
The stages at risk are the external stages whose definitions carry explicit cloud credentials instead of a STORAGE_INTEGRATION. Every COPY that reads from them or writes to them will fail once the parameter is TRUE, whether it unloads or loads. Inventory those stages and move each one onto an integration before you flip the switch.
Checkpoint 4 of 10· Check yourself
To limit the risk of breaking pipelines, an administrator plans to try REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION = TRUE on a single ETL service user before rolling it out. What will they find?
Both REQUIRE_STORAGE_INTEGRATION_* settings are account parameters, so they can only be set at the account level with ALTER ACCOUNT. No user-level or session-level override exists for them. Turning on OPERATION therefore affects every load and unload through a credential-based stage at the same moment. CREATION is the wrong substitute because it only governs new CREATE STAGE statements.
“You can only set account parameters at the account level”Source: docs.snowflake.com
Checkpoint 5 of 10· Exam question
A platform team uses Terraform to create external stages. Auditors found several stages defined with CREDENTIALS=(AWS_KEY_ID=... AWS_SECRET_KEY=...) that point at buckets outside the company. The team wants Snowflake to reject any new external stage that does not name a storage integration, without affecting internal stages. What should the ACCOUNTADMIN configure?
Correct answer: D — Set REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION = TRUE at account level so external CREATE STAGE must name a STORAGE_INTEGRATION
- A. That parameter targets COPY INTO <location> statements that carry a URL. It does not evaluate CREATE STAGE definitions, so the keyed stages could still be created.
- B. This parameter blocks unloads to internal stages. It neither inspects how external stages are defined nor requires an integration.
- C. This is a manual process control rather than a Snowflake parameter. It does not make Snowflake reject keyed stages, and it removes automation without enforcing anything.
- D. Correct. With this account parameter set, Snowflake refuses to create an external stage unless it names a storage integration, while internal stages are unaffected.
Checkpoint 6 of 10· Exam question
Enforcement on stage creation is now active, but a nightly task still unloads with COPY INTO @legacy_ext_stage, a stage created years ago with embedded CREDENTIALS. Security wants those unloads to fail until the stage is moved onto a storage integration. Which setting provides this?
Correct answer: A — Set REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION = TRUE at account level so load and unload on stages lacking an integration fail
- A. Correct. This parameter is checked when the stage is used, so pre-existing stages with embedded keys stop working for load and unload until they reference a storage integration.
- B. The creation parameter only evaluates new CREATE STAGE statements. It never revisits stages that already exist, so the legacy stage keeps working.
- C. A named stage is not an inline URL. The unload references the stage by name, so this parameter does not apply to the task.
- D. This parameter concerns internal stages only. The legacy stage is external, so the unload is not affected.
4.Closing internal stages as a staging point
Internal stages look harmless because the files stay in Snowflake. They are still a two-step exit, though: unload to a stage, then run GET to copy the files to a laptop. PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE blocks unloads to every internal stage type, including user stages, table stages and named internal stages.
With the parameter left at FALSE, each stage type has its own default restriction:
- a user can only unload to their own user stage
- unloading to a table stage requires the active role to have OWNERSHIP on the table
- unloading to a named internal stage requires the active role to have WRITE on the stage
Those defaults still let every user unload to @~. That is why the parameter is the relevant control when the aim is to stop staging files for GET, rather than to tune grants on individual stages.
Checkpoint 7 of 10· Match them up
PREVENT_UNLOAD_TO_INTERNAL_STAGES is left at FALSE. Match each unload target with the default restriction that still applies to it.
Tap a term, then the definition that fits it.
When the parameter is FALSE, each internal stage type has its own default restriction: table stages need OWNERSHIP on the table, and named internal stages need WRITE on the stage. The user stage needs no extra grant. Every user can therefore still unload to @~ and then run GET, so blocking that route takes PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE. Tuning grants is not enough.
“Users can only unload data to named internal stages when their active role has the WRITE privilege on the stage.”Source: docs.snowflake.com
Sources4
5.Account defaults and per-user overrides
The four unload parameters do not all live at the same level. The two PREVENT_ parameters are set on the account and can then be overridden for one user with ALTER USER. That makes an exception for one service user possible without opening the rest of the account. The two REQUIRE_ parameters can only be set on the account, because they constrain stages, which are shared objects, rather than the person running the statement.
| Parameter | What TRUE closes | Settable at |
|---|---|---|
| PREVENT_UNLOAD_TO_INLINE_URL | COPY INTO a cloud URL written in the statement | Account » User |
| PREVENT_UNLOAD_TO_INTERNAL_STAGES | COPY INTO user, table and named internal stages | Account » User |
| REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION | CREATE STAGE for private external storage without a storage integration | Account only |
| REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION | Loads and unloads through external stages that use explicit credentials | Account only |
ACCOUNTADMIN sets the account-level values with ALTER ACCOUNT SET. The value set there becomes the default for every user. An override for one user goes through ALTER USER's object parameters, and that list contains only the two PREVENT_ parameters:
PREVENT_UNLOAD_TO_INLINE_URL = TRUE | FALSE PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE | FALSECheckpoint 8 of 10· Fill the gap
Per-user exceptions to the unload restrictions go through ALTER USER's object parameters. Which parameter completes this list of the unload parameters that ALTER USER accepts?
PREVENT_UNLOAD_TO_INLINE_URL = TRUE | FALSE ? = TRUE | FALSEOnly the two PREVENT_ parameters can be set at Account » User, so only they appear among ALTER USER's object parameters. Both REQUIRE_STORAGE_INTEGRATION_* parameters are account-only, because they constrain stages, which are shared objects, and not the user running the statement. They can only be set with ALTER ACCOUNT.
Source: docs.snowflake.com6.Restricting query result downloads in Snowsight
The unload parameters do nothing about the Download button on a results grid. Downloads in Snowsight are governed by data movement policies. A policy groups rules, and each rule has a movement TYPE and a MAX_ROWS expression. MAX_ROWS returns NULL for no limit, 0 to block, or a positive number as a row cap. The type for the button is UI_DOWNLOAD. It covers the Download button on the results pane for SQL and Python files in workspaces, result downloads from notebook cells in workspaces, and the results download in Query History.
A UI_DOWNLOAD rule behaves differently from the other movement types in three ways. First, it is evaluated after the query has finished, not before, so the query itself runs and only the button is affected. Second, when the rule's threshold is met, the download button is disabled rather than the statement being rejected. Third, a UI_DOWNLOAD rule can only appear in a policy's ENFORCE_RULES, never in ALERT_RULES, so you cannot run it in alert-only mode first.
The account sets the default and roles get the exceptions. Run ALTER ACCOUNT SET DATA MOVEMENT POLICY to attach a baseline policy that applies wherever no tag-based policy resolves. Only one account-level policy can be active at a time. Policies attached to tags take precedence over the account baseline for the columns they cover (see object tagging and classification). Per-role exceptions sit inside the rule itself, because MAX_ROWS can read the session through SYS_CONTEXT. The example below uses the external-stage type. Changing TYPE to 'UI_DOWNLOAD' gives the same pattern for downloads: one role unrestricted, every other role returns 0.
CREATE OR REPLACE DATA MOVEMENT RULE hr_pii_copy_guard
TYPE = 'COPY_INTO_EXTERNAL_STAGE'
MAX_ROWS AS () RETURNS INTEGER
-> (
CASE
WHEN SYS_CONTEXT('SNOWFLAKE$SESSION', 'ROLE') = 'COMP_TEAM_ROLE' THEN NULL
ELSE 0
END
);Checkpoint 9 of 10· Check yourself
Your account has a baseline data movement policy, attached with ALTER ACCOUNT SET DATA MOVEMENT POLICY. Its UI_DOWNLOAD rule returns 0, so nobody can download query results in Snowsight. The compliance team's COMP_TEAM_ROLE now needs unrestricted downloads, and every other role must stay blocked. What is the right way to grant that exception?
The MAX_ROWS body can read the session through SYS_CONTEXT, so a single rule can return NULL (no limit) for one role and 0 (block) for all others. A second account-level policy won't work because only one can be active at a time. A UI_DOWNLOAD rule can't go in ALERT_RULES. The unload parameters have no effect on the Snowsight Download button.
“The MAX_ROWS body can call SYS_CONTEXT to read session and movement context”Source: docs.snowflake.com
7.Retrieval paths that bypass the download button
Disabling a button does not stop anyone from fetching data in other ways. UI_DOWNLOAD does not cover every download surface. Downloads in Streamlit apps, notebooks in the Visual Studio Code extension, the Export as HTML option in workspaces, and CoWork are all outside it. The larger gap is clients that never open Snowsight at all.
Data movement policies classify each statement under one primary movement type and need a separate rule for each. Results fetched by a driver or connector, SnowSQL, the Snowflake CLI, the SQL API or a stored procedure count as PROGRAMMATIC_FETCH. A stored procedure stays under that type even when it is called from a Snowsight session. A COPY to a stage followed by GET is a third route, governed by the COPY_INTO_* types and the unload parameters above.
| Retrieval path | Restricted by |
|---|---|
| Download button in workspace results, notebook cells or Query History | UI_DOWNLOAD rule (button disabled) |
| Driver, connector, SnowSQL, Snowflake CLI, SQL API, stored procedure | PROGRAMMATIC_FETCH rule |
| COPY INTO an external stage or inline URL | COPY_INTO_EXTERNAL_STAGE rule, PREVENT_UNLOAD_TO_INLINE_URL, REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION |
| COPY INTO an internal stage, then GET | COPY_INTO_INTERNAL_STAGE rule, PREVENT_UNLOAD_TO_INTERNAL_STAGES |
Checkpoint 10 of 10· Check yourself
An analyst whose role is covered by a policy with a UI_DOWNLOAD rule returning 0 opens SnowSQL on their laptop. They run SELECT * against the tagged PII table. The policy has no other rules, and no unload parameters are set. What happens?
Each rule controls only one movement type. A UI_DOWNLOAD rule just disables the Snowsight download button after the query finishes, and results fetched through SnowSQL fall under PROGRAMMATIC_FETCH. The unload parameters only govern COPY INTO unloads to a location, so they have no effect on a plain SELECT fetched by a client.
“A data movement rule controls one movement type, such as COPY_INTO_EXTERNAL_STAGE.”Source: docs.snowflake.com
Sources7
Sources
(8)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“The files can then be downloaded from the stage/location using the GET command.”
↩︎ Where COPY INTO can write“Required only for unloading into an external private cloud storage location; not required for public buckets/containers”
↩︎ Where COPY INTO can write“Snowflake provides a set of parameters to further restrict data unloading operations”
↩︎ Where COPY INTO can write“Named external stage that references an external location (Amazon S3, Google Cloud Storage, or Microsoft Azure).”
↩︎ Key concept - 2.
“SELECT queries in COPY statements support the full syntax and semantics of Snowflake SQL queries, including JOIN clauses”
↩︎ Where COPY INTO can write - 3.
“ALTER ACCOUNT SET { [ accountProperties ] | [ accountParams ] | [ objectParams ] | [ sessionParams ] }”
↩︎ Where COPY INTO can write - 4.
“COPY INTO <location> statements that specify the cloud storage URL and access settings directly in the statement”
↩︎ Blocking ad hoc unloads to inline URLs“A named external stage must store the cloud storage URL and access settings in its definition.”
↩︎ Blocking ad hoc unloads to inline URLs“require a storage integration object as cloud credentials when creating a named external stage (using CREATE STAGE)”
↩︎ Requiring storage integrations: creation versus operation“specifying a named external stage that references explicit cloud provider credentials, such as secret keys or access tokens, produces a user error.”
↩︎ Requiring storage integrations: creation versus operation“Unloading data from Snowflake tables to any internal stage, including user stages, table stages, or named internal stages is prevented.”
↩︎ Closing internal stages as a staging point“The current user can only unload data to their own user stage.”
↩︎ Closing internal stages as a staging point“User — Can be set for Account » User”
↩︎ Account defaults and per-user overrides“Account — Can be set only for Account”
↩︎ Account defaults and per-user overrides“A named external stage must store the cloud storage URL and access settings in its definition.”
↩︎ Exam trap 1“specifying a named external stage that references explicit cloud provider credentials, such as secret keys or access tokens, produces a user error.”
↩︎ Exam trap 2“Account — Can be set only for Account”
↩︎ Exam trap 3“TRUE: COPY INTO <location> statements must reference either a named internal (Snowflake) or external stage or an internal user or table stage.”
↩︎ Checkpoint“You can only set account parameters at the account level”
↩︎ Checkpoint“Users can only unload data to named internal stages when their active role has the WRITE privilege on the stage.”
↩︎ Checkpoint - 5.
“along with an optional set of allowed or blocked storage locations”
↩︎ Requiring storage integrations: creation versus operation - 6.
“PREVENT_UNLOAD_TO_INLINE_URL = TRUE | FALSE PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE | FALSE”
↩︎ Account defaults and per-user overrides - 7.
“Button disabled: When a UI_DOWNLOAD enforce rule threshold is met, downloads are disallowed by disabling the download button in the Snowsight UI.”
↩︎ Restricting query result downloads in Snowsight“In contrast, UI_DOWNLOAD rules are processed independently after the query finishes.”
↩︎ Restricting query result downloads in Snowsight“Only one account-level policy can be active at a time.”
↩︎ Restricting query result downloads in Snowsight“This movement type does not apply to all download buttons.”
↩︎ Retrieval paths that bypass the download button“programmatic data access from a driver or connector, SnowSQL, Snowflake CLI, SQL API, or a stored procedure”
↩︎ Retrieval paths that bypass the download button“statements executing inside a stored procedure classify as PROGRAMMATIC_FETCH rather than SNOWSIGHT_UI, even when the calling session originates from Snowsight.”
↩︎ Retrieval paths that bypass the download button“The MAX_ROWS body can call SYS_CONTEXT to read session and movement context”
↩︎ Checkpoint“A data movement rule controls one movement type, such as COPY_INTO_EXTERNAL_STAGE.”
↩︎ Checkpoint - 8.
“A UI_DOWNLOAD rule can only be used in ENFORCE_RULES, not in ALERT_RULES.”
↩︎ Restricting query result downloads in Snowsight“A UI_DOWNLOAD rule can only be used in ENFORCE_RULES, not in ALERT_RULES.”
↩︎ Exam trap 4