---
eip: 8226
label: ERC-8226
title: Regulated Agent Mandate
status: Draft
type: Standards Track
category: ERC
created: 2026-04-12
requires: 165, 712, 1271
official: https://eips.ethereum.org/EIPS/eip-8226
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8226.md
canonical: https://eips.huatuo.xyz/zh/eip-8226/
lang: zh
tldr: 提出一个链上授权（mandate）注册表，使通过 KYC 的投资者可以授予 AI 智能体对受监管代币的、有范围、有时限、有上限的权限，代币可以在每次智能体操作之前检查该授权。
tags: [ai-agents, rwa, compliance, delegation, permissions]
---

# ERC-8226: Regulated Agent Mandate

> A compliance delegation layer for AI agents operating on tokenized regulated assets.

**TL;DR:** 提出一个链上授权（mandate）注册表，使通过 KYC 的投资者可以授予 AI 智能体对受监管代币的、有范围、有时限、有上限的权限，代币可以在每次智能体操作之前检查该授权。

## 它解决什么问题？

AI 智能体开始管理包含代币化受监管资产（基金份额、证券）的投资组合。要让智能体替投资者购买或转移这类代币，三件事必须同时成立：投资者是经过验证、通过合规审查的身份；智能体的权限可追溯、有时限、有上限（规范将其比作委托书）；并且代币合约能在操作发生时以原子方式检查这一权限。

[ERC-7943](/eip-7943/) 和 [ERC-3643](/eip-3643/) 等受监管代币标准决定*谁可以持有*代币，[ERC-8004](/eip-8004/) 等智能体注册表说明*存在哪些智能体*，但没有任何标准定义*这个智能体可以为这位投资者做什么*。ERC-8226（RAMS，Regulated Agent Mandate Standard）填补了这一层。

## 它如何运作

两个接口，理想情况下由不同的运营方运行：

- **`IComplianceProvider`**（例如 KYC 提供方的适配器）授予和撤销委托人（principal）的资格，并针对 `checkPrincipal(principal, identityRef)` 返回 `eligible`、一个 `ReasonCode`（`KYC_EXPIRED`、`AML_FLAG`、`JURISDICTION_BLOCKED`……）以及 `expiresAt`。
- **`IAgentMandate`**（RAMS 注册表）为每个 `(agent, principal, asset)` 存储一份有效的授权，包含有效期、单笔交易上限、累计上限、已启用的 `bytes32` 动作标签列表，以及所使用的合规提供方。

生命周期：

1. 委托人直接调用 `grantMandate`，或将其签署为 [EIP-712](/eip-712/) 类型化数据（域名 `"RAMS"`），并用 [ERC-1271](/eip-1271/) 验证，因此多签和智能钱包也可使用。注册表会检查委托人是否合格，以及授权的存续时间是否不超过其合规有效期。
2. 在智能体执行操作之前，代币（或执行者）调用 `canExecute(agent, principal, asset, action, amount)`，返回 `ok` 以及*第一个*失败的原因：`NONEXISTENT`、`AGENT_FROZEN`、`PRINCIPAL_FROZEN`、`NOT_YET_VALID`、`EXPIRED`、`REVOKED`、`ACTION_NOT_ENABLED`、`OVER_TX_CAP` 或 `OVER_CUMULATIVE_CAP`。
3. 操作完成后，`recordExecution` 把金额加到 `cumulativeUsed` 上。

委托人（或获批准的操作者）可以撤销或延期；延期不会重置已用金额。获授权的执行者（enforcer）可以冻结某个智能体或某个委托人，但不能撤销授权。

## 示例代码

在受监管代币上，对 ERC-20 风格的 `transferFrom` 进行门控，改编自规范的参考 modifier：

```solidity
// `rams` is the IAgentMandate registry address held by the token
error MandateBlocked(IAgentMandate.MandateReason reason);

modifier gatedByMandate(bytes4 selector, address holder, uint256 amount) {
    bytes32 action = bytes32(selector);          // left-aligned selector as the label
    bool agentCall = msg.sender != holder;
    if (agentCall) {
        (bool ok, IAgentMandate.MandateReason reason) =
            rams.canExecute(msg.sender, holder, address(this), action, amount);
        if (!ok) revert MandateBlocked(reason);
    }
    _;
    if (agentCall) rams.recordExecution(msg.sender, holder, address(this), action, amount);
}

function transferFrom(address from, address to, uint256 value)
    public override
    gatedByMandate(IERC20.transferFrom.selector, from, value)
    returns (bool)
{
    return super.transferFrom(from, to, value);
}
```

## 需要注意

- 状态为 **Draft**。
- 授权不能取代代币自身的 allowance 或操作者批准；两者都必须通过。
- 资格只在授予和延期时检查，而不是每次转账都检查，因此提供方故障不会冻结交易。授权期间失去资格的委托人，会被代币自身的资格检查（如果有的话）或执行者的冻结所拦截。
- 上限以资产自身的单位计（代币数量，或每次 NFT 转移计为 1），而不是法币，并且是按每份授权计，而不是按委托人的总体计。
- 已经部署的代币无法自行实现门控；对于它们，规范描述了通过执行者合约或 [EIP-7702](/eip-7702/) 委托账户来实施的方式。
- 某个授权配置能否满足特定监管机构的要求，不在标准范围之内，需要法律审查。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8226
