UC-003

UC-003: Budget Exhaustion

Scenario

An AI agent repeatedly calls tools until the daily budget limit is reached. Subsequent calls are denied with a budget exhaustion receipt.

Preconditions

  • HELM proxy running with --daily-limit 5 (5 cents = ~5 tool calls)
  • Tenant ID set via --tenant-id test-tenant

Steps

  1. Agent sends 5 tool calls (each consuming 1 cent)
  2. All 5 are approved and receipts generated
  3. Agent sends 6th tool call
  4. Budget enforcer detects exhaustion → DENY
  5. Deny receipt emitted with PROXY_BUDGET_EXHAUSTED reason

Assertions

  • First 5 receipts have reason_code: "TOOL_ALLOWED"
  • 6th receipt has reason_code: "PROXY_BUDGET_EXHAUSTED"
  • No further tool executions occur after budget exhaustion
  • Budget state recoverable from receipt chain replay

Expected Output (6th call)

{
  "receipt_id": "rcpt_...",
  "tool_name": "calculator",
  "status": "PROXY_BUDGET_EXHAUSTED",
  "reason_code": "PROXY_BUDGET_EXHAUSTED",
  "lamport": 6
}

Script

See: rogue_agent.sh for a full budget exhaustion demo.