Configuring Spending Policy
How to set and verify an agent's on-chain spending limits and allowed targets.
Prerequisites
- An ACTIVE agent
Setting the Policy
Instruct your agent to call
policy.set. You can specify a spendingLimit (in OKRW) and/or allowedTargets (comma-separated addresses).{
"agentId": "your-agent-id",
"spendingLimit": "50",
"allowedTargets": "0xAddress1,0xAddress2"
} Verifying the Policy
Use
policy.get to read the metadata back from the chain.{
"agentId": "your-agent-id"
} Note: The owner address is always implicitly allowed, even if it's not in the `allowedTargets` list.