Environmental stability of perovskite solar cells (PSCs) has been improved by trial-and-error exploration of thin low-dimensional (LD) perovskite deposited on top of the perovskite absorber, called the capping layer. In this study, a machine-learning framework is presented to optimize this layer. We featurize 21 organic halide salts, apply them as capping layers onto methylammonium lead iodide (MAPbI3) films, age them under accelerated conditions, and determine features governing stability using supervised machine learning and Shapley values. We find that organic molecules’ low number of hydrogen-bonding donors and small topological polar surface area correlate with increased MAPbI3 film stability. The top performing organic halide, phenyltriethylammonium iodide (PTEAI), successfully extends the MAPbI3 stability lifetime by 4 ± 2 times over bare MAPbI3 and 1.3 ± 0.3 times over state-of-the-art octylammonium bromide (OABr). Through characterization, we find that this capping layer stabilizes the photoactive layer by changing the surface chemistry and suppressing methylammonium loss.