Who answers for AI spend: per-team budgets, quotas that do not break the service and penalties that do not create shortcuts
You know how much each team spends, because you measured it, and you know how to forecast where it will end up at the end of the month. The most uncomfortable question remains: what happens when a team exceeds its budget, and who decides. Answering "we will notice from the report" leaves the overrun to whoever caused it; answering "we block everything" switches off a service in production. This article builds the rules in four steps, each with an executed listing: split a budget without assigning more than there is, choose what a quota does when it is reached, prevent simultaneous requests from exceeding it together, and give a shape to penalties and to the carry-over of unspent money. The numbers are invented and declared as such.
Two neighbouring topics live elsewhere. How cost is attributed to teams (showback, chargeback, shared cost) is in the article on the tracking architecture; how spend is forecast and controlled within the month, with projection and alarms, is in the article on monthly forecasting. Here the point is accountability: the rules that turn a number into a decision.
The budget is a commitment of the organization, with a holdback
The FinOps Foundation distinguishes forecast and budget: the forecast is a team's promise about how much it will spend to produce value, the budget is the organization's commitment to fund it at a certain level. Budgets are assigned to owners of a scope of work, on several levels if needed, and often include a reserve (in English, a holdback) that the owner can use for variations, overruns and forecasting errors. From this I derive two rules for an allocator: the sum of the teams' budgets cannot exceed the available pool, and part of the pool is assigned to nobody.
The listing takes an invented monthly pool of 10,000 euro, keeps 10% aside as a reserve and approves requests in order of arrival. The check is what matters: before approving, it adds up what has already been assigned and compares it with what is available. The rejection prints the allocatable remainder, because a "no" without a number postpones the discussion. Discarded alternative: reducing all requests proportionally; it is more "fair" but takes away from the owner the choice of what to cut.
# INVENTED monthly budget: 10,000 euro, of which 10% kept as a reserve (holdback).
POOL = 10_000.0
RISERVA_QUOTA = 0.10
class CapacitaSuperata(Exception):
pass
def alloca(richieste, pool=POOL, riserva=RISERVA_QUOTA):
"""Approve the requests in order, as long as the sum stays within the pool minus the reserve."""
disponibile = pool * (1 - riserva)
approvate = {}
for team, importo in richieste:
if importo <= 0:
raise ValueError(f"invalid amount for {team}: {importo}")
if sum(approvate.values()) + importo > disponibile:
residuo = disponibile - sum(approvate.values())
print(f"REJECTED {team}: asks {importo:.0f}, allocatable remainder {residuo:.0f}")
continue
approvate[team] = importo
print(f"approved {team}: {importo:.0f}")
return approvate
richieste = [("research", 3500), ("support", 2500), ("analytics", 2000), ("prototypes", 1500)]
approvate = alloca(richieste)
print(f"allocated {sum(approvate.values()):.0f} of {POOL:.0f}; reserve {POOL * RISERVA_QUOTA:.0f}; "
f"unallocated {POOL * (1 - RISERVA_QUOTA) - sum(approvate.values()):.0f}")
# Output:
# approved research: 3500
# approved support: 2500
# approved analytics: 2000
# REJECTED prototypes: asks 1500, allocatable remainder 1000
# allocated 8000 of 10000; reserve 1000; unallocated 1000
The fourth request, for 1,500 euro, is rejected because only 1,000 are allocatable. Note that 1,000 euro are left unallocated beyond the reserve: the order of arrival left a gap that no whole request fills, and the result would have been different with another order. This is a limit of the method, not a defect of the listing: assignment by order of arrival rewards speed, not value, and an organization with more requests than funds needs a forum that compares them, as the FinOps Foundation suggests for AI projects with a committee or an equivalent forum.
Three quotas, three ways to fail
A quota is the rule that applies when a team's spend reaches its budget. There are three typical forms, and each moves the risk elsewhere.
- Hard quota: after the limit, requests are rejected. The cost is predictable, the service is not.
- Soft quota: after the limit only critical requests go through and somebody is notified. The cost exceeds the budget slightly, provided that "critical" is carefully defined.
- Alerts only: no automatic action, an alarm at 80% and at 100%. The service does not stop, and neither does the spend.
There is no form that is right in absolute terms: it depends on how much interrupting the service costs compared with how much overrunning costs. The FinOps Foundation document on AI gives a hint of method: govern without blocking, with lists of approved models, quotas, rate limits and budget thresholds, and lighter rules for pilot projects so that governance does not push teams to work around it. To see the difference, the listing applies the three forms to the same sequence of 3,000 requests (invented, with a fixed seed), 20% of which are critical, against a budget of 1,000 euro.
# The same sequence of requests, three quota policies. INVENTED costs and budget.
import random
BUDGET = 1000.0
SOGLIE = (0.8, 1.0) # notifications at 80% and at 100%
def sequenza():
rng = random.Random(3)
# (euro per request, critical request?) - 20% of the requests are critical
return [(round(rng.uniform(0.2, 0.8), 3), rng.random() < 0.2) for _ in range(3000)]
def esegui(politica):
speso, bloccate, critiche_bloccate, notifiche = 0.0, 0, 0, []
for i, (costo, critica) in enumerate(sequenza()):
if politica == "hard" and speso + costo > BUDGET:
bloccate += 1
critiche_bloccate += critica
continue
if politica == "soft" and speso >= BUDGET and not critica:
bloccate += 1 # beyond the quota only critical requests go through
continue
speso += costo
for s in SOGLIE:
if speso >= BUDGET * s and s not in [n[0] for n in notifiche]:
notifiche.append((s, i))
return speso, bloccate, critiche_bloccate, notifiche
for politica in ("hard", "soft", "alert-only"):
speso, bloccate, critiche, notifiche = esegui(politica)
avvisi = ", ".join(f"{int(s * 100)}% at request {i}" for s, i in notifiche)
print(f"{politica:<10} spent {speso:>7.2f} deviation {speso - BUDGET:>+8.2f} blocked {bloccate:>4} (critical {critiche:>3}) alerts: {avvisi}")
print(f"total spend if nobody limits: {sum(c for c, _ in sequenza()):.2f}")
# Output:
# hard spent 999.95 deviation -0.05 blocked 1000 (critical 170) alerts: 80% at request 1593
# soft spent 1084.84 deviation +84.84 blocked 830 (critical 0) alerts: 80% at request 1593, 100% at request 1999
# alert-only spent 1491.59 deviation +491.59 blocked 0 (critical 0) alerts: 80% at request 1593, 100% at request 1999
# total spend if nobody limits: 1491.59
The same sequence, if nobody limited it, would cost 1,491.59 euro. The hard quota stays at 999.95, but blocks 170 critical requests: that is the operational cost of the choice, and the listing makes it visible because the sequence carries a criticality label. The soft quota overruns by 84.84 euro (about 8.5% of the budget) and blocks no critical request; it blocks 830 non-critical requests, which means that what you call "non-critical" must really be deferrable. The alert-only policy overruns by almost 492 euro. The two alerts fire at requests 1,593 and 1,999 in all the policies where the spend reaches that threshold: the difference lies in what happens afterwards, not in the alarm. Where it can hurt: a hard quota calibrated on the average budget and applied to a service with peaks switches the service off on the day it is needed most.
Enforcing the quota when requests arrive together
Applying a quota means reading the remaining spend and subtracting the cost of the request, and if the two steps are separate, simultaneous requests all read the same remainder. It is the classic race condition, and it does not take thousands of requests to get hurt: those that arrive in the same instant are enough. The listing shows it without threads, writing out the interleaving of the steps by hand (all read, then all admit, then all write), so that the output is reproducible. Then it shows the fix: a reservation under a lock, which checks and subtracts in a single step, with a final settlement that returns the difference between the estimate and the actual cost.
# Check and charge in two steps versus atomic reservation, with the interleaving written by hand
# (no threads: the order of the steps is declared, so the output is reproducible).
import threading
RESIDUO = 10.0 # euro left in the quota
STIMA = 4.0 # estimated maximum cost of a request
RICHIESTE = 5 # requests that arrive together
# 1) Check and charge separate: everyone reads before anyone writes.
residuo = RESIDUO
letture = [residuo for _ in range(RICHIESTE)] # step 1: everyone reads 10
ammesse = [r for r in letture if r >= STIMA] # step 2: everyone sees room
residuo -= STIMA * len(ammesse) # step 3: everyone writes
print(f"check then charge: admitted {len(ammesse)}, final remainder {residuo:.1f}")
# 2) Reservation under a lock: check and subtraction are a single step.
class Quota:
def __init__(self, residuo):
self.residuo = residuo
self._lock = threading.Lock()
def prenota(self, stima):
with self._lock:
if self.residuo < stima:
return False
self.residuo -= stima
return True
def liquida(self, stima, effettivo):
with self._lock:
self.residuo += stima - effettivo # returns the difference
quota = Quota(RESIDUO)
esiti = [quota.prenota(STIMA) for _ in range(RICHIESTE)]
print(f"atomic reservation: admitted {sum(esiti)}, remainder after the reservations {quota.residuo:.1f}")
quota.liquida(STIMA, 1.5)
quota.liquida(STIMA, 3.0)
print(f"after settlement (actual costs 1.5 and 3.0): remainder {quota.residuo:.1f}")
# Output:
# check then charge: admitted 5, final remainder -10.0
# atomic reservation: admitted 2, remainder after the reservations 2.0
# after settlement (actual costs 1.5 and 3.0): remainder 5.5
With check and charge separate, five requests of 4 euro all get into a remaining quota of 10 and leave it at minus 10. With the reservation two get in and the remainder falls to 2. The settlement completes the logic: the reservation uses the estimate of the maximum cost (you know the ceiling on output tokens, not the final cost), and once the response is obtained it returns what was not spent. The limit that remains: the reservation is prudent, and with estimates that are too generous it rejects requests that would have fit. On a shared datastore the check-and-subtract step must be atomic by construction; the Redis documentation describes the counter model with atomic increment and shows, in the case of the rate limiter, a variant with a race condition. I did not run it: it is a pattern to adapt.
Penalties and carry-overs: the shape matters as much as the amount
A penalty for overrunning must discourage without creating a jump. The listing compares two penalties on the same budget of 1,000 euro: a step one, 20% of the budget as soon as the limit is exceeded, and a tiered one, 25% on the part between 100% and 120% of the budget and 50% on the part beyond. Below the table it also computes a carry-over: half of the unspent amount passes to the following month, with a cap of 10% of the budget, so as not to reward whoever underestimated and to remove the rush to spend everything at the end of the month.
# Step penalty versus tiered penalty, and carry-over of unspent money. INVENTED amounts.
BUDGET = 1000.0
def penale_gradino(speso, quota=0.20):
return BUDGET * quota if speso > BUDGET else 0.0
def penale_scaglioni(speso):
"""25% on the part between 100% and 120% of the budget, 50% on the part beyond 120%."""
primo = max(0.0, min(speso, BUDGET * 1.2) - BUDGET)
secondo = max(0.0, speso - BUDGET * 1.2)
return primo * 0.25 + secondo * 0.50
print("spent step tiered")
for speso in (990, 1000, 1001, 1050, 1200, 1300):
print(f"{speso:>5} {penale_gradino(speso):>8.2f} {penale_scaglioni(speso):>9.2f}")
# Carry-over: 50% of the unspent amount passes to the next month, with a cap of 10% of the budget.
def riporto(speso, budget, quota=0.5, tetto=0.10):
return min(max(0.0, budget - speso) * quota, BUDGET * tetto)
print()
extra = 0.0
for mese, speso in enumerate((800, 950, 1000), start=1):
budget = BUDGET + extra
extra = riporto(speso, budget)
print(f"month {mese}: budget {budget:.1f}, spent {speso}, carry-over to next month {extra:.1f}")
# Output:
# spent step tiered
# 990 0.00 0.00
# 1000 0.00 0.00
# 1001 200.00 0.25
# 1050 200.00 12.50
# 1200 200.00 50.00
# 1300 200.00 100.00
#
# month 1: budget 1000.0, spent 800, carry-over to next month 100.0
# month 2: budget 1100.0, spent 950, carry-over to next month 75.0
# month 3: budget 1075.0, spent 1000, carry-over to next month 37.5
The step penalty costs 200 euro at a spend of 1,001 euro and 200 euro at 1,300: one euro over the threshold costs as much as three hundred, and once over there is no reason left to stop. The tiered one grows with the overrun (0.25 at 1,001, 12.50 at 1,050, 100 at 1,300), so it keeps the incentive to contain the damage even after overrunning. The carry-over shows another effect: the budget of month 2 rises to 1,100 because of the 100 euro carried over, and that of month 3 falls to 1,075 because in month 2 the unspent amount was smaller. The cap prevents a team from accumulating a nest egg to spend all at once. Be careful: these penalties are an example of shape; amounts and tiers are organizational choices, not data.
When all this does not pay off
A system of budgets, quotas and penalties has a cost: that of maintaining it, and that of the discussions it generates. With a single team and a small spend, tracking and an alert threshold are enough, and calling a line on a spreadsheet a "penalty" changes nobody's behaviour. It pays off as the teams become more than one, as the spend is shared and as someone has to answer to a person who does not develop. The FinOps Foundation document insists on a point that the listings cannot give: AI spend sits between finance, engineering, security and procurement, and for that reason it needs an owner with a name and surname. Without one, the rules are correct and nobody applies them.
Frequently asked questions
Which quota should I choose to start with?
The soft one, with a written definition of "critical request", because it limits the overrun without stopping the functions that matter. The hard quota is fine where an interruption is acceptable, alerts only where the spend is small.
Why is it not enough to check the spend before each request?
Because simultaneous requests read the same remainder. The check and the subtraction must be a single step, with a reservation that is settled once the response is obtained.
Isn't a step penalty simpler to explain?
It is simpler and more dangerous: once the threshold is exceeded, every extra euro costs the same, so there is no incentive to stop. The tiered penalty stays understandable and keeps up the pressure.
What you can do now
You can split a pool among teams with a reserve and a capacity check, you can choose between a hard quota, a soft quota and alerts only by looking at how many critical requests you risk blocking, and you can prevent simultaneous requests from exceeding a quota together. You can also give penalties a shape that creates no jumps and give the carry-over of unspent money a cap. The amounts in the listings are invented: yours come from the budget and the rules of your organization. The last step of the series is the cycle that puts measurement, optimization and verification together in the article on the complete workflow; if you lack the criterion for choosing the model to assign to a team, start again from the article on the trade-off between cost and quality.
Sources
- Budgeting (FinOps Framework, FinOps Foundation) - budget as a commitment of the organization distinct from the forecast, budgets assigned to owners of a scope, reserve (holdback); accessed 2026-11-13
- FinOps for AI Overview (FinOps Foundation) - governing without blocking, quotas, rate limits and budget thresholds, lighter rules for pilots, a named owner for AI spend; accessed 2026-11-13
- INCR (Redis documentation) - counter model with atomic increment and the rate limiter variant with a race condition; accessed 2026-11-13
- Runs executed locally:
python3 -Ion the four listings (standard library, Python 3.14.4), each twice with identical output; budgets, costs, criticality and penalties invented for the example. Redis, databases and web services not used

Commenti
Caricamento commenti...
Sign in to comment