Multi-dimensional usage and cost governance

Rate limiting and budget enforcement for LLM traffic across users, agents, organisations, models, providers, tokens and monetary cost.

Organisation
Salesforce / MuleSoft
Period
2025 – Present
Area
AI governance

Context

LLM consumption is not well described by request counts. The same number of calls can differ by orders of magnitude in tokens and in cost, and the budget anyone actually cares about is measured in money, not in call counts.

The problem

Organisations need to cap consumption along several dimensions at once: per user, per agent, per application, per model, per provider. Worse, some of the quantities they want to cap are only known partway through serving the request. Token counts are not final until a response completes, and cost depends on provider-specific pricing for input and output separately.

Constraints

  • Evaluation sits in front of every model call, so the decision has to be cheap.
  • Counters are distributed; concurrent requests against a shared quota must not both be admitted.
  • Output tokens are unknown at admission time and only settle when the response ends.
  • Cost is provider- and model-specific, and input and output are priced differently.
  • Streaming responses may terminate early, and accounting has to reflect what was actually delivered.

My contribution

Shared ownership stated as such. Nothing here claims sole authorship of a platform.

  • Worked on virtual-key-based controls spanning request volume, token usage, provider, model, user and monetary cost.
  • Built governance capabilities around virtual model credentials, giving organisations centralised access control and attribution without exposing underlying provider keys.
  • Worked on token accounting, cost calculation and time-window management within the policy path.

Approach

  1. Separate admission from accounting. A request is admitted against what is known up front and reconciled against what actually happened, because waiting for certainty before admitting would put provider latency inside the rate-limit decision.

  2. Let the quota key be derived from the request context instead of pinning it to one field, so the same policy expresses per-user, per-agent, per-application or per-key limits without a separate implementation for each.

  3. Give virtual credentials an identity of their own. Once a key is the unit of access, attribution, restriction and central revocation all follow from the same object instead of requiring three mechanisms.

Decisions that mattered

The ones with a real cost on the other side.

Cost as a first-class limit

Request and token ceilings are proxies for the thing organisations actually care about. Treating monetary cost as its own dimension means carrying provider pricing in the evaluation path. That is more moving parts, but it caps what the budget owner is actually exposed to.

Reconciling after the response

Admitting on an estimate and settling afterwards means brief over-admission is possible under concurrency. The alternative, blocking until the totals are certain, would add a provider round-trip to every governed call. Bounded imprecision was the better trade.

Outcome

Centralised governance that lets organisations attribute, limit and control AI consumption across identities, models and providers, with monetary budgets as a directly enforceable dimension.

What generalises

  • Enterprise AI needs identity, observability, cost control and policy enforcement. A model endpoint on its own is not a platform.
  • Choose bounded, understood imprecision over exactness that costs latency on every request.