17-payment-budget-exhausted

Daily budget exhausted

Agent daily budget exhausted: 0.40 purchases against a 1.00 daily limit

budget-demo-agent may spend 1.00 USDC-TEST per UTC day. It buys a 0.40 market snapshot again and again: PolicyGate signs while the day's total stays within the limit, then answers 403 spend.budget_exceeded with the signed figures (already signed today, this amount, the limit). Budgets count at signing, so an authorization the merchant never settles still counts.

paymentsdenybudgetevidence
FIXTURE
tenant_id"northwind-finance"
home_region"tst"
scopes
payments:sign
sub"agent:budget-demo-agent"
agent_id"budget-demo-agent"

Defaults: iss = http://localhost/tst-issuer, aud = edge, exp = now+1h, kid = tester-rs256

EXPECTED OUTCOME
EARLIER ATTEMPTSallow · 200, signed
FINAL DECISIONdeny · 403
REASONspend.budget_exceeded
SIGNATUREnone exists
MERCHANTnever paid
EVIDENCEpayment.deny, signed
What this demonstrates

An agent keeps making small purchases until it reaches its daily budget. The next payment is refused, with the day's total in the signed record. The budget is shared by every visitor to this demo, so it may already be used up today. Test network: no real money.

Budget controlsSpend controls

Test network — no real money. A simulated network (eip155:31337) and a test token (USDC-TEST); the merchant settles in memory, nothing is sent to a blockchain.

RUNNER

Execute scenario

The agent buys again and again until PolicyGate's daily budget refuses. Each attempt: merchant 402, PolicyGate's decision, and on an allow the paid retry. Runs on the server: the agent's token and the full signature never reach your browser.

WHY THIS MATTERS

Proves a daily budget is enforced across payments, not only per payment, and that each refusal carries the figures it was decided on.