AI Gateway

The Dashboard Said the Budget Held. It Didn't.

September 15, 2026

~ 5 min

On this page
    Check whether your budget caps actually hold
    Book a Demo

    Why open-source AI gateways belong in your stack and why the enforcement layer still needs a vendor on the hook. 

    Open-source LLM gateways are how most platform teams start. They should. LiteLLM in particular is a good piece of software with an active community, a fast release cadence, and a tracker that gets real bug reports from real production deployments. Nothing below argues against using it.

    It argues a narrower question than security – the case for who patches a CVE at 2 a.m. is a separate piece. This one is quieter: not whether the gateway is breached, but whether the gate held on a day when nothing went wrong. When the gateway is what stops an agent from spending money it shouldn't or reaching a tool it shouldn't, who is accountable when it doesn't? 

    Over the past two weeks, LiteLLM's own issue tracker has answered that question more clearly than any vendor pitch could. Here is what it shows, and what it means for anyone running an open-source control plane in production. 

    What the tracker shows

    The reporter reproduced every item below against a published release, with config and output attached. None of them are theoretical.

    1. A $0.02 budget admitted $0.225 of spend - and reported it correctly afterward.

    #40741 – A ModelInfo validator writes None into its own cost fields, and the cost-map merge only fills absent keys – so a priced model reads back as unpriced, the pre-call estimate returns zero, and the budget reservation reserves nothing. On v1.97.0, a twenty-wide concurrent burst against a key with two cents of budget admitted all twenty requests and spent eleven times the cap. Post-call tracking resolves pricing separately, so the spend dashboard stayed accurate. The number on the screen was right. The enforcement behind it was off. 

    2. The team budget you updated governs nobody.

    #40783 (opened 11 Sep 2026) – Updating a team's team_member_budget returns 200 and shows the new value. But existing members were cloned from the old default when added, and enforcement reads the clone - the update reaches no one already on the team. Nothing records which budgets were inherited, so no fix can safely propagate it. A budget page that looks configured while every member is enforced at a different number is an audit problem, not a cost problem.

    3. The MCP deny rule that showed "Passed".

    #40583 – Any pre_call guardrail – the built-in tool_permission and custom_code alike - cannot see tools in the Anthropic /v1/messages format. An admin adds a ^mcp__.*$ Deny rule; the UI confirms it is active, the guardrail fires, finds no tools, and passes the request through. The tool runs. The log shows Passed. The triggering client is Claude Code. Unfixed from 1.95.1 through 1.100.1 – every published version. An org-wide MCP ban enforced nothing for anyone on Anthropic's wire format.

    4. The budget resets in the database and not in the cache.

    #39726 – The scheduled end-user budget reset zeroes spend in Postgres but never invalidates the Redis counter enforcement actually reads. Worse, every rejected retry refreshes the Redis TTL, so a retrying client keeps its own block alive. One customer was locked out for 70+ seconds after their budget reset, released only when traffic stopped. Reproduced on 1.95.0; still present in 1.101.0.

    5. The reset that can never complete.

    #40564 – When more than ~32,700 end users share one budget, the reset cascade packs every ID into one prepared statement, PostgreSQL rejects it (bind-variable limit), the transaction rolls back, and the job retries every tick, forever. Capped customers stay rejected indefinitely; the only signal is a log line. A regression from 1.95.0. For a consumer product on a shared default budget, this is where enforcement silently stops resetting. For a consumer product on a shared default budget, this is where enforcement silently stops resetting.

    6. The blocked call that left no trace.

    #40555 – A pre_mcp_call guardrail block on the REST path was turned into an HTTP response, bypassing the failure handlers – so no spend-log row was written. A denied action missing from the audit trail is, to an auditor, an action that never happened.

    And the longer tail, still open or only recently closed: budget enforcement bypassed outright in v1.82.3 (#26672); tag budgets skipped when the tag arrives on a header instead of in the body (#27480); exhausted budgets returning 429 on /v1/models and breaking every OpenAI-compatible client (#27923).

    This is not a LiteLLM problem 

    It would be easy - and wrong - to read the list above as an indictment of one project. Look at what actually happened on the tracker: within days of each report, a contributor volunteered to fix it. #39729 is open against the cache bug. #40587 chunks the reset. A first-time contributor asked to take the MCP guardrail issue. That is open source working exactly as designed.

    The problem is what happens between the report and the fix, and who carries it.

    A monitoring bug costs you a data point. An enforcement bug costs you money, or control, or an audit finding - and, as every case above demonstrates, it does so silently. The budget bug reported correct spend. The team bug returned 200. The guardrail bug logged Passed. The reset bug logged a line nobody was watching. Enforcement failures do not announce themselves, because the whole point of enforcement is that nobody is supposed to be watching.

    When that happens on open-source software, the answer to "who owns this?" is: you do. The maintainers owe you nothing - not a response time, not a fix window, not a backport, not a regression test on the request path your client uses. The license says so, in capital letters. That is the correct deal for a library. It is a strange deal for the component whose only job is to say no.

    Put a name on your enforcement path

    Run your traffic through a gateway where the budget cap, the deny rule, and the agent limit are contractually somebody's job. Start free on your own keys, or walk the enforcement path in a live workspace

    What an SLA actually buys you

    “Get a vendor” is not about paying for the same code with a logo. It is about changing who is exposed when the code is wrong. Concretely, a contract worth signing for an enforcement layer commits the vendor to:

    ●   A named owner and a clock. A severity-1 enforcement defect – money admitted past a cap, a policy that does not block – gets an acknowledged response in hours and a fix or mitigation in days, in writing. Not “when a contributor picks it up.”

    ●   Enforcement tested across every request path. Four of the six defects above are path-specific: the Anthropic format, the header path, the REST path, the concurrent path. A vendor's release gate must test that the deny rule denies and the cap caps on every wire format and every entry point the product accepts – not just the OpenAI-shaped happy path.

    ●   Enforcement verified, not just reported. The dashboard being right is not evidence the gate held. Release testing has to assert on what was admitted, under concurrency, at the boundary – the exact test that would have caught the 11x overspend.

    ●   Backports and a supported-version window. Three of the defects above are confirmed across five or more published releases. A vendor owes you a fix on the version you are actually running, not an instruction to upgrade into the next set of regressions. 

    ●   Root-cause and regression evidence you can hand to an auditor. When the gate fails, the write-up – what was exposed, for how long, on which paths, and what test now prevents it – is part of the deliverable. That is what “audit trail” means at the vendor level.

    ●   Someone to escalate to. When an agent is looping and a budget isn't holding, a GitHub issue isn't an escalation path.

    None of this makes the software bug-free. It makes the bugs someone's job, with consequences for not doing it.

    Five questions to ask before the gateway goes into the enforcement path

    These aren't questions about whether to self-host at all – that test is in the gateway-ownership piece linked at the top. These assume you've already made the decision and ask what you have chosen to carry.

    1.    When a budget or policy fails to enforce, who is contractually on the hook, and within how many hours?

    2.   Is enforcement regression-tested on every request format and endpoint the gateway accepts, or only on the primary one?

    3.   Does release testing assert on requests admitted under concurrency, or only on spend reported afterward?

    4.  If a denied action never reaches the audit log, does anyone find out before the auditor does?

    5.   Which version are you running today, and is a fix for a defect found next month guaranteed to land on it?

    If the honest answer to the first question is “us”, that is a decision – and it can be the right one for a platform team with the engineers to own it. It should just be made on purpose, not inherited from a pip install.

    Where this leaves open source

    Start on open source. Learn on it. Prototype the routing and the dashboards on it. It is the best way to find out what your organization actually needs from a gateway.

    Then draw the line at the enforcement path – budgets, policies, agent limits, the audit trail – and put something behind it that has a name on the contract. That is what OptScale AI is built to be: the enforcement layer your teams register their existing agents into, with per-agent cost, time, and recursion limits, MCP and vector-store allow-listing, one cost-attributed audit trail across every provider, and a vendor who owes you a fix when any of it is wrong. Self-hosted, so the data stays yours; supported, so the failures are ours.

    Open source is where you find out what you need. It is not where you should be holding the risk.

     

    ____________________________________________________________________________

    All issues cited are public in the BerriAI/litellm tracker as of 14 September 2026 and were reproduced by their reporters against published releases. Several have fixes in progress; this is a point-in-time snapshot, and the project's responsiveness to these reports is to its credit. The argument is not that the software is bad. It is that "someone will probably fix it" is not a production SLA.

    Frequently asked questions

    What is an enforcement bug in an LLM gateway?

    An enforcement bug is a defect in code that is supposed to say no – a budget cap, a rate limit, a guardrail rule, an agent limit – where the control silently fails to apply. It differs from a monitoring bug in what it costs. A monitoring bug loses you a data point; an enforcement bug admits the request, spends the money, or runs the tool, and usually leaves a log line that says everything is fine. In the case above, a $0.02 cap admitted $0.225 of spend under a concurrent burst while the spend dashboard reported the overspend accurately, because reporting and enforcement resolved pricing through different code paths.

    Does an accurate spend dashboard mean my budget limits are working?

    No, and this is the most common false reassurance in gateway operations. Most gateways enforce a budget before the call, using a pre-call cost estimate and a reservation, and report spend after the call, using the provider's actual usage figures. Those are two different code paths reading two different sources. Post-call reporting can be perfectly accurate while the pre-call reservation reserves nothing. The only evidence that a cap holds is a test that asserts on what was admitted at the boundary, under concurrency – not on what was billed afterward.

    Who is liable when an open-source gateway fails to block a request?

    You are. Permissive open-source licenses disclaim warranty explicitly and in capital letters: the software is provided as is, with no fitness guarantee and no obligation on the maintainers to respond, fix, or backport within any timeframe. That is the right arrangement for a library you can inspect and patch. It becomes an uncomfortable arrangement for the component whose only job is to enforce a limit, because the exposure it creates – overspend, an unauthorized tool call, a missing audit row – lands on your organization and not on the project.

    What should an SLA for an AI gateway's enforcement layer cover?

    Six things, in writing. A named owner and a response clock for severity-1 enforcement defects. Release gating that tests enforcement on every request format and endpoint the gateway accepts, not just the primary one. Testing that asserts on admitted requests under concurrency, not just on reported spend. Backports to the versions you support, with a defined support window. Root-cause and regression write-ups you can hand to an auditor. And a human escalation path that is not an issue tracker.

    Do I have to stop using open source to get enforcement guarantees?

    No. The practical pattern is to keep open source where it is strongest – prototyping, routing experiments, dashboards, finding out what your organization actually needs – and to put a supported layer on the enforcement path alone: budgets, policies, agent limits, and the audit trail. OptScale AI is built for exactly that line, self-hosted or managed, so the data stays in your environment while the failures become somebody's contractual problem. Deployment and support tiers are on the pricing page.

    How do I test whether my gateway's budget caps actually hold?

    Three tests, none of which need a vendor. First, fire a concurrent burst – twenty or more simultaneous requests – at a key with a cap small enough that a single request should nearly exhaust it, and count what was admitted rather than what was billed. Second, send the same blocked request in every wire format your clients use, including the Anthropic /v1/messages shape and any tags sent on headers rather than in the body, and confirm the deny rule fires on each. Third, block a call deliberately and then look for its row in the spend log. If any of the three surprises you, that is the gap the article is about.

    See what your gateway actually admitted

    Watch a capped key, a denied tool call, and a blocked agent land in one audit trail – the request that was admitted, the policy that stopped it, and the spend row it wrote. On your own traffic, or in a live workspace