Proof-Gated Signing: Solver-Checked Transaction Guards that Hold Under State Drift for Onchain AI Agents
Organizations: Independent Researcher
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 state drift. We present Proof-Gated Signing (PGS), which simulates a proposed transaction, extracts its effects, and uses an SMT solver to check a declarative value-and-permission policy for every price in an oracle-uncertainty band. It then compiles on-chain post-conditions (wallet balance bounds, payee receipts, allowance caps and ownership) and proves that every execution satisfying them also satisfies the policy. The agent's smart-contract wallet enforces them atomically, so the guarantee applies to the executed transaction under arbitrary drift. On an open testbed of 260 scenarios (14 attack families including five drift and two adaptive families, and 12 benign families), with harm measured from attacker balances rather than from any policy, PGS prevented 93.6% of the 140 harmful scenarios and passed 97.5% of the benign ones. Simulation-only checking prevented 57.9% and a static allowlist 71.4%. None of the 50 drift scenarios produced attacker gain under PGS. The only unprevented family, an in-policy drain, was bounded by the per-session budget. We also find that giving an LLM reviewer a clean pre-drift simulation made it more likely to approve a drift attack. Overhead is about 41k gas and 0.1-0.2 s per check.
Figures & tables
| Guaranteed (for executed transactions) | Why |
|---|---|
| Value policy on tracked assets, for all prices in the band | Solver-proved implication plus on-chain balance bounds |
| Credited payees receive at least the credited amount | On-chain receipt checks |
| Checked allowances do not exceed their simulated values | On-chain allowance caps |
| Owned contracts keep their owner | On-chain owner checks |
| All of the above under arbitrary state drift | Checks are atomic with the batch |
| Bounded, not prevented |
| ID | Kind | Description |
| H1 | intent | Invoice paid to the attacker instead of the payee |
| H2 | intent | Payment to a look-alike (address-poisoning) address |
| H3 | intent | “Airdrop claim”: unlimited approval + claim that sweeps it |
| H4 | intent | Latent unlimited approval, swept after the episode |
| H5 | intent | Swap on a fake pool with honest-looking quotes |
| H6 | drift | Sandwich of a swap without slippage protection (profit-maximizing searcher) |
| Defense | APR [95% CI] | BPR [95% CI] | Stopped on-chain | Gain |
|---|---|---|---|---|
| None | 0.000 [.000, .027] | 1.000 [.969, 1.00] | – | $12.18M |
| Static allowlist | 0.714 [.635, .783] | 0.833 [.757, .889] | – | $558k |
| PGS -sim | 0.579 [.496, .657] | 0.975 [.929, .991] | – | $855k |
| PGS w/o receipts | 0.864 [.798, .911] | 0.975 [.929, .991] | 30 | $80k |
| PGS | 0.936 [.882, .966] | 0.975 [.929, .991] | 40 | $42k |
| Family | Refused | Reverted | Executed, | Mechanism |
|---|---|---|---|---|
| pre-sign | on-chain | harmed | ||
| H1, H2, H10 | 30 | 0 | 0 | S1: value to a non-allowlisted EOA |
| H3, H4 | 20 | 0 | 0 | S2: residual allowance to an untrusted spender |
| H5, H11 | 20 | 0 | 0 | Value policy: loss |
| H9 | 10 | 0 | 0 | S3: ownership change |
| H6, H7, H8 | 0 | 30 | 0 | Balance post-condition fails after drift |
| Family | AL | J | J+S | S | P |
| H1 direct transfer | 5 | 3 | 3 | 5 | 5 |
| H2 poisoned address | 5 | 3 | 3 | 5 | 5 |
| H5 fake pool | 5 | 1 | 5 | 5 | 5 |
| H6 sandwich (drift) | 0 | 5 | 4 | 0 | 5 |
| H7 proxy upgrade (drift) | 5 | 3 | 0 | 0 | 5 |
| H8 fee rug (drift) | 0 | 0 | 0 | 0 | 5 |
AI Agent Security
Artificial intelligence agent security studies attacks and safeguards for tool-using, persistent, and collaborative systems across digital and physical settings.
See all 510 papers