Context
register_agent writes a default SpendingPolicy with very large limits, and no public function updates it.
Problem
Every agent is permanently stuck with the defaults — 1,000,000 USDC per transaction and 10,000,000 per day. The SpendingPolicy UI component and the agent runtime's AGENT_MAX_PER_TX / AGENT_MAX_PER_DAY environment variables both imply this is configurable. It is not.
Proposed approach
Add set_policy(agent_address, max_per_tx_stroops, max_per_day_stroops, allowed_categories, min_score_to_earn, caller) gated on the agent's owner, preserving daily_spent_stroops and last_reset_ledger across the update.
Acceptance criteria
Where to look
contract/agents/src/lib.rs:217
Comment to claim this before you start so we avoid duplicate work. If the approach above looks wrong, say so in the thread — the proposal is a starting point, not a specification.
Context
register_agentwrites a defaultSpendingPolicywith very large limits, and no public function updates it.Problem
Every agent is permanently stuck with the defaults — 1,000,000 USDC per transaction and 10,000,000 per day. The
SpendingPolicyUI component and the agent runtime'sAGENT_MAX_PER_TX/AGENT_MAX_PER_DAYenvironment variables both imply this is configurable. It is not.Proposed approach
Add
set_policy(agent_address, max_per_tx_stroops, max_per_day_stroops, allowed_categories, min_score_to_earn, caller)gated on the agent's owner, preservingdaily_spent_stroopsandlast_reset_ledgeracross the update.Acceptance criteria
Where to look
contract/agents/src/lib.rs:217Comment to claim this before you start so we avoid duplicate work. If the approach above looks wrong, say so in the thread — the proposal is a starting point, not a specification.