Skip to main content
When a human clicks “pay,” they set the ceiling implicitly. When an agent pays, the ceiling has to be explicit. This page covers three layers of that ceiling.

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:
If the seller’s declared ceiling is higher than 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 payTo addresses.
An attempt above cap fails at signing time; no funds move.

Composing the layers

Use all three. Per-call ceiling stops the seller from over-charging. Per-tool budget stops the agent from over-spending on a single capability. Session cap stops the entire agent from spending more than you meant to, even if the earlier layers are compromised.