Get started with per-user quotas¶
This topic walks through setting up an account-wide AI spending guardrail in a few minutes, followed by the most common patterns organizations use to structure per-user quotas across roles, teams, usage tiers, and individual exceptions.
Set up an account-wide AI guardrail¶
The fastest way to prevent unexpected AI spend is to create a single quota that covers all users in the account, sets both a monthly limit and a daily burst limit, and blocks users automatically when they reach either limit.
Run the following statements with the ACCOUNTADMIN role. To delegate quota administration to a custom role, see
Create a custom role for quota administration.
Before you enable enforcement, verify the quota’s scope, limits, and resolved user list:
GET_USERS is eventually consistent: it can take approximately 10 to 15 minutes to reflect tag and role
changes. If the user list isn’t what you expect, wait and call GET_USERS again before you change the scope.
After the scope is correct, enable built-in block enforcement and email users when they’re blocked:
Any user in the account can check their own usage and remaining headroom at any time without additional privileges:
Choose an implementation pattern¶
Most organizations use one or a combination of the following patterns to match how they manage users and budgets:
| Pattern | When to use it | How it’s configured |
|---|---|---|
| Account-wide guardrail | You want one baseline ceiling for everyone in the account. | One quota with ALL_USERS. |
| Quotas by role or team | Different functional roles or departments need different default limits. | One quota per role (applies_to.roles) or department tag (applies_to.user_tags). |
| Quotas by usage tier | You group users into capacity tiers (for example, standard users at 200 credits and power users at 1,000 credits). | One quota per tier role or usage_tier tag value. |
| Role within a cost center | The same functional role has different budgets depending on the business unit or cost center. | One quota per combination, using operator = 'INTERSECTION' with both roles and user_tags. |
| Single-user or temporary exceptions | Specific users need a temporary boost for a project or a custom ongoing cap without changing their roles or tags. | SET_USER_QUOTA_OVERRIDE on the existing quota (up to 200 overrides per quota). |
Important
In each pattern, the script enables block enforcement right after it sets the scope. Instead, call
SET_BLOCK_ENFORCEMENT_ENABLED only after GET_USERS returns the users you expect, which can take approximately
10 to 15 minutes. If you combine patterns with the account-wide guardrail, the lowest limit across overlapping
quotas binds, so the guardrail also caps any higher tier limit. Set the guardrail limits above your highest tier,
or add the higher-tier roles to the guardrail’s excluded_by.roles.
Pattern 1: Quotas for different roles or teams¶
When teams already have functional roles in Snowflake (such as ANALYST and DATA_ENG), you can
scope a quota to each role. Quota membership updates automatically as you grant and revoke those
roles, including through SCIM.
Important
When you scope quotas by role, use the same role to grant access to the features the quota monitors.
For example, grant Snowflake CoCo access only through a COCO_POWER_USER role, or grant access to all
AI features only through an AI_POWER_USER role, and scope the matching quota to that role. Granting
the role then gives a user both the access and the limit, and revoking it removes both. For this
pairing to hold, the role must be the only way users get that access, so don’t also grant that access
to other roles, such as PUBLIC. Also grant the role directly to users: a user who gets it through
another role gains the access but isn’t selected by the quota.
Before you scope a quota to a role, keep these two rules in mind:
- Only direct grants to users count. To check which users are directly granted a role, run
SHOW GRANTS OF ROLE <role_name>;and inspect rows wheregranted_to = 'USER'. For more information, see How role-based selection works. - If a user holds both roles and belongs to two quotas that monitor the same domain, both quotas count all of that user’s spend in the domain, and the lowest limit binds. For more information, see Override limits for specific users.
To prevent a lower-limit role quota from capping users who also hold a higher-limit role, exclude the higher-limit role from the lower-limit quota:
If your organization represents teams with user tags (for example, cost_center = 'analytics')
instead of roles, pass user_tags in applies_to in the same way. For details, see
Specify users in scope.
Pattern 2: Quotas based on usage tiers¶
When users across different teams need standard versus power-user limits (for example, 1x versus 5x Snowflake CoCo limits), define one quota per tier. You can represent tiers with either roles or user tags.
Option A: Tier roles¶
Create dedicated tier roles (such as COCO_STANDARD_USER and COCO_POWER_USER), grant Snowflake
CoCo access to those roles, and grant the appropriate tier role directly to each user. Exclude COCO_POWER_USER
from the standard quota so that even if a user holds both roles, the standard quota doesn’t cap
them:
To promote a user to the power-user tier, grant them COCO_POWER_USER:
Option B: Tier tags¶
If you already tag users, use a single tag such as cost_mgmt_db.tags.usage_tier with values
'standard' and 'power'. Because a user object can have only one value per tag at a time,
changing a user’s tag value automatically moves them from the standard quota to the power-user quota
with no overlap:
Pattern 3: Role within a specific cost center¶
When the same role (DATA_ENG) is shared across departments that have different budgets, combine
the role and a department or cost-center tag using INTERSECTION:
Pattern 4: Temporary or individual exceptions with limit overrides¶
When one or a few users in a quota need extra headroom for a sprint or investigation, don’t create a separate single-user quota or change their roles or tags. Instead, set a per-user limit override on their existing quota with an expiration date:
If the user is also covered by an account-wide guardrail quota (such as account_ai_guardrail with
a 500-credit monthly limit), raise their override on that quota as well so the lower guardrail limit
doesn’t still block them:
For more information about overrides, see Override limits for specific users.