Layer 1: per-call ceiling with upto
When a seller uses the upto scheme, the client signs an authorization for a ceiling and the seller settles for less. The client SDK exposes this as maxAmount:
maxAmount, the SDK throws before signing. Nothing is authorized.
Layer 2: per-tool budget
For an agent calling many tools, per-call ceilings are not enough. You want “this scraping tool can never exceed $2/day.” Wire this in the agent runtime, not the SDK:Layer 3: session cap enforced on-chain
For higher assurance (the agent runtime cannot be trusted to keep its own books), enforce spending on-chain with a Stellar smart account contract. The wallet delegates signing to a contract that:- Rejects transfers above a per-tx cap.
- Rejects transfers that would exceed a rolling window budget.
- Optionally restricts destination to an allowlist of
payToaddresses.