Intented docs

Rules

The owner's plain-English mandate, which the model judges every payment against.

The rules, also called the mandate, are the owner's plain-English text saying who the agent may pay, in what, and how much. The model judges every payment against this text.

Where they live

  • On-chain: the wallet stores only the rules' sha256 hash, mandate_hash, readable with get_config.
  • The text: stored by the Intented API, at most 2,000 characters, saved exactly as typed. Anyone can read it with GET /api/mandates/{text_hash} or on the web app's Rules page.

The wallet checks that the judge request carried the rules whose hash it holds. A verdict obtained with any other text is refused at execute.

The rules are public. The chain holds only the hash, but the text is readable by anyone through the API and the web app. Don't put anything private in them.

Writing them

The model applies what you write literally. Good rules name things exactly:

  • Who: the exact NEAR account (intented-vendor.testnet) or, for Base, the exact address (0x2ef2…49ef). "The vendor" or "trusted sellers" leaves the model guessing.
  • In what: the token, such as wNEAR or USDC.
  • How much: a limit per call, in that token.

For example:

Buy market data from intented-vendor.testnet, paid in wNEAR, at most 0.01 wNEAR per call,
or from 0x2ef2fed3f9b3d5385499008051031320b1fb49ef on Base, paid in USDC, at most 5 USDC per call.

The rules can only make the wallet stricter. A rule saying "up to 100 wNEAR" doesn't raise a 0.01 wNEAR per-payment cap: the contract refuses anything over its hard limits.

Changing them

The owner changes the rules on the wallet's page: Rules, then Edit, then Save and sign. The page stores the new text with the API and asks the owner's NEAR wallet to sign set_mandate with its hash. The API judges each new proposal under the rules whose hash the wallet holds at that moment, so the change applies from the next payment. A verdict given under the old rules fails at execute, because its request carries the old hash.

If you run your own API, it must hold the text of the active rules, or it refuses to judge with 409. Save the text once through that API's web app, or with POST /api/mandate.

On this page