The disabled button that was not enforcement
Greying out a button stops the person looking at it and nobody else. An old tab, a background job or a direct call goes straight past. The decision has to happen where the write happens.
AI spend is capped by the server, at the moment of the write.
Meeting extraction, Ask Growth Kit, content drafting and profile writing each cost money per run. One registry declares how many AI generations our workspace may accept in a billing period, how many active projects we may hold, and how many API requests per minute a key or a session gets. The server reserves usage inside the same transaction as the work, so a retry never burns the allowance twice.
Product example
This is the same visual component used by the authenticated app, rendered with deterministic sample data.
The included allowance, the enforced limit and what is left.
Inert sample data · no network access
Preview ready
Without a shared foundation, every team rebuilds these edge cases, differently.
Greying out a button stops the person looking at it and nobody else. An old tab, a background job or a direct call goes straight past. The decision has to happen where the write happens.
A flaky connection retries a request and a naive counter charges the quota again. The month runs out on generations nobody received. A stable event ID makes the second attempt free.
Limits scattered through ad hoc conditions drift apart until someone asks what we are actually allowed to run this month and there is no confident answer. One registry ends that.
Highlights
Active projects, AI generations per billing period, API requests per minute for a key, and per minute for a signed-in session. Each is one typed entry.
Every reservation carries a stable event ID. A repeat returns the original ledger row, and a repeat with a different quantity is refused rather than accepted quietly.
If the server cannot resolve which plan applies, the decision is denied. Nothing passes on a missing entitlement.
The mechanism end to end, as implemented in the repository.
Declare the limit once
Each limit is one typed entry: what it counts, who it applies to, the window it uses, the entitlement it binds to, and what happens when it is reached.
The server resolves the plan
Subscription state maps to a plan and its entitlements, with a short grace window after a late payment. An explicit organization grant can raise an entitlement.
Usage is reserved inside the write
The server takes a lock, reads the usage ledger and reserves the amount in the same transaction as the work, so parallel requests settle in order instead of racing.
Refusals say what they are
A rate limit returns the number of seconds to wait. A period limit says the plan limit was reached. Meeting extraction reads that answer before it starts and skips work the allowance would refuse.
Engineering guarantees
The meters on screen explain a decision, they never make one. A limit caps how many AI runs we accept, not what any single run costs at the provider, and today every plan leaves AI generations unlimited.
The boundary above is code, not a claim. These files carry the contract:
src/registries/quotas.tssrc/server/commercial-access.tsconfig/entitlements.tsThese capabilities share contracts and boundaries with this one.
The docs describe the same contracts this page demonstrates.