If you’ve swapped tokens or signed a transaction recently, you’re probably familiar with MetaMask’s transaction preview—the interface that tells you what you’re sending, receiving, or approving before you click confirm.
It is easy to assume this preview shows exactly what will happen on-chain (I used to think the same). In reality, the preview is only an off-chain simulation of what the transaction is expected to do. That gap creates an exploit vector known as a Red Pill attack.
What is a Red Pill Attack?
Smart contracts can inspect their environment during execution. A malicious contract can detect when it is being simulated by a wallet rather than executing live on-chain.
Here is how an attacker abuses that mechanism:
- The Trap: You connect to a malicious dApp that prompts you to sign a transaction.
- The Simulation (Fake Behavior): When MetaMask runs the simulation off-chain, the malicious contract detects the simulation environment. It acts completely fine, generating a clean preview like “You will receive 100 USDC.”
- The Switch (Real Execution): Feeling safe, you hit approve. But once the transaction hits the live blockchain, the contract realizes it’s no longer inside a sandbox. It shifts code paths and executes an entirely different set of instructions—such as draining your wallet balance or stealthily granting unlimited token approvals.
Until now, wallets had no way to enforce that a live transaction strictly matched its preview.
MetaMask’s “Added Protection”
MetaMask’s new Added Protection security feature changes the rules. Powered by EIP-7702 smart account capabilities, it transforms the preview from passive informational feedback into an enforceable, on-chain condition.
How the workflow operates:
- Simulate & Measure: MetaMask simulates the transaction off-chain to measure expected state changes (e.g., balance changes, token approvals, incoming assets).
- State Binding: The expected outcome is locked into the transaction parameters as an execution constraint.
- Live Execution & Check: When the transaction executes on-chain, your account verifies that the state changes match the constraint during the execution step itself.
- Automatic Revert: If the contract attempts to alter its logic or produce an outcome different from the preview, the transaction immediately reverts.
If a malicious contract attempts a Red Pill bait-and-switch, the exploit fails on-chain. Your assets never leave your wallet—though, as with any reverted transaction, you still pay the standard network gas fee for the failed execution attempt.
Note: Added Protection is enabled by default starting in Extension v13.45 across 13 EVM networks. While it aims to prevent Red Pill attacks, it isn’t foolproof for every Web3 risk. Verifying dApp URLs, reviewing token allowances, and checking contract addresses remain essential habits.
Check out MetaMask’s official release notes on “Added Protection” for more details (MetaMask’s new Added Protection security feature stops red pill attacks).
Has anyone here ever fallen victim to or spotted a transaction where the simulation preview didn’t match the actual on-chain result?

