Skip to main content

Agent mandate

An agent mandate confines a software agent's smart wallet on chain: its calls, its amounts and its end date. Two kill switches revoke it.

An agent mandate is the on-chain rule set that confines a software agent's Smart Wallet: which contracts and functions it may call, how much value it may move, and when its authority expires. The account installs the mandate validator as its only validator, enforcing every limit before any call runs.

Putting limits inside the smart wallet removes the weakness of software-only or API-key limits that a compromised agent key could lift. The platform bundler simulates validation before submission and rejects out-of-mandate operations before they reach the network.

The organisation's operations account owns and administers the mandate under the organisation owner's verified requests. The agent's key acts strictly inside the mandate and cannot modify the account or validator. For the operational API lifecycle, starter mandate, and error codes, see Agents and mandates.

What a mandate holds

Installing the mandate validator binds the agent's signing key, the mandate owner address, and the mandate record:

Part
What it bounds
expiresAt
Unix timestamp when authority ends (0 never expires on chain, while the platform requires a future timestamp).
periodSeconds
Length of each fixed spending window from the write block (non-zero on chain, 60 to 4,294,967,295 seconds in the platform).
nativeLimitPerTransaction
Maximum native currency per user operation (defaults to zero).
nativeLimitPerPeriod
Maximum native currency per spending window (defaults to zero).
gasLimitPerTransaction
Maximum gas cost, in native currency, per user operation the account pays for itself (zero refuses every such operation).
gasLimitPerPeriod
Maximum gas cost, in native currency, per spending window across those operations (zero refuses every such operation).
targets
Allowed contract addresses and permitted function selectors per contract (up to 32 targets, 16 selectors each).
assets
Metered ERC-20 tokens with per-operation and per-window ceilings (up to 16 assets).

Installations with zero addresses, zero-length periods, duplicate entries, or counts above module caps are refused so unenforceable mandates are never stored.

Who grants it

Two roles govern a mandate account. The agent's signing key authorises account creation once via a signed creation digest binding the validator, salt, deadline, and installation data. The organisation's operations account becomes the mandate owner and is the only address allowed to call setMandate, revoke, or transferMandateOwner (other callers revert with MandateOwnerOnly).

The account factory verifies that the mandate validator is registered in its module registry before deploying the account.

What the agent may call

Mandate accounts accept only single or batch execute(bytes32,bytes) user operations, keeping account administration outside the agent's reach:

  • No account or module mutations. Other call shapes revert with MandateCallDataRefused, delegate calls revert with MandateCallTypeRefused, and calls targeting the account or validator revert with MandateSelfCallRefused.
  • Target and selector allow list. Every call must match a listed target and selector (MandateTargetRefused otherwise), and empty-calldata native transfers are refused.
  • Metered asset discipline. On a metered asset, only transfer, transferFrom, and approve may be listed (MandateAssetSelectorRefused otherwise). Listing any of those three on an unmetered target is refused at install (MandateAssetUnmetered). Other selectors on unmetered targets are not token-metered, so list only required calls.

What an amount may be

Every metered ERC-20 amount and native value is checked against both a per-operation ceiling and a per-window ceiling:

  • Calls in a batch sum together against the per-operation ceiling, so splitting a payment across calls cannot exceed it (MandateAssetPerTransactionExceeded or MandateNativePerTransactionExceeded).
  • Window totals accumulate across fixed periodSeconds slices counted from the mandate's write block (MandateAssetPerPeriodExceeded or MandateNativePerPeriodExceeded). Writing a new mandate starts fresh counters immediately.
  • approve meters its full approved amount immediately regardless of whether the spender draws it. Gas fees are not part of these native and asset ceilings, because the gas ceilings below meter them.
  • Refused validations record no spend. Operations that pass validation and later revert during execution still consume spend counters.

What gas may cost

When the account pays its own gas (the user operation carries no paymaster), the validator also checks the worst-case gas cost of the operation: (verificationGasLimit + callGasLimit + preVerificationGas) * maxFeePerGas. The cost must stay within gasLimitPerTransaction (MandateGasPerTransactionExceeded), and the window total must stay within gasLimitPerPeriod (MandateGasPerPeriodExceeded). Both are set in native currency and start counting again with each new window and with each new mandate write. A sponsored operation is not counted, because the paymaster pays its gas.

How one user operation is checked

During ERC-4337 validation, a signature that fails to recover the agent's signing key returns SIG_VALIDATION_FAILED, while any mandate breach reverts with its named error before execution. The account also refuses all ERC-1271 signature checks (0xffffffff) so no asset can move via an off-chain signature bypassing target and ceiling checks.

The platform runs matching preflight checks before submission. See How agent actions are checked and attributed for platform refusal reasons.

How it ends

A mandate ends by expiry or permanent revocation:

  • Expiry. Past expiresAt, operations revert with MandateExpired. Until revoked, the mandate owner can write a replacement mandate with setMandate (the signing key stays fixed).
  • Revocation. Calling revoke stops agent operations from that block onward (MandateRevoked). The mandate owner can still sign operations that move the account's native currency, or an ERC-20 balance, to the owner's own address, so funds are never stranded. That path serves no other call, and the agent's key cannot use it. Revocation is permanent: setMandate and transferMandateOwner are refused forever, and granting a new mandate requires creating a new agent account.
  • No validator removal. The account cannot remove its last validator and refuses installing another, keeping the mandate validator permanently bound.
  • Administration transfer. The mandate owner can move administration to a non-zero address with transferMandateOwner.

Kill switches

An organisation owner stops agents through two kill switches. Both immediately block actions on the platform and then submit on-chain revoke transactions from the operations account:

  • Revoke one agent. Marks the agent revoked (refusing new actions with agent-revoked), requests cancellation of queued actions from the past seven days, and submits on-chain revocation recorded as agent-kill-switch. Already-broadcast actions can still land, so inspect agent activity afterwards.
  • Halt all agents. Revokes every non-revoked agent under organisation-kill-switch, blocks creating or editing agents, and refuses all scheduled or manual actions with organisation-halted. Switching the halt off permits creating new agents while previously revoked agents stay revoked.

If an on-chain revocation fails to land, the platform still blocks the agent while mandate.revokedAt remains null (and the Console Overview tab shows “The revocation has not reached the chain”). Resend the on-chain revocation via POST /api/v2/agents/{agentId}/revocation or Send revocation again (Agents). See Halt all agents for recovering after DALP-12103.

An agent revoked during setup never becomes active, and setup revokes its account automatically if already deployed.

Reading a mandate

Seven read-only contract views expose an account's live mandate without requiring a key, matching the Console agent page and GET /api/v2/agents/{agentId}:

View
Returns
mandateOf(account)
Signing key, mandate owner, expiry, revocation timestamp, period length, and native ceilings.
gasLimitsOf(account)
The gas ceiling per operation and per window.
gasSpentThisPeriod(account)
Gas cost counted in the current window.
allowedTargets(account)
Each permitted contract and its allowed function selectors.
meteredAssets(account)
Each metered token with its per-operation and per-window ceilings.
spentThisPeriod(account, asset)
Spend recorded in the current window for one token (pass zero address for native value).
isRevoked(account)
Whether the mandate has been revoked.

How it fits the platform

The mandate validator is an ERC-7579 validator module that denies direct key management, ensuring even platform-held agent keys cannot alter account settings. On chain, the account address is the sender recorded by roles, compliance checks, and the audit trail.

Like every Smart Wallet, a mandate account reads its implementation from the platform directory, so a directory implementation upgrade is the only change outside the validator. The hosted MCP server never runs writes as an agent and instead drafts writes for human signing (Drafts and the inbox).

Read Agents and mandates for creation, editing, kill-switch routes, and error codes, Agents for the Console steps, Smart Wallet for modular account rules, and User operations for bundling and settlement.

Was this page helpful?