Configuring Spending Policy

agents intermediate

How to set and verify an agent's spending limit and allowed targets — stored in the IdentityRegistry, enforced by MAWS.

Policies are stored on-chain in the IdentityRegistry. You update them using the policy.set tool. MAWS checks them before it signs; the chain itself does not read them.

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": "1000000",
  "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.

Conclusion

The policy is now active in MAWS: the MCP server checks every transfer against it before signing. The Maroo chain does not read these keys, so they do not limit a transaction sent outside MAWS — for an on-chain cap, see pcl-template-agent-okrw-transfer-limit-policy.
ESC
Type to search