Ag electrode is widely used in inverted perovskite solar cells (PSCs), but its easy reaction and corrosive nature with perovskite always induces severe stability issue. Here, from typical theory of metal anticorrosion, a chemical anticorrosion approach for Ag electrode in inverted PSCs through introducing 2-mercaptobenzothiazole (MBT) as a corrosion inhibitor is reported. MBT can strongly bond to Ag and form a compact [MBT-Ag] chain on Ag surface owing to its N atom in thiazolyl ring and exocyclic thiol groups. As a result, Ag anticorrosion ability is greatly enhanced by increasing the corrosion potential and decreasing the corrosion current, thus effectively inhibiting possible chemical reaction and corrosion between perovskite and Ag electrodes. PSCs containing MBT/Ag exhibit high efficiency of over 23% with good stability, retaining 95 ± 4.1% of initial efficiency after storage for 3800 h in glovebox. Importantly, resulting PSCs also show excellent thermal stability, maintaining 90 ± 1.8% of initial efficiency after aging for 900 h at 85 °C.