An open standard for agent payment authorization. Protocol-agnostic. Opt-in. 30 lines of code.
Status: Draft proposal. Seeking feedback from agent framework developers (Claude Code, Codex, and others). Read the proposal blog post →
Agent frameworks (Claude Code, Codex, etc.) cannot auto-approve payments because they don't know the user's spending limits. This causes unnecessary interruptions — the agent stops and asks for every $0.01 API call, defeating the purpose of autonomous agents.
.agent-budget solves this by declaring, in a single file, what the user has pre-authorized their agent to spend. Frameworks read it, enforce the limits, and only interrupt when a payment would exceed the budget.
{
"daily_limit_usdc": 5.00,
"max_per_call_usdc": 1.00,
"weekly_limit_usdc": 25.00
}
| Field | Required | Type | Description |
|---|---|---|---|
daily_limit_usdc |
✅ Required | number | Maximum cumulative spend per UTC calendar day. Resets at 00:00 UTC. 0 = "ask me every time" (budget-aware prompts). -1 = no daily limit (use with caution). |
max_per_call_usdc |
✅ Required | number | Maximum spend for any single API call. Prevents a large transaction from consuming the daily budget in one go. 0 = "ask for every call regardless of daily limit." |
weekly_limit_usdc |
🔷 Optional | number | Soft cap over a rolling 7-day window. Exceeding this triggers a warning (not a block). Useful as a safety net above daily limits. |
./.agent-budget — project-level budget (highest priority)~/.config/agent-budget.json — user-level defaultIf no file is found, the framework MUST NOT auto-approve any payment. The absence of a budget file = explicit user intent to review every transaction.
function shouldAutoApprove(amountUSDC) {
const budget = loadBudget(); // Read .agent-budget, then ~/.config/agent-budget.json
if (!budget) return false; // No budget file → ask human
if (amountUSDC > budget.max_per_call_usdc) return false;
const spentToday = getSpentToday();
if (spentToday + amountUSDC > budget.daily_limit_usdc) return false;
return true;
}
Frameworks SHOULD track daily spend in a machine-readable log. Recommended location: .agent-spending.log (project) or ~/.config/agent-spending.jsonl (global).
Recommended log format (JSON Lines):
{"time":"2026-08-09T14:22:00Z","amount":0.01,"service":"x402-gas","currency":"USDC","receipt":"0xabc123..."}
{"time":"2026-08-09T14:23:00Z","amount":0.02,"service":"x402-ens-resolve","currency":"USDC","receipt":"0xdef456..."}
Agent: "I found a gas price API. It costs $0.01. Proceed? [y/n]"
User: "y"
Agent: "I need ENS resolution. It costs $0.02. Proceed? [y/n]"
User: "y"
Agent: "I need Polymarket data. It costs $0.05. Proceed? [y/n]"
User: "sigh... y"
# 15 more interruptions...
Agent: "I'll use paid APIs when needed within our $5/day budget.
Today: $0.03 (gas $0.01, ENS $0.02). Continuing."
# Zero interruptions. Agent works autonomously within explicit guardrails.
max_per_call_usdc prevents a $50 charge in a $5/day budget.None yet — this is a draft proposal. If you implement .agent-budget in your framework, open a PR to add it here.
If you build an agent framework, implement .agent-budget. It's ~30 lines of code. It's backwards-compatible. It unlocks agent commerce without touching payment protocols.
If you're an agent developer, create a .agent-budget file in your project and ask your framework to support it. Adoption starts with users asking for it.
Proposed by minia2a.uk, an open trial-first marketplace for agent APIs. Discuss on HN.