policy.set
set(agentId, spendingLimit?, allowedTargets?) → UpdateReceipt Update an agent's on-chain spending policy. The owner submits the transaction via WaaS. Omitted fields keep their current value.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
agentId | string | ✓ | The agent's UUID. |
spendingLimit | string | - | Max OKRW per transaction as a decimal string (e.g. '100'). '0' = unlimited. |
allowedTargets | string | - | Comma-separated destination addresses. Empty string ('') = allow all. |
Returns
Type:
object Returns txHashes for the metadata updates.
Errors
| Code | Name | Description |
|---|---|---|
AGENT_PENDING | AgentPending | Agent has no on-chain record yet. |
Examples
Set 50 OKRW Limit
{
"agentId": "123e4567-e89b-12d3-a456-426614174000",
"spendingLimit": "50"
} Restrict to Specific Address
{
"agentId": "123e4567-e89b-12d3-a456-426614174000",
"allowedTargets": "0xAAA111...,0xBBB222..."
}