Holds
How payments above the auto-approve limit wait for the owner.
A hold is a reservation for one specific payment: this agent, this seller, this amount. It's how the contract lets an agent ask for more than its auto-approve limit without trusting it.
Lifecycle
- Request. The SDK sees a price above the auto-approve limit. It signs a
KW_HOLD1intent and posts it to the relayer, which callsrequest_hold. The contract runs the same seller, status and budget checks as a payment, then reserves the amount. - Wait. The hold shows up in the dashboard's Approvals page with a countdown. The SDK polls the hold every 2 seconds by default.
- Decide. The owner signs
approve_holdordeny_hold. If nobody answers beforeapproval_timeout_secs, the hold expires. Silence means no. - Settle. After approval, the SDK retries the payment with the
hold_idin its signature.__check_authaccepts it only if seller and amount match the hold exactly. The hold becomesConsumedand can't be used again.
Rules
| Rule | Value |
|---|---|
| Open holds per agent | At most 8 (TooManyActiveHolds, 123) |
| Approval window | The agent's approval_timeout_secs: 10 s to 24 h |
| Time to settle after approval | At least 300 seconds. Approving near the deadline extends it |
| Match | Seller and amount must equal the hold, or it fails with HoldMismatch (121) |
| Reuse | One payment per hold (HoldAlreadyUsed, 119) |
Bait-and-switch protection
After approval, the SDK compares the seller's new 402 challenge with the approved hold. If the seller now asks for a different amount, recipient or asset, the SDK refuses to sign and throws BAIT_AND_SWITCH_DETECTED. The contract would refuse anyway, but this fails fast and doesn't waste a transaction.
Expiry is free to enforce
Expired holds are ignored automatically wherever the contract counts reservations. expire_hold is a public call that anyone can make to mark a hold Expired and emit an event. It's only needed for tidy records.