Concepts
Policies
The limits each agent gets, and the rules the contract applies to them.
Each agent registered on a wallet has one policy. The owner sets it with register_agent and changes it with update_policy. Each change bumps the agent's policy_version, which is stamped on every hold and ledger entry so you can tell which rules applied.
Fields
Prop
Type
Anything outside these ranges fails with InvalidPolicy (103), or TooManyAllowedSellers (104) for more than 32 sellers.
How the budget is counted
- The day is a UTC day.
day_index = ledger_timestamp / 86,400. The first payment after midnight UTC resetsspent_todayto 0. - Open holds count against the budget. A pending or approved hold reserves its amount. Settling it moves the amount into
spent_today, while denying it or letting it expire frees the reservation. - Projection, not after-the-fact. The contract refuses a payment if
spent_today + active holds + amount > daily_budget. You can't overshoot by a single large payment.
Agent status
| Status | Can pay? | Owner action |
|---|---|---|
Active | Yes | resume_agent |
Paused | No, but the policy and history are kept | pause_agent |
Revoked | No, permanently | revoke_agent |
On top of these, the owner can pause the whole wallet with pause. That freezes every agent, every payment and every new hold until unpause.
Changing a policy safely
update_policyapplies straight away to new payments.- Holds keep the
policy_versionthey were created under, so the audit trail shows which rules applied. - To cut an agent off immediately,
pause_agentorrevoke_agentis faster and clearer than shrinking its budget.