Republic of Singapore · Open-Access Scientific Research · Non-Advisory & Zero Fundraising 6-Jurisdiction Safe Harbor & COPE Disclosures
W3AI-RFC-002 Verified Reference Standard Apache-2.0 / CC-BY-4.0 (Royalty-Free)

Decidable Pre-Sign AST Policy Firewall & Bounded Session Envelope (ERC-7715 / EIP-5792)可判定预签名 AST 策略防火墙与有界会话授权信封标准(ERC-7715 / EIP-5792)

W3AI Open Standards Steering Group · Agent Capability & Firewall Working GroupW3AI 开放标准指导委员会 · 智能体能力安全与预签防火墙工作组

Specifies a deterministic, linear-time O(|tx|) non-LLM abstract syntax tree (AST) calldata and session-envelope firewall across a 64 KB process-isolated MCP boundary, proving zero unauthorized signing under arbitrary adversarial context injection.规范跨越 64 KB 进程隔离 MCP 边界的线性时间 O(|tx|) 非大模型 AST 调用数据与有界会话防火墙,严格保证在任意自适应提示词注入下越权签名概率恒为零。

Normative Specification规范协议定义

1. Threat Model & Physical Key Air-Gap Invariant

Probabilistic language models processing untrusted web, tool, or retrieval streams exhibit non-zero per-turn classifier bypass rate epsilon > 0. Conformant runtimes MUST isolate signing keys in a separate address space communicating solely via a schema-typed JSON-RPC / MCP channel capped at 65,536 bytes (64 KB), satisfying mutual information I(K_priv; Context_LLM) = 0 bits.

2. Decidable Pre-Sign AST Policy Rules

  • Bounded Session Envelope (ERC-7715): Every delegated session MUST declare a positive period cap, target contract allowlist, 4-byte function selector allowlist, and hard TTL clamped to expiryDays <= 30.
  • Atomic Batch Inspection (EIP-5792): Multi-call bundles submitted via wallet_sendCalls MUST be recursively parsed; if any sub-call invokes an unlisted selector, unbounded approve(address,uint256), or value transfer above remaining cap, the entire bundle MUST abort fail-closed.
  • Authority Escalation Hard-Block: Raw digest signing (eth_sign), arbitrary DELEGATECALL (0xf4), and unverified account code delegation (SetCode / 0x04) from an agent session MUST be unconditionally rejected (risk score 99 / 100).
  • Lookalike Address-Poisoning Intercept: Counterparty addresses matching prefix/suffix nibbles of historical peers while diverging in interior bytes MUST be blocked prior to user or session signing (risk score >= 94 / 100).
∀ u ∈ Σ* : tx ∉ ℒ(Φ) ⟹ Pr [Sign(tx)∣u] ≡ 0

1. 威胁模型与私钥物理隔离不变量

处理不可信网页或检索上下文的大语言模型存在非零单轮分类漏报率 epsilon > 0。合规运行时必须将签名密钥隔离于独立受保护地址空间,仅通过上限 65,536 字节(64 KB)的强类型 MCP 通道交互,确保私钥与推理上下文互信息 I(K_priv; Context_LLM) = 0 bits。

2. 可判定预签名 AST 防火墙强制规则

  • 有界会话信封(ERC-7715):任何智能体委托会话必须显式声明周期额度上限、目标合约白名单、4 字节函数选择器白名单,且有效期强制钳制在 expiryDays <= 30。
  • 原子批量调用递归拆解(EIP-5792):通过 wallet_sendCalls 提交的批量调用必须逐笔执行 AST 语法树解码;任一子调用命中未授权选择器、无限额 approve 或超限转账时整包原子熔断。
  • 提权原语硬阻断:来自智能体会话的裸哈希盲签(eth_sign)、任意 DELEGATECALL (0xf4) 与未授权代码挂载(SetCode / 0x04)必须无条件拒绝(风险分 99 / 100)。
  • 首尾仿冒地址投毒拦截:与历史受信任地址首尾字符雷同但中间字节篡改的投毒地址必须在签名前确定性拦截(风险分 >= 94 / 100)。
∀ u ∈ Σ* : tx ∉ ℒ(Φ) ⟹ Pr [Sign(tx)∣u] ≡ 0

Canonical Wire JSON Schema标准报文 JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://research.web3.capital/schemas/w3ai-rfc-002.schema.json",
  "title": "W3AI-RFC-002 Bounded Session & AST Pre-Sign Policy Envelope",
  "type": "object",
  "required": [
    "standard",
    "chainId",
    "expiryDays",
    "periodCapUnits",
    "allowedTargets",
    "allowedSelectors",
    "blockRawEthSign",
    "blockSetCode",
    "nonLlmAstEnforced",
    "mcpFrameMaxBytes"
  ],
  "properties": {
    "standard": {
      "const": "W3AI-RFC-002/ERC-7715"
    },
    "chainId": {
      "type": "integer",
      "minimum": 1
    },
    "expiryDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 30
    },
    "periodCapUnits": {
      "type": "integer",
      "minimum": 1
    },
    "allowedTargets": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^0x[0-9a-fA-F]{40}$"
      }
    },
    "allowedSelectors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^0x[0-9a-fA-F]{8}$"
      }
    },
    "blockRawEthSign": {
      "const": true
    },
    "blockSetCode": {
      "const": true
    },
    "nonLlmAstEnforced": {
      "const": true
    },
    "mcpFrameMaxBytes": {
      "type": "integer",
      "maximum": 65536
    }
  },
  "additionalProperties": false
}

Clean-Room & Open-Source Reference Implementations独立洁净室验证器与开源参考实现

250 / 250 (100.0%)

W3AI-RFC-002 Adversarial Calldata AST VerifierW3AI-RFC-002 对抗调用数据 AST 确定性验证器

Web3 Capital Research (Republic of Singapore) · Apache-2.0

Clean-room linear-time policy automaton & 250 adversarial test vectors洁净室线性时间策略自动机与 250 组对抗调用向量

https://research.web3.capital/vectors/w3ai-conformance-v1.json

250 / 250 (100.0%)

MYRILUM Sovereign Wallet v5.1 Pre-Sign Firewall & 14-MCP Air-GapMYRILUM 主权钱包 v5.1 预签名防火墙与 14-MCP 隔离网关

MYRILUM LIMITED (HK UBI 80912065 · COPE Disclosed R&D Reference) · MIT

Zero-dependency client runtime (60/60 verified obligations, 0 npm dependencies)零外部依赖客户端参考实现(60/60 项安全义务核验,披露研发协同关联)

https://myrilum.io/

Normative References规范性引用文件

Search Monographs, Standards & Divisions