Skip to content

Agents: no way to update a spending policy after registration #322

Description

@ritik4ever

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

  • Owner can update their agent's policy
  • Non-owners are rejected
  • Accrued daily spend is preserved across updates
  • Frontend and agent runtime wire through to the new function

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1-highImportant — schedule for the next milestoneStellar WaveIssues in the Stellar wave programarea: contract-agentscontract/agents/src/lib.rs — LodestarAgentseffort: mediumRoughly half a day to two daysenhancementNew feature or capabilityhelp wantedMaintainers would welcome a contributor here

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions