Republic of Singapore · Open-Access Scientific Research · Non-Advisory & Zero Fundraising 6-Jurisdiction Safe Harbor & COPE Disclosures
W3CR-WP-2026-03 2026/11/23 Artifacts AvailableArtifacts FunctionalResults Reproduced

Prompt-Injection Impossibility via Deterministic Pre-Sign AST Firewalls and Bounded ERC-7715 Delegation基于确定性预签名 AST 防火墙与有界 ERC-7715 委托的提示词注入不可能性定理

Web3 Capital Research — Division III Agent Safety & Formal Verification Working GroupWeb3 Capital 研究院 · 第三学部自主智能体安全与形式化验证工作组
Division III · Autonomous Agent Safety & Formal Verification第三学部 · 自主智能体安全与形式化验证

PDF SHA-256: 13155ae44e0676af463f88ff5f3d4f853b98b3da4cf34953e993d47a987e9be3

Abstract学术摘要

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.向大语言模型(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 项安全义务核验。

Theorem 3.1 (Semantic Noninterference & Prompt-Injection Impossibility)定理 3.1(不可信上下文语义非干涉与提示词注入越权签名不可能性定理)

lim K→∞ [ 1 - (1-ε)K ] = 1 (ε>0) , ∀ u ∈ Σ* : Pr [ Sign (tx) = 1 ∧ tx ∉ L (Φ)   |   u ] ≡ 0

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可证伪实证基准指标

0 bits
LLM Context Private-Key Exposure大模型上下文私钥暴露量

Signing keys physically air-gapped from neural context and agent runtime memory签名密钥与大模型推理上下文及宿主环境变量严格物理气隙隔离

64 KB / 14
Air-Gapped MCP Envelope & Tools气隙 MCP 信封上限与工具集

64 KB frame ceiling across 14 typed JSON-RPC 2.0 tools with 0 npm dependencies单帧 64 KB 硬上限、14 项强类型确定性工具与零第三方 npm 运行时依赖

60 / 60
Verified Security Obligations已核验洁净室安全义务

OBL-001..OBL-060 deterministic suite including risk-score >= 94 auto-haltOBL-001 至 OBL-060 全绿通过,高危混淆载荷风险分 >= 94 自动熔断

0.00%
Prompt-Injection Breach Rate (ASR_inj)对抗注入越权率 (ASR_inj)

Decidable O(|tx|) AST + ERC-7715 target, selector, cap & <= 30d TTL guardO(|tx|) 可判定 AST 结合 ERC-7715 白名单、选择器、限额与 <= 30 天有效期硬拦截

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 ε>0, an adaptive adversary embedding K polymorphic payloads drives cumulative compromise probability Pbreach(K)=1-(1-ε)K 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)可强制安全策略理论,任何单次漏报率 ε>0 的概率分类器均不具备引用监控器可靠性:面对构造 K 轮多态注入载荷的自适应对手,累计失守概率 Pbreach(K)=1-(1-ε)K 必随轮次指数级逼近 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 DLLM and an isolated cryptographic signing domain DVault 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 (AΦ): Every candidate transaction or EIP-5792 atomic call bundle B=[c1,…,cm] is parsed from raw hexadecimal bytes into a typed Abstract Syntax Tree prior to cryptographic signing. For each elementary call cj=(to,value,data), AΦ evaluates a conjunction of five decidable predicates in O(|B|) time:

  • Target Containment: cj.to∈Φ.Allowtarget (normalized EIP-55 / chain-scoped address set).
  • Selector & AST Decode Soundness: |cj.data|=0 (if value-only permitted) or cj.data[0:4]∈Φ.Allowsel, 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 ≥94) 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 Vwindow+∑jval(cj)≤Φ.Cap and hard session expiry Texp-Tgrant≤30 days.

3. Proof of Noninterference: In Goguen-Meseguer terms, purge all high-untrusted inputs u against the boolean indicator Itx∉L(Φ)⋅Sign(tx). Because DVault invokes ECDSA/P-256 signing only when AΦ(tx)=ACCEPT, and AΦ(tx)=ACCEPT⟺tx∈L(Φ), the conjunction Sign(tx)=1∧tx∉L(Φ) is unsatisfiable for every u∈Σ*.

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

2. 线性时间可判定预签名 AST 自动机(AΦ):任意候选事务或 EIP-5792 原子调用束 B=[c1,…,cm] 在触达硬件或内存签名器之前,均由零外部依赖解码器解析为强类型抽象语法树(AST),并在 O(|B|) 时间内检验五重正交合取谓词:

  • 目标地址白名单包含:校验每笔子调用满足 cj.to∈Φ.Allowtarget(强绑定链 ID 与规范校验和地址)。
  • 选择器与递归批解码完备性:强制 cj.data[0:4]∈Φ.Allowsel,并对 ERC-7579 executeBatch 等多级嵌套调用帧执行递归展开,杜绝内层走私恶意选择器。
  • 高危载荷确定性熔断:针对 MAX_UINT256 无限授权、未授权 EIP-7702 代码指针覆写及 eth_sign 盲签摘要立即赋予风险分 ≥94 并自动熔断阻断。
  • ERC-7715 滚动配额与有效期封顶:原子累加校验 Vwindow+∑jval(cj)≤Φ.Cap,且强制会话委托寿命上限 Texp-Tgrant≤30 days。

3. 语义非干涉严格证明:在 Goguen-Meseguer 非干涉框架下考察越权签名指示量 Itx∉L(Φ)⋅Sign(tx)。由于金库域 DVault 触发密码学签名的充要前提为 AΦ(tx)=ACCEPT⟺tx∈L(Φ),合取式 Sign(tx)=1∧tx∉L(Φ) 在一阶逻辑上恒为永假式,故无论外部注入上下文 u∈Σ* 如何自适应演化,越权签名率恒等于零。

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)。

Decidable AST Truth-Table ASR_inj = 0.00%

Non-LLM Pre-Sign AST Firewall Truth-Table Verifier非大模型确定性预签名 AST 防火墙真值表验证胶囊

Evaluating AST truth-table predicates...
WebCrypto SHA-256 < 50 ms In-Browser Verifier

Live Content-Addressed Provenance & PDF Byte Verifier浏览器实时内容寻址溯源与 PDF 字节哈希验证胶囊

Fetches the live artifact and /provenance.json directly in your browser, computes SHA-256 via window.crypto.subtle.digest, and verifies byte-exact cryptographic reproducibility.直接在浏览器内拉取静态 PDF/向量文件与 /provenance.json 账本,调用原生 WebCrypto SHA-256 现场核验字节级可复现性。

Inspect /provenance.json查看存证总账本
Initializing WebCrypto SHA-256 provenance check...

Verified References真实可核验参考文献

  1. [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
  2. [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
  3. [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
  4. [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
  5. [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
  6. [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

BibTeX Citation RecordBibTeX 学术引用条目

@techreport{w3cr-wp-2026-03,
  title       = {Prompt-Injection Impossibility via Deterministic Pre-Sign AST Firewalls and Bounded ERC-7715 Delegation},
  author      = {{Web3 Capital Research — Division III Agent Safety & Formal Verification Working Group}},
  institution = {Web3 Capital Research (Republic of Singapore)},
  number      = {W3CR-WP-2026-03},
  year        = {2026},
  month       = {11},
  url         = {https://research.web3.capital/papers/w3cr-wp-2026-03},
  pdf         = {https://research.web3.capital/papers/w3cr-wp-2026-03.pdf},
  note        = {Open-Access Foundational Monograph (CC-BY-4.0) · Division III · Autonomous Agent Safety & Formal Verification}
}

Search Monographs, Standards & Divisions