# Proof-Gated Signing: Solver-Checked Transaction Guards that Hold Under State Drift for Onchain AI Agents

Crypto.world

> AI agents that hold wallet keys read content an attacker can influence (emails, token metadata, tool outputs), so they can be steered into proposing harmful transactions.

**arXiv**: 2610.00354

**Published**: 2026-09-30

**Authors**: Bravish Ghosh

## AI summary

## Overview

**Research area:** Computer security (cs.CR) — specifically the security of AI agents that control cryptocurrency wallets, combining program verification (SMT solving) with smart-contract wallet design.

**Technical level:** Advanced. The paper assumes familiarity with blockchain transaction semantics (allowances, payees, front-running, contract upgrades), satisfiability-modulo-theories solving, and formal soundness arguments, though its central idea can be grasped without the proofs.

**Scope (one sentence):** The paper introduces Proof-Gated Signing, a guard that proves a pre-signing policy check and then compiles that proof's assumptions into on-chain post-conditions enforced atomically by a smart-contract wallet, and evaluates it on a 260-scenario testbed against an allowlist, simulation-only checking, ablations, and an LLM judge.

## What This Paper Is About

AI agents that hold wallet keys read content an attacker can influence (emails, token metadata, tool outputs), so they can be steered into proposing harmful transactions. The standard last line of defense — a static allowlist, an LLM reviewer, or a transaction simulation — is evidence about the chain *at check time*, but the transaction executes later in a state an adversary can shape through front-running, contract upgrades, or token-parameter changes; the paper calls that gap **state drift**. The goal is a guard whose guarantee applies to the transaction that actually executes, no matter what changes between check and inclusion.

## Key Contributions

1. **Drift as the shared threat.** The paper identifies state drift as the failure mode common to simulation-, allowlist-, and LLM-based pre-signing guards, demonstrates it empirically, and reports the counterintuitive finding that showing a clean simulation to an LLM reviewer made it *more* likely to approve a drift attack (approval of the upgradeable-pool attack rose from 2/5 to 5/5).
2. **Proof-carrying post-conditions.** Post-conditions are not heuristics: they are derived so that a solver-checked implication ("post-conditions imply policy, for all prices in the band") holds, converting a claim about a simulated state into a claim about the executed transaction (Theorem 1). Existing post-execution checks such as a swap's `minOut` protect one asset of one swap and are not derived from a whole-wallet policy.
3. **An explicit guarantee boundary.** Table 1 separates what is *prevented* (value policy on tracked assets across the price band, payee receipts, allowance caps, ownership, under arbitrary drift) from what is merely *bounded* (in-policy loss, capped only by a per-session budget) and what is *uncovered* (untracked assets, off-chain signatures like permits).
4. **An open, reproducible testbed.** 260 scripted scenarios across 14 attack families (including five drift families and two adaptive ones) and 12 benign families, with harm ground truth measured from attacker balances rather than from the policy, per-family results, and all raw logs released.

## Main Findings

- **Aggregate prevention:** PGS prevented 131 of 140 harmful scenarios (93.6%, 95% CI 88–97%) and passed 117 of 120 benign ones (97.5%). Simulation-only checking prevented 57.9% and a static allowlist 71.4%.
- **Drift results:** None of the 50 drift scenarios produced attacker gain under PGS. In 40 the transaction reverted on-chain; in the other 10 (H13, the mempool-aware searcher) the transaction executed and the attacker found no profitable attack within the post-conditions. Simulation-only checking missed all 50, and the allowlist missed 40, stopping H7 only because that upgradeable pool happened not to be allowlisted.
- **The receipt check is load-bearing:** In family H14 the wallet's own balance change matched the simulation exactly (it sent the intended amount), but the payee received only 10–70% of it because the fee-on-transfer token's fee was raised before inclusion. Only the payee-receipt post-condition catches this. The ablation without receipt checks let all 10 variants through, with the attacker collecting 30–90% of each payment; the full system's ablation figures were 86.4% APR and $80k total attacker gain versus 93.6% and $42k.
- **What escapes prevention is bounded, not stopped:** All nine prevented-failure cases come from one adaptive family (H12), a slow drain of 20–30 swaps each losing about 1.8%, inside the per-transaction policy. The per-session budget capped attacker gain at $4.53k–$4.76k against a $5,000 budget, versus $5.7k–$10.8k unguarded.
- **Benign cost:** All three benign refusals were high-impact swaps (B12) of about $100k–$117k into the shallower pool whose realized cost (2.2–2.6%) was below the 3% relative bound but whose worst case over the oracle band exceeded it — genuine false positives from band conservatism.
- **Overhead:** Median batch cost 89.9k gas unguarded versus 131.0k under `executeChecked`, a median overhead of 41.1k gas (+46%, max 49.9k). Median guard decision latency was 163 ms (p95 275 ms, max 0.51 s over 499 checks) against a local Hardhat node; the solver was never the bottleneck.
- **LLM judge comparison:** On a 120-scenario subset, the judge (Anthropic Claude, `claude-opus-5-5`) prevented 58.3% of attacks with or without simulation, against 93.3% for PGS. The judge caught risk cues effects cannot show (it flagged every `minOut = 0` sandwich setup) but allowed every fake-bridge deposit and most fake-pool swaps, which are call-for-call identical to legitimate interactions.
- **Injected LLM wallet agents:** Across 20 episodes, both models ignored the spoofed invoice and the fake pool, but both proposed the fake-bridge deposit, which PGS and the allowlist refused. A Haiku agent attempted the airdrop-drainer and ownership-transfer injections but was blocked by the agent runtime's safety filter.
- **Audit changed the results:** An independent audit found an incorrect headline claim (not all simulation-only failures are due to drift), a payment-crediting flaw in the first draft, and the absence of any drift attack that adapts to the defense; the revision fixes the code and adds families H13 and H14 plus the session study.
- **Reproducibility:** A full rerun of 26 families × 10 variants × 5 defenses (1,300 runs) on a freshly started node matched harm labels, decisions, execution outcomes, and attacker gains in all 1,300 runs — determinism, not independent replication.

## Methodology in Plain English

The guard sits between the agent and the signing key, so the agent cannot sign on its own. For each proposed batch of calls it takes a snapshot of a local fork, executes the batch from the wallet, reads the effects (balance changes of tracked assets, residual allowances, contract owners, payments to allowlisted payees, and flows of unpriced tokens), then reverts the snapshot. A structural check rejects obvious violations first. Next, an SMT solver (Z3) is asked whether any price vector inside an oracle-uncertainty band could make the simulated outcome violate a declarative value-and-permission policy; an unsatisfiable answer means the policy holds everywhere in the band, and a satisfiable one yields a concrete counterexample that is reported back as the refusal reason.

The key step is compiling the proof into on-chain checks. The guard derives lower bounds on balance changes (outflows must be exact, inflows must reach at least 99% of the simulated amount given a 1% tolerance), plus payee-receipt amounts, allowance caps, and owner checks, and proves that *any* execution satisfying those bounds satisfies the policy. The wallet's `executeChecked` entry point runs the calls and all the checks in one atomic transaction, reverting with a reason if any fails. Because nothing can interleave, drift either leaves the policy satisfied or the transaction does not happen.

Evaluation uses a scripted world with USDC, WETH, DAI, and a fee-on-transfer token TAX owned by the attacker, five honest constant-product pools, a treasury vault, and adversarial contracts (fake pool, upgradeable pool, approval-sweeping airdrop, fake bridge, adaptive skim pool). A wallet holding about $1.85M is exposed to 14 attack families and 12 benign families, 10 seeded variants each, with harm judged from balances, never from the policy. Defenses compared are no defense, a static allowlist, simulation-plus-policy without post-conditions, the full system, an ablation without receipt checks, and LLM judges.

## Why This Matters

**Impact on research.** The paper reframes a familiar engineering pattern — "simulate before you sign" — as a proof with an unstated scope, and shows how to close the scope gap by compiling the proof's assumptions into on-chain enforcement. It also supplies an uncomfortable result for agent-oversight research: handing a clean simulation to an LLM reviewer can *increase* approval of a drift attack, because the simulation is accurate evidence about the wrong state.

**Real-world applications:**

- **Agentic wallets and treasury bots** that pay invoices or rebalance portfolios, where the agent reads attacker-influenceable content and the wallet can enforce balance, receipt, allowance, and ownership post-conditions atomically.
- **Wallet policy engines and simulation previews**, which currently check only the state at check time and, per this paper, are structurally exposed to front-running and mutable counterparties.
- **Intent-based and account-abstraction systems**, where a validation rule can admit only guarded execution and the signed constraints play a role analogous to the paper's post-conditions — except here they are written by an independent guard rather than the possibly misled agent.
- **Payment and settlement flows involving fee-on-transfer tokens or upgradeable venues**, where the sender's own balance can look correct while the recipient receives a fraction of the intended amount.

**Industry relevance.** The mechanism requires no protocol change — smart-contract accounts already permit in-wallet enforcement — and the measured overhead (41.1k gas, roughly $0.10 at 1 gwei and $3.08 at 30 gwei at $2,500/ETH) is modest in absolute terms and would shrink relative to typical DeFi transactions costing several hundred thousand gas. The paper's insistence on stating a guarantee boundary, rather than a headline rate, is directly usable by teams deciding what a wallet guard can and cannot promise.

## Future Directions

- **Measure real drift.** The authors name this the most valuable next step: quantifying how often real transactions change outcome between simulation and inclusion on mainnet, independently of any defense, since the testbed uses simplified constant-product pools, a static oracle, and scripted adversarial hooks with no real-exploit replay on a mainnet fork.
- **Gate off-chain signatures separately.** Permits and similar signed messages never reach the transaction path and are listed as uncovered; a complementary mechanism would be needed.
- **Handle untracked assets and legitimate value sinks.** NFTs and positions without a balance view are currently refused conservatively at a liveness cost for long-tail tokens, and real bridges take value with no immediate inflow, requiring an explicit authorized-outflow rule whose quality then determines fake-bridge detection.
- **Turn the tolerance into a studied security parameter.** The paper notes an informed searcher can extract up to roughly τ of the inflow, so τ, the price band β, the relative bound s, and the session budget W_max are risk decisions whose security–liveness trade-offs (visible in the session study, where 183/200 benign transactions passed with price restoration and only 155/200 without) deserve systematic tuning.

## Target Audience

Security researchers and protocol engineers working on agent-controlled wallets, wallet policy engines, and account abstraction; practitioners building or auditing AI agents with signing authority over funds; and formal-methods researchers interested in how solver-checked properties can be bound to a specific execution rather than a specific contract version. Readers evaluating LLM-as-reviewer designs for agent oversight will also find the simulation-increases-approval result directly relevant.

## Authors’ abstract

AI agents that control wallets read attacker-reachable content, so they can be steered into proposing harmful transactions. The usual last line of defense is a pre-signing check: a static allowlist, an LLM reviewer, or a transaction simulation. All three share a gap: the check describes the chain state at check time, but the transaction executes in a later state that an adversary can shape through front-running, contract upgrades or token-parameter changes. We call this…

[The full abstract on arXiv](https://arxiv.org/abs/2610.00354)

[Read the original paper](https://arxiv.org/abs/2610.00354)

---

Canonical: https://crypto.world/paper/proof-gated-signing-solver-checked-transaction-guards-that-hold-under-2610.00354
