Skip to main content

How should I set budgets for AI coding agents?

Summary

  • Set budgets for AI coding agents per developer and per month: an alert threshold, a higher block threshold as a backstop, a shared cap for the team, and overrides for the people whose output justifies more spend.
  • Treat hard blocks as a last resort. Databricks' engineering guidance is that cutting a developer off mid-task hurts productivity, so lead with visibility and progressive friction such as alerts, spend gates and downshifting to cheaper models.
  • A budget only works if all coding-agent traffic passes through the place it's enforced, which makes the model access point (an AI gateway) its natural home.
  • On Databricks, Unity Gateway budgets support shared thresholds, per-user thresholds and per-user overrides, each set to Send alert, Block usage or both, with near-real-time enforcement.

How should I set budgets for AI coding agents?

Set them per developer, per month, at the point where model traffic flows. Give every developer a per-user threshold that sends an alert, add a higher threshold that blocks as a backstop, set a shared cap for the team, and grant overrides to the groups that need more. Then show developers their spend as they work, and steer them to cheaper models as they near the limit instead of cutting them off. A budget that reports only at month end controls nothing.

Why are coding-agent budgets different?

Coding-agent cost is dominated by context. A single short request can make an agent gather large amounts of context, call many tools and search the codebase. Databricks' write-up on managing AI coding costs at scale adds that some of the highest spenders are the people getting the most output from AI, and discouraging them is self-defeating. That's why it treats hard budgets as a last resort and describes progressive friction instead:

  • Visibility. Developers see their own spend as they work, ideally across every AI tool they use.
  • Spend gates. Warnings kick in as spend climbs. Some are self-cleared; others need approval.
  • Downshifting. A developer who hits a gate moves to a lower-cost model rather than losing access.
  • Suspension. Full cut-off stays available, but as a temporary measure and the start of a conversation.

What should a coding-agent budget support?

Capability Why it matters
Per-user thresholds A per-user threshold limits each individual's monthly spend, which a shared threshold alone doesn't.
Shared thresholds A collective ceiling keeps the team's total inside its envelope.
Per-user or per-group overrides Heavy users with matching output get a higher limit without raising everyone's.
Alert and block actions Alerts give warning; blocks are the backstop. You want both, at different levels.
Near-real-time enforcement Billing tables can lag by hours, and a limit enforced on stale data lets spend run past it.
Coverage of every model route Hosted and external models both need to count, or spend leaks around the budget.
Developer-facing visibility Developers who can see their spend across every tool can adjust their own choices.
Spend-based model defaults Steering developers to a cheaper model near the limit keeps them working.

How Databricks approaches coding-agent budgets

On Databricks, coding agents such as Claude Code and Codex reach models through Unity Gateway, which is generally available. Requests travel with each developer's Databricks identity, so the budget applies at the point of access.
Budgets. An account admin creates a monthly budget with Unity Gateway as the resource type. Unity Gateway budgets offer shared thresholds, per-user thresholds and per-user overrides for specific users or groups; if a user is in several override groups, the highest threshold applies. Each threshold can Send alert, Block usage or both. A blocked user is told their budget is exhausted until it resets or an admin raises the threshold. Budgets cover pay-per-token usage, ai_query and Genie. Provisioned throughput and traffic sent straight to standalone Model Serving endpoints aren't covered. Counting estimated external-model spend from model provider services is in Beta.
Know the limits. Enforcement runs on near-real-time estimates. Requests already in progress can complete, so final spend can exceed a threshold, and the docs warn against treating budgets as an absolute cap on billed amounts. system.billing.usage stays the source of truth for Databricks-billed usage.
Developer visibility and downshifting (Beta). With the Enhanced Unity Gateway preview enabled, an admin can link a budget to the coding agent configuration, itself in Beta, so developers can run ug usage to see their spend and limit. That budget needs a per-user threshold with Block usage enabled. Smart defaults (Beta) go further: you define tiers that recommend a different agent and model once spend reaches a set share of the threshold, and new ug launches pick up the recommendation. Smart defaults don't switch active sessions, so pair them with budget blocking.
Rates and review. Per-user tokens-per-minute rate limits on a model service bound how fast any one developer can spend. In the usage dashboard, Cost Analysis ranks users by spend and the Coding Agents tab shows sessions and activity, so you can set thresholds from observed usage instead of guesses.

FAQs

Should I block developers when they hit their budget?

Use blocking as the backstop, not the first response. Alert at a lower threshold, downshift to a cheaper model as spend rises, and keep the block for the limit you can't exceed.

How do I pick the threshold amounts?

Start from observed spend. Route agents through the gateway first, review per-user cost in the usage dashboard or system.billing.usage, then set thresholds and overrides around what you see.

Do Unity Gateway budgets stop spend exactly at the limit?

No. Enforcement is approximate, based on near-real-time estimates, and in-flight requests aren't interrupted. Treat budgets as cost control, not a guaranteed cap on the final bill.

Do budgets cover external model providers?

Optionally. Selecting Include external model usage, a Beta feature, counts estimated spend from model provider services toward the same thresholds. Those estimates can differ from the provider's invoice.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.