1 minute readImprovedAgent-ready
Tighten a spend rule and earlier approvals follow it
Each save of a spend policy now makes a new version, and every approved purchase remembers the version it was approved under. Right before paying, the agent confirms the purchase. If you tightened the rules in the meantime, it is checked again and refused when the new rules no longer allow it.
Lowering a limit used to apply only to purchases checked after the change. A purchase approved a minute earlier could still go ahead under the old rules.
- Versioned rules: every save of a spend policy bumps its version, shown on the Spend Policy page. An approved purchase records the version it was approved under.
- Confirm before paying: the agent calls
confirm_purchase(orPOST .../confirm) right before it pays. Under unchanged rules it is confirmed at once. - Checked again after a change: if the rules changed, the purchase is checked against them as they stand now, including the day's cap. If they no longer allow it, its hold is released, the agent is told not to pay, and the page shows it as released at confirm.
