How to Configure Snowflake Kill Query

Published
Length
3 min read

Luis Felipe Dias

All posts

To run a snowflake kill query, you stop the active job by its ID. You can do this through the web interface or a system function. Data teams set up these controls to stop long jobs that waste money. Still, broad permissions let too many users cancel critical work by mistake. When teams share high-level roles, one bad click can ruin a production build. How a snowflake kill query works in practice Every statement that runs in the data platform gets a unique identifier. The platform tracks this

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

To run a snowflake kill query, you stop the active job by its ID. You can do this through the web interface or a system function. Data teams set up these controls to stop long jobs that waste money. Still, broad permissions let too many users cancel critical work by mistake. When teams share high-level roles, one bad click can ruin a production build.

How a snowflake kill query works in practice

Every statement that runs in the data platform gets a unique identifier. The platform tracks this job ID from start to finish in system history. When a job hangs or scans too much data, someone must stop it. A user can find the active job in the query history page. They can also look up the job ID through built-in system views.

Once the user has the job ID, they ask the system to cancel it. By default, a user can only stop their own running statements. To stop jobs from other people, a user needs a higher role. Warehouse operators or account admins hold the permissions to stop any warehouse job. System functions also let teams cancel all running jobs for one compromised user.

Managing timeout rules and warehouse limits

Waiting for a human to spot a bad job takes too much time. Teams set up time limits on their warehouses and user profiles instead. These timeout rules stop any job that runs past a set clock limit. You can set a wide rule for the whole account first. Then you can put tighter limits on smaller warehouses or specific user roles.

When the clock runs out, the engine cancels the work right away. This stops a broken dashboard or bad join from burning through compute credits. Still, time limits only catch jobs after they run for a long period. A massive query can still lock up resources before the timer hits zero. Teams need clear rules on who can step in and cancel work early.

Snowflake Access Control + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Where native role permissions fall short

Native roles do a good job of deciding who can log in. They also control which warehouses a team can use or manage. Still, role permissions are often too blunt for daily operations and support tasks. If you give an engineer admin rights to kill stuck jobs, they gain extra power. They might also gain the right to change warehouse sizes or read private tables.

Also, native role checks happen at the start of a session. They do not inspect what individual statements try to do in flight. They cannot require a peer review before a user runs a dangerous command. If someone runs a wide query on raw customer tables, the engine allows it. Masking rules can rewrite emails, phone numbers, or card numbers in results. Yet teams still lack a simple way to approve risky actions one by one.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.

Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Who has permission to stop a running job in the data warehouse?

Any user can cancel their own active jobs at any time. To stop a job started by someone else, you need operator or admin privileges on that warehouse.

What happens to data when you cancel an active statement?

When you stop a write or update job, the engine rolls back the changes. The table stays in the exact state it had before the job started.

How can teams prevent runaway jobs without manual intervention?

You can set statement timeout rules at the account, warehouse, or session level. The platform will cancel any job that runs longer than your set time limit.

The query runs. The emails stay hidden.