A pre-execution gate for AI agents is a single barrier that runs before an agent's action executes and refuses to let it run if it's over budget, sending a bad transaction, or built on a previous step that only claimed success. This post wires three such checks (a spend gate, a transaction canary, and a verify-before-trust gate) into one decorator, @preflight(...), and shows the real run log where it blocks two of three actions. It is keyless, read-only, moves zero funds, and runs on a fresh machine with nothing installed but the Python standard library.

In short: a pre-execution gate for AI agents is a check that runs before the action and blocks it when the action is over budget, sends a bad transaction, or builds on a step that only claimed success. It is AI agent spend control at the decision point, not a dashboard reporting money already gone.

AI disclosure: I wrote preflight.py and drafted this with AI assistance. Every number is from a real run of the code (pasted verbatim) or a linked, dated source. I ran the tool myself before publishing.

On May 4, 2026, an X account wired up to Grok and Bankr got talked out of roughly $175,000 by a tweet. The instruction wasn't even plain text — it was Morse code in a reply, which the model decoded and passed along to the wallet bot, moving about 3 billion DRB tokens to an attacker (SlowMist's writeup calls it a permission-chain attack; ~80% was later clawed back). Two weeks later, on May 20, the same wallet service paused all swaps after an attacker reached 14 wallets, with about $440,000 traced to attacker addresses (Cointelegraph).