A Leash agent is a single MPL Core asset that follows Metaplex’s MIP-104 / Agent Identity standard. Its identity (registration JSON), treasury (Asset Signer PDA), and policy (leash block + RulesV1 doc) all hang off that one mint. Buyer and seller are capabilities layered on top of the same asset; an agent can do either, both, or neither at any time. Although the asset is one thing, three keypairs are wired to it at run-time — the owner, the executive, and the optional operator. Read Identities before working through the lifecycle below if you haven’t seen that distinction yet; the rest of this page assumes it.

Lifecycle

  1. Create — mint a Core asset and attach an AgentIdentity plugin in one tx. Use createAgent from @leash/registry-utils (see Create an agent) or the BYO equivalent (createCollectioncreateregisterAgentIdentity).
  2. ReadgetAgentIdentityStatus(umi, asset) returns whether the identity is registered and the agent’s treasury PDA. The on-chain registration URI lives on the AgentIdentity plugin and points to off-chain JSON.
  3. Run — to let an executive submit transactions for the agent, call registerExecutive once per wallet, then delegateExecution per asset. The executive then signs Core Execute instructions on the agent’s behalf.
  4. Fund — call setSpendDelegation per stable mint (USDC / USDT / USDG) the agent should be able to spend. Optionally pre-create every supported stable ATA in one shot with provisionTreasuryAtas so wallets and faucets can target the treasury without an “ATA missing” round-trip. See Fund an agent.

Runtime surface

  • @leash/coreAgent, treasuryPda, deriveAgentTreasuryAddress, deriveAgentTreasuryAta, policy + receipt machinery.
  • @leash/registry-utilscreateAgent, getAgentIdentityStatus, registerExecutive, delegateExecution, setSpendDelegation, provisionTreasuryAtas, withdrawTreasury, plus registration URI resolution and ERC-8004 helpers.
  • @leash/seller-kit / @leash/buyer-kit — capability layers over the same asset.