gitwtfhub

wtf is agent-budget-protocol?

iamapsrajput/agent-budget-protocol — explained in plain English

Analysis updated 2026-05-18

1Audience · ops devopsComplexity · 3/5LicenseSetup · moderate

TL;DR

A draft proposal for a system that enforces spending limits on a single AI agent run, instead of only on a monthly account or user budget.

Mindmap

mindmap
  root((agent budget protocol))
    What it does
      Per run spending limit
      Reserve then true up cost
      Blocks unpriced models
    Tech stack
      RFC document
      LiteLLM hook plan
      HTTP response headers
    Use cases
      Stop runaway agent spend
      Auto downgrade to cheaper model
      Add run scoped limits to a gateway
    Audience
      Platform engineers
      Infra engineers
      LLM gateway builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Read the RFC to design a per run spending cap for an internal AI agent platform.

REASON 2

Give feedback on the open questions before the protocol is finalized.

REASON 3

Plan a LiteLLM pre call hook that reserves and true ups cost per agent run.

REASON 4

Compare this run scoped approach against existing per user or per month budget limits.

What's in the stack?

LiteLLMRFC 9457HTTP

How it stacks up

iamapsrajput/agent-budget-protocol0xkinno/neuralvault0xlocker/d17-contracts
Stars111
LanguageTypeScriptSolidity
Setup difficultymoderatehardhard
Complexity3/54/55/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 1h+

This is a design document, not runnable code yet, so there is no install step.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

Agent Budget Protocol is a draft proposal, not a finished tool you can install and run today. It describes a plan for how to stop AI agents from accidentally spending huge amounts of money on API calls, and it is currently open for public feedback rather than a released piece of software. The problem it addresses is specific. AI agents often work in loops, and each step in that loop resends everything that came before it, so the amount charged per call keeps growing faster the longer the agent runs. Most services that control API spending track budgets by account, by user, or by a whole month at a time. That means a single AI agent that goes wrong and keeps running on its own could burn through an entire month's allowed spending in about an hour, long before any of those existing limits would notice and step in. The author argues that the right unit to control is a single agent run, and says no common service currently enforces a spending limit at that level. The proposal describes a budget system that would sit between an agent and the AI provider it calls. Before each request goes out, it would set aside the estimated cost, send the request, then true up the reservation once the real cost is known and release anything left over. This would let a limit be attached to one specific run, not just to a user or an account. If a model's price is not known in advance, the plan is to block the call rather than let it through for free. The system would also return machine readable information so an agent could automatically switch to a cheaper model when its budget is running low, instead of simply failing. This project does not compete with LLM routing tools like LiteLLM, OpenRouter, or Portkey. It grew out of the author's earlier project, an LLM router called ModelMuxer, and the first planned real implementation is a hook that plugs into LiteLLM. The whole proposal is released under the Apache 2.0 license so any gateway or framework can build it without restriction.

Yoink these prompts

Prompt 1
Summarize the Agent Budget Protocol RFC in plain terms and list its open questions from section 7.
Prompt 2
Explain how the reserve, forward, commit, and refund flow in this RFC would work for a parallel tool call scenario.
Prompt 3
Compare this RFC's run scoped budget idea to how LiteLLM and OpenRouter currently handle spending limits.
Prompt 4
Draft a short comment I could post in the project's Discussions thread giving feedback on the fail closed pricing rule.

Frequently asked questions

wtf is agent-budget-protocol?

A draft proposal for a system that enforces spending limits on a single AI agent run, instead of only on a monthly account or user budget.

What license does agent-budget-protocol use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is agent-budget-protocol to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is agent-budget-protocol for?

Mainly ops devops.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.