Surface and grain boundary defects in halide perovskite solar cells are highly detrimental,reducing effi-ciencies and stabilities.Widespread halide anion and organic cation defects usually aggravate ion diffu-sion and material degradation on the surfaces and at the grain boundaries of perovskite films.In this study,we employ an in-situ green method utilizing nontoxic cetyltrimethylammonium chloride(CTAC)and isopropanol(IPA)as anti-solvents to effectively passivate both surface and grain boundary defects in hybrid perovskites.Anion vacancies can be readily passivated by the chloride group due to its high electronegativity,and cation defects can be synchronously passivated by the more stable cetyltrimethy-lammonium group.The results show that the charge trap density was significantly reduced,while the carrier recombination lifetime was markedly extended.As a result,the power conversion efficiency of the cell can reach 23.4%with this in-situ green method.In addition,the device retains 85%of its original power conversion efficiency after 600 h of operation under illumination,showing that the stability of per-ovskite solar cells is improved with this in-situ passivation strategy.This work may provide a green and effective route to improve both the stability and efficiency of perovskite solar cells.