Skip to content

Ceiling binds token *estimates*, not money that actually moved — add a settlement-evidence spend cap #1

Description

@Sergio87Felix

Your own HONESTY NOTE says it: the cost ceiling prices transcript token usage against LIST PRICE ESTIMATES, and "do not put this number in a financial report." So today the gate protects against runaway token consumption (a real failure, cache-pricing nuance included — nice), but not against the agent moving real money over an allowed path with valid credentials, which is the bottom three rows of your README table and the exact class gate_guard.py is for.

Proposal: a third independent check alongside the cost ceiling and loop detector — a settlement cap that counts money that actually moved, using the same transcript-driven philosophy but sourcing amounts from the payment rail instead of a price table:

  • For x402/ERC-8004-style calls, the 402 challenge carries {amount, currency, resource} — the hook payload already sees the tool call, so the cap can sum challenge amounts (and for direct USDC sends, the amount argument) against a per-session / rolling-day ceiling.
  • Unlike token pricing, this needs no config price table: the amounts are authoritative from the rail. No "notional spend" caveat.
  • Same fail-closed posture as gate_guard (cost of over-blocking a payment is small) — which is the inverse of budget_guard's deliberate fail-open, and worth calling out explicitly so nobody wires this check as fail-open.

This keeps the two-guard division of labor you already have: budget_guard prices the LLM bill, this prices the agent's spending authority. Happy to draft the check — it mirrors _ceiling_exceeded but sums message.usage-adjacent payment args, ~60 lines with tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions