7 Ways to Control Your Snowflake CoCo AI Spend
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
Snowflake CoCo (Cortex Code) agentic sessions consume credits based on token processing, and uncontrolled usage can escalate costs quickly. Seven concrete controls are presented to manage AI spend: (1) ACCOUNT_USAGE history views for visibility across CLI, Desktop, and Snowsight surfaces; (2) the built-in /cost-intelligence skill for natural-language spend queries; (3) per-surface daily credit limits via account parameters with user-level overrides; (4) per-user quotas — a first-class Snowflake object in public preview — that enforce hard blocks across AI domains including Cortex Agents and CoWork; (5) forecast-based budgets for early warnings with configurable notification channels; (6) model access control via RBAC (replacing the deprecated CORTEX_MODELS_ALLOWLIST, which is being retired by November 2026); and (7) automated guardrails using Snowflake alerts and tasks, including runaway-query cancellation. Each section includes exact SQL code to implement the control.
Table of contents
1. Usage history views — know what you’re spending2. The /cost-intelligence skill — ask about spend in plain language3. Per-surface daily credit limits — a fast per-user cap4. Per-user quotas — hard blocks across AI domainsGet Luke Hartzell’s stories in your inbox5. Budgets — forecast-based early warnings6. Model access control — spend smarter by default7. Automated guardrails — alerts, tasks, and runaway-query cancellationConclusionQuestions this post answers
What is the difference between Snowflake per-user quotas and budgets for AI spend control?
Per-user quotas hard-block users from issuing new AI requests once they hit a monthly or daily credit limit, with enforcement evaluated within minutes of a spend event. Budgets use time-series forecasting to send early-warning notifications when spend is projected to exceed a monthly limit, but do not block consumption by default. The two are complementary: quotas enforce, budgets warn. Teams deciding how to enforce AI spend limits on Snowflake track quota vs. budget trade-offs on daily.dev.
Is CORTEX_MODELS_ALLOWLIST being deprecated in Snowflake and what replaces it?
CORTEX_MODELS_ALLOWLIST is being deprecated. Starting August 2026, the parameter can only be changed to 'None', and it is fully retired by November 2026. Model RBAC — granting application roles from the SNOWFLAKE.MODELS schema to specific Snowflake roles — becomes the sole access-control mechanism. To migrate, set the allowlist to 'None' and use GRANT APPLICATION ROLE statements for per-model access. Snowflake admins migrating off CORTEX_MODELS_ALLOWLIST before the November 2026 deadline follow deprecation timelines like this on daily.dev.
How do I cancel runaway AI queries in Snowflake automatically based on credit usage?
Create a Snowflake task scheduled hourly that calls a stored procedure with a credit threshold. The procedure aggregates credits per query from CORTEX_AI_FUNCTIONS_USAGE_HISTORY and cancels any still-running query exceeding the threshold. Note that cancellation stops further cost accumulation but does not refund credits already consumed, and the ACCOUNT_USAGE view has up to five minutes of latency. Engineers building automated cost guardrails for Snowflake AI workloads find patterns like this on daily.dev.