Docs

Start

How Mortise works

Mortise is a vault on Robinhood Chain that an AI agent can run but cannot take. The owner plugs in what the agent may do, piece by piece, and pulls pieces out again with one signature. Plugging and unplugging never moves the funds.

The parts

PartWhat it is
VaultA Safe 1.4.1 account with Safe7579, so it takes ERC-7579 modules. It holds the funds. Its address is fixed by the root and a number, so it can be known and funded before it exists.
RootThe owner's keys: one to ten ECDSA keys or passkeys with a threshold. Only the root changes settings, plugs pieces in and out, and can always move the funds directly.
GateThe vault's policy engine and its only executor for agents. Every agent action passes through it. It is deployed once, has no admin and cannot be upgraded.
AdaptersOne per protocol. An adapter turns an action into the exact calls it needs and lists every token those calls can move. It never holds funds.
Strategy modulesDCA, automation and rebalance. They propose actions on their own when the keeper the owner named triggers them, and pass the same checks as an agent.
Sub-vaultsVaults with no keys of their own. The parent vault is their root. One per agent or strategy keeps a mistake inside its own funds.

When an agent acts

  1. The agent sends one or more actions to the Gate from its own address and pays its own gas. It holds no vault key.
  2. For each action, the adapter returns a plan: the market, the calls and every token they can move.
  3. The Gate checks the agent, its expiry, the adapter, the market and every call against the adapter's declared rules and the owner's settings.
  4. It reads the balances, runs the calls as one batch through the vault, reads the balances again, charges each decrease to the agent's cap, checks the price floor on swaps and requires every approval to end at zero.
  5. If any check fails, the whole batch is undone and nothing moves.

What the owner controls

SettingWhat it decides
AgentsWhich addresses may act, and until when. A revoked or expired agent stops at once.
AdaptersWhich protocols each agent or module may use.
MarketsWhich pools, curves, lending markets, ERC-4626 vaults, recipients and bridge routes each adapter may use.
CapsHow much of each token each agent or module may spend per period. A token without a cap cannot be spent.
Price floorsThe least a swap must return per unit sold, per token pair. For Uniswap liquidity, the two floors of a pair also bound the pool price.
Open tradingOptional, per agent and adapter: any market the adapter accepts, and an open floor for pairs with no floor set. Caps and every floor the owner set still hold.
PauseOne switch that freezes every agent and module. The vault or a pauser it names presses it; only the root lifts it.
GuardiansWho can replace a lost root, how many must agree, and a wait of 7 to 90 days the root can cancel.
TimelockAn optional delay of 1 to 30 days on every change that widens what the vault allows. Tightening and withdrawals to registered addresses run at once.

Guarantees

These hold for every vault, whatever its settings, and are checked by the tests and proofs described in the security model.

Guarantee
I1Calls reach only targets the adapter declared, in a plain batch, never through delegatecall and never back into the vault.
I2The included adapters pay every output and position to the vault or its family, or to a recipient or bridge route the owner listed, and grant no operator rights.
I3No approval outlives the batch: every ERC-20 and Permit2 approval in it must end at zero.
I4The vault signs no ERC-1271 message unless the owner installs the signer, and never while a hook such as the timelock is installed.
I5Caps count raw balance changes, so fee-on-transfer and stock tokens are charged exactly.
I6Agents and modules cannot change settings, install modules or rotate the root. A pauser can only pause.
I7The root can always move the vault's assets directly, without the Gate.
I8Open trading never lifts a cap or a price floor the owner set.
I9Only its parent runs a sub-vault, never the parent's agents, and the parent can never lose that control.