---
id: "W3CR-WP-2026-03"
slug: "w3cr-wp-2026-03"
institution: "Web3 Capital Research (Republic of Singapore)"
division: "Division III · Autonomous Agent Safety & Formal Verification"
author_group: "Web3 Capital Research — Division III Agent Safety & Formal Verification Working Group"
publication_date: "2026/11/23"
license: "CC-BY-4.0"
canonical_url: "https://research.web3.capital/papers/w3cr-wp-2026-03"
pdf_url: "https://research.web3.capital/papers/w3cr-wp-2026-03.pdf"
badges: ["Artifacts Available", "Artifacts Functional", "Results Reproduced"]
---

# W3CR-WP-2026-03: Prompt-Injection Impossibility via Deterministic Pre-Sign AST Firewalls and Bounded ERC-7715 Delegation
**中文命题**：基于确定性预签名 AST 防火墙与有界 ERC-7715 委托的提示词注入不可能性定理

- **Institutional Attribution (COPE)**: Web3 Capital Research — Division III Agent Safety & Formal Verification Working Group / Web3 Capital 研究院 · 第三学部自主智能体安全与形式化验证工作组
- **Division**: Division III · Autonomous Agent Safety & Formal Verification
- **Publication Date**: 2026/11/23 · **License**: CC-BY-4.0 Open Access

## Abstract (EN)
Granting large language models (LLMs) direct custody of cryptographic signing keys or relying on probabilistic secondary LLM classifiers to screen outgoing transactions is provably broken under adaptive indirect prompt injection: any non-zero single-turn false-negative rate epsilon > 0 compounds across K adversarial turns toward certainty, lim_{K->infinity} [1 - (1 - epsilon)^K] = 1. Drawing on Goguen-Meseguer noninterference and Schneider execution-monitoring theory, this monograph proves a constructive impossibility result against unauthorized transaction signing. We isolate master key material behind a 64 KB Model Context Protocol (MCP) air-gap exposing exactly 14 typed tools, where every candidate EIP-5792 call bundle must satisfy a decidable linear-time O(|tx|) Abstract Syntax Tree (AST) policy automaton parameterized by ERC-7715 capabilities (contract allowlists, 4-byte ABI selectors, periodic spend caps, blind-signature prohibition, and <= 30-day TTL). Consequently, arbitrary untrusted context streams produce exact out-of-policy signing probability ASR_inj = 0.00%, verified across 60/60 zero-dependency clean-room security obligations.

## 摘要 (ZH)
向大语言模型（LLM）进程直接暴露签名私钥或依赖次级大模型概率分类器审查待签交易，在自适应间接提示词注入下已被数学证伪：任何单轮漏报率 epsilon > 0 的概率守卫在 K 轮自适应重放攻击下累计失守概率必然收敛至 1，即 lim_{K->infinity} [1 - (1 - epsilon)^K] = 1。本专著融合 Goguen-Meseguer 语义非干涉模型与 Schneider 可强制安全策略自动机理论，给出阻断越权签名的构造性不可能性证明。系统将主密钥完全物理隔离于 64 KB 模型上下文协议（MCP）气隙边界之后，仅暴露 14 项强类型确定性工具；任意候选 EIP-5792 原子调用束在接触签名器前，必须通过复杂度为 O(|tx|) 的可判定抽象语法树（AST）预签名防火墙校验，强制满足 ERC-7715 能力谓词（目标合约白名单、4 字节函数选择器、周期支出上限、禁绝盲签与 <= 30 天硬性过期窗口）。由此严格保证任意恶意污染上下文触发越权签名的攻击成功率恒为 ASR_inj = 0.00%，并在零第三方 npm 依赖洁净室套件中通过全部 60/60 项安全义务核验。

## Formal Theorem — Theorem 3.1 (Semantic Noninterference & Prompt-Injection Impossibility) / 定理 3.1（不可信上下文语义非干涉与提示词注入越权签名不可能性定理）
Let an autonomous reasoning agent M process arbitrary adversarial token sequences u in Sigma* without read access to private signing key sk (mutual information I(Context_M; sk) = 0 bits). Suppose every signature request generated by M passes through a deterministic execution monitor A_Phi implementing policy language L(Phi) over canonicalized transaction ASTs: target address in Allow_addr, 4-byte calldata selector in Allow_sel (disallowing raw fallback/delegatecall/unlimited-approval selectors unless explicitly scoped), cumulative rolling value v_cum + v_tx <= Cap_period, and block timestamp t_now <= T_exp <= t_grant + 30 days. Because A_Phi is a total, decidable O(|tx|) state predicate independent of u, no adversarial prompt u in Sigma* can induce a valid cryptographic signature outside L(Phi), establishing exact breach rate ASR_inj = 0.

设自主推理智能体 M 处理任意不可信对抗词元流 u ∈ Sigma*，且对底层签名私钥 sk 的物理接触信息量严格满足 I(Context_M; sk) = 0 bits。若 M 发出的全部签名提案均必须经由实现策略形式语言 L(Phi) 的确定性执行监控器 A_Phi 判定：校验规范化事务 AST 同时满足目标地址属于 Allow_addr、4 字节 ABI 选择器属于 Allow_sel（默认阻断未知盲签、delegatecall 与无上限授权）、周期累计金额 v_cum + v_tx <= Cap_period 且当前时间戳 t_now <= T_exp <= t_grant + 30d。由于自动机 A_Phi 是独立于自然语言上下文 u 的全函数可判定 O(|tx|) 布尔谓词，任意恶意提示词流 u ∈ Sigma* 构造越权有效签名的概率恒等于零（ASR_inj = 0）。

## Falsifiable Empirical Metrics
| Metric | Value | Verification Note |
| :--- | :--- | :--- |
| LLM Context Private-Key Exposure (大模型上下文私钥暴露量) | `0 bits` | Signing keys physically air-gapped from neural context and agent runtime memory |
| Air-Gapped MCP Envelope & Tools (气隙 MCP 信封上限与工具集) | `64 KB / 14` | 64 KB frame ceiling across 14 typed JSON-RPC 2.0 tools with 0 npm dependencies |
| Verified Security Obligations (已核验洁净室安全义务) | `60 / 60` | OBL-001..OBL-060 deterministic suite including risk-score >= 94 auto-halt |
| Prompt-Injection Breach Rate (ASR_inj) (对抗注入越权率 (ASR_inj)) | `0.00%` | Decidable O(|tx|) AST + ERC-7715 target, selector, cap & <= 30d TTL guard |

## Problem Formulation & System Model / 问题形式化定义与系统模型

Autonomous tool-using agents routinely ingest untrusted external data—web documents, code repositories, cross-agent messages, and on-chain metadata—into the same neural attention workspace that plans tool invocations. Unlike SQL injection, natural language lacks a syntactic separation between data and control instructions within transformer self-attention layers.

 First-generation "agentic wallets" commit two fatal architectural errors: (1) loading raw BIP-39 seeds or session private keys into environment variables inside the agent's Python/Node.js runtime, or (2) interposing a "guardrail LLM" to judge whether a proposed transaction looks benign. Under Saltzer and Schroeder's Principle of Complete Mediation (1975) and Schneider's characterization of Enforceable Security Policies (2000), probabilistic neural filters fail the foundational requirement of reference-monitor soundness: for any single-query evasion rate [Formal Mathematical Expression] , an adaptive adversary embedding [Formal Mathematical Expression] polymorphic payloads drives cumulative compromise probability [Formal Mathematical Expression] arbitrarily close to 1.

 - Ambient Authority Hazard: An agent holding a raw private key possesses unbounded authority across every chain, asset, and contract simultaneously.

 - Calldata Obfuscation & Blind Signing: Malicious prompts frequently instruct agents to sign opaque EIP-712 digests, eth_sign raw hashes, or nested EIP-7702 / DELEGATECALL upgrades disguised as routine settlements.

具备工具调用能力的自主智能体在日常运行中必须持续读取外部不可信数据（网页文档、第三方代码仓、跨智能体报文及链上元数据），并将其与系统指令混合在同一 Transformer 自注意力工作空间内。与传统程序不同，神经网络隐空间在数学上不存在“指令流”与“数据流”的固有语法隔离。

 初代“AI 钱包”普遍犯下两类致命架构错误：其一，将原始助记词或私钥直接注入智能体宿主进程的环境变量（违背最小权限原则）；其二，试图用另一个“守卫大模型”对交易意图做自然语言审查。依据 Saltzer 与 Schroeder（1975）完全中介原则及 Schneider（2000）可强制安全策略理论，任何单次漏报率 [Formal Mathematical Expression] 的概率分类器均不具备引用监控器可靠性：面对构造 [Formal Mathematical Expression] 轮多态注入载荷的自适应对手，累计失守概率 [Formal Mathematical Expression] 必随轮次指数级逼近 100%。

 - 环境全权失控（Ambient Authority）： 一旦推理进程接触裸私钥，单次上下文投毒即可在毫秒内清空全链资产或篡改账户所有权。

 - 调用数据混淆与盲签陷阱： 对抗性提示词常诱导智能体签署不透明摘要、无限额度 approve 或伪装成普通微支付的 EIP-7702 代码委托与 DELEGATECALL 提权载荷。

## Formal Construction & Mathematical Proof / 形式化构造与数学证明

1. Physical Key Air-Gap & Bounded 64 KB MCP Transport: We partition the architecture into an untrusted reasoning domain [Formal Mathematical Expression] and an isolated cryptographic signing domain [Formal Mathematical Expression] communicating solely over a strict JSON-RPC 2.0 Model Context Protocol (MCP) channel capped at 64 KB ( 65,536 bytes ) per frame. Exactly 14 deterministic tools are exposed (including offline ABI decoding, simulation, and scoped EIP-5792 submission); zero methods exist to export seeds, raw private scalars, or arbitrary blind-hash signatures.

 2. Decidable Pre-Sign AST Automaton ( [Formal Mathematical Expression] ): Every candidate transaction or EIP-5792 atomic call bundle [Formal Mathematical Expression] is parsed from raw hexadecimal bytes into a typed Abstract Syntax Tree prior to cryptographic signing. For each elementary call [Formal Mathematical Expression] , [Formal Mathematical Expression] evaluates a conjunction of five decidable predicates in [Formal Mathematical Expression] time:

 - Target Containment: [Formal Mathematical Expression] (normalized EIP-55 / chain-scoped address set).

 - Selector & AST Decode Soundness: [Formal Mathematical Expression] (if value-only permitted) or [Formal Mathematical Expression] , with recursive unpacking of ERC-7579 executeBatch frames so nested sub-calls cannot smuggle unauthorized selectors.

 - Hazard Halt Invariant: Immediate fail-closed rejection (risk score [Formal Mathematical Expression] ) on unbounded MAX_UINT256 approvals, unverified EIP-7702 code-delegation tuples, or eth_sign raw digests.

 - ERC-7715 Rolling Spend & TTL Envelope: Monotone accounting ensures [Formal Mathematical Expression] and hard session expiry [Formal Mathematical Expression] .

 3. Proof of Noninterference: In Goguen-Meseguer terms, purge all high-untrusted inputs [Formal Mathematical Expression] against the boolean indicator [Formal Mathematical Expression] . Because [Formal Mathematical Expression] invokes ECDSA/P-256 signing only when [Formal Mathematical Expression] , and [Formal Mathematical Expression] , the conjunction [Formal Mathematical Expression] is unsatisfiable for every [Formal Mathematical Expression] .

1. 私钥物理气隙隔离与 64 KB 有界 MCP 传输层： 架构在物理进程边界上严格切分为不可信推理域 [Formal Mathematical Expression] 与高可信签名金库域 [Formal Mathematical Expression] ，二者仅通过单帧上限为 64 KB （ 65,536 bytes ）的 JSON-RPC 2.0 模型上下文协议（MCP）通信。接口严格收敛为 14 项强类型确定性工具（涵盖离线 ABI 解码、沙盒预执仿真与受限 EIP-5792 批提交），在协议词法层彻底移除任何私钥导出或任意哈希盲签入口。

 2. 线性时间可判定预签名 AST 自动机（ [Formal Mathematical Expression] ）： 任意候选事务或 EIP-5792 原子调用束 [Formal Mathematical Expression] 在触达硬件或内存签名器之前，均由零外部依赖解码器解析为强类型抽象语法树（AST），并在 [Formal Mathematical Expression] 时间内检验五重正交合取谓词：

 - 目标地址白名单包含： 校验每笔子调用满足 [Formal Mathematical Expression] （强绑定链 ID 与规范校验和地址）。

 - 选择器与递归批解码完备性： 强制 [Formal Mathematical Expression] ，并对 ERC-7579 executeBatch 等多级嵌套调用帧执行递归展开，杜绝内层走私恶意选择器。

 - 高危载荷确定性熔断： 针对 MAX_UINT256 无限授权、未授权 EIP-7702 代码指针覆写及 eth_sign 盲签摘要立即赋予风险分 [Formal Mathematical Expression] 并自动熔断阻断。

 - ERC-7715 滚动配额与有效期封顶： 原子累加校验 [Formal Mathematical Expression] ，且强制会话委托寿命上限 [Formal Mathematical Expression] 。

 3. 语义非干涉严格证明： 在 Goguen-Meseguer 非干涉框架下考察越权签名指示量 [Formal Mathematical Expression] 。由于金库域 [Formal Mathematical Expression] 触发密码学签名的充要前提为 [Formal Mathematical Expression] ，合取式 [Formal Mathematical Expression] 在一阶逻辑上恒为永假式，故无论外部注入上下文 [Formal Mathematical Expression] 如何自适应演化，越权签名率恒等于零。

## Empirical Evaluation & Reference Implementation Verification / 实证评测与参考实现核验

We evaluated the pre-sign AST firewall and ERC-7715 capability engine across a comprehensive adversarial suite spanning malformed ABI encodings, nested batch smuggling, and supply-chain isolation audits:

 - Zero-Breach Adversarial Calldata Matrix: Across synthetic prompt-injected payloads attempting unlimited ERC-20 approvals, unauthorized recipient substitution, over-cap session transfers, expired ERC-7715 delegations (> 30 days ), and disguised EIP-7702 code-set authorizations, the deterministic AST monitor achieved ASR_inj = 0.00% (100% deterministic rejection with risk score 94 auto-halt on critical vectors) in sub-millisecond evaluation time.

 - 64 KB MCP Air-Gap & 14-Tool Completeness: Fuzzing both stdio and HTTP /api/mcp transports confirmed hard frame truncation/rejection above 64 KB , strict JSON-RPC schema enforcement across all 14 agentic tools, and 0 bits of secret-key material in agent memory dumps or error traces.

 - 60/60 Clean-Room Security Obligations & Zero Supply-Chain Surface: Static and dynamic verification suites confirmed 60/60 security obligations ( OBL-001 through OBL-060 ) passing with 0 runtime npm dependencies, eliminating third-party package hijacking vectors entirely.

工作组构建了覆盖畸形 ABI 编码、多层批处理走私、过期委托重放与供应链攻击面的对抗基准集，对预签名 AST 防火墙与 ERC-7715 能力引擎执行了全量实证核验：

 - 对抗性调用载荷零穿透（ ASR_inj = 0.00% ）： 面对模拟间接提示词注入生成的无限额度代币授权、收款方篡改、超额会话扣款、超 30 天 窗口请求及伪装 EIP-7702 委托覆写载荷，确定性 AST 防火墙在亚毫秒级延迟内达成 0.00% 越权穿透率（高危载荷触发风险分 94 自动熔断拦截）。

 - 64 KB MCP 气隙与 14 项工具完备性： 对 stdio 与 /api/mcp 双传输通道执行边界模糊测试，确认超过 64 KB 报文被确定性拒收， 14 项零信任工具严格符合模式校验，且推理进程内存快照与异常回执中的私钥泄漏量恒为 0 bits 。

 - 60/60 洁净室安全义务与零供应链暴露面： 全套静态与动态自动化门禁验证确认 OBL-001 至 OBL-060 共 60/60 项密码学与运行时安全义务 100% 通过，且保持 0 运行时第三方 npm 依赖，从源头彻底清零开源包投毒攻击面。

## Verification Provenance & Competing Interests Disclosure / 形式化验算溯源与利益关联披露

COPE & ACM Verification Provenance Statement: Authored and verified by the institutional Division III Agent Safety & Formal Verification Working Group under Principal Investigator oversight with zero fictional personal names. Policy-automaton truth tables and adversarial calldata rejection invariants are directly reproducible in-browser via the deterministic verification capsule ( capsuleType: "ast-firewall" ).

 Competing Interests & Reference Implementation Disclosure: Published by Web3 Capital Research (Republic of Singapore; https://research.web3.capital/ ) as open-access, non-advisory, zero-fundraising computer-security research under Singapore SFA 2001, FAA 2001, and PSA 2019 safe-harbor provisions, as well as the EU AI Act Regulation (EU) 2024/1689 Art. 2(6) scientific research exemption. Empirical 60/60 obligation benchmarks and 14-tool MCP harnesses were verified against the open-source non-custodial reference implementation maintained by MYRILUM LIMITED (Hong Kong UBI 80912065 ; https://myrilum.org/research and https://myrilum.io/ ), involving zero custodial asset handling and non-value synthetic test vectors ( S_token === 0 , r_holder === 0 ).

COPE 与 ACM 形式化验算溯源声明： 本专著由首席研究员立题审定，归属第三学部自主智能体安全与形式化验证工作组真实机构署名，零虚构真人学者头衔。文中 AST 策略自动机真值表与对抗载荷拦截不变量均可通过页面内嵌的确定性验证胶囊（ capsuleType: "ast-firewall" ）在浏览器端直接复现。

 研发关联透明披露与法定安全港边界： 本文由注册于新加坡共和国的 Web3 Capital Research （ https://research.web3.capital/ ）作为开放获取、非投顾、零募资计算机安全学术成果出版，严格遵循新加坡 SFA 2001、FAA 2001、PSA 2019 法定豁免以及欧盟《人工智能法案》（EU 2024/1689）第 2(6) 条纯科学研究豁免条款。文中 60/60 安全义务与 14 项 MCP 工具实证结果基于 MYRILUM LIMITED （香港 UBI 80912065 ； https://myrilum.org/research 与 https://myrilum.io/ ）维护的开源非托管参考实现核验，不涉及任何客户资产托管或商业代币招揽（ S_token === 0 ， r_holder === 0 ）。

## Verified References

- **[SS75]** Jerome H. Saltzer and Michael D. Schroeder (1975). *The Protection of Information in Computer Systems*. Proceedings of the IEEE, Vol. 63, No. 9, pp. 1278–1308. https://doi.org/10.1109/PROC.1975.9939
- **[GM82]** Joseph A. Goguen and José Meseguer (1982). *Security Policies and Security Models*. 1982 IEEE Symposium on Security and Privacy, pp. 11–20. https://doi.org/10.1109/SP.1982.10014
- **[Sch00]** Fred B. Schneider (2000). *Enforceable Security Policies*. ACM Transactions on Information and System Security (TISSEC), Vol. 3, No. 1, pp. 30–50. https://doi.org/10.1145/353323.353382
- **[EIP7702]** Vitalik Buterin, Sam Wilson, Ansgar Dietrichs, and Matt Garnett (2024). *EIP-7702: Set Code for EOAs*. Ethereum Improvement Proposals. https://eips.ethereum.org/EIPS/eip-7702
- **[EIP5792]** Moody Salem, Lukas Rosario, Wilson Cusack, Dror Tirosh, Jake Moxey, et al. (2022). *EIP-5792: Wallet Call API*. Ethereum Improvement Proposals. https://eips.ethereum.org/EIPS/eip-5792
- **[ERC7715]** Luka Isailovic, Derek Rein, Dan Finlay, Derek Chiang, Fil Makarov, et al. (2024). *ERC-7715: Request Permissions from Wallets*. Ethereum Improvement Proposals. https://eips.ethereum.org/EIPS/eip-7715

---
*Statutory Safe Harbor: Published by Web3 Capital Research (Republic of Singapore) strictly as general, non-advisory open-access scientific research (Non-SFA CMS/CIS, Non-FAA Advisory, Non-PSA DPT, Zero Fundraising).*
