Grain boundaries (GBs) are the most prominent microstructural features that play significant roles in determining the physical properties and photovoltaic functions of halide perovskite (HP) thin films. While enormous effort has been devoted to modifying the HP GBs and making them benign, the microstructures in these modified/functionalized HP thin films have been somehow random and/or uncertain. Herein, we demonstrate several unique chemical approaches to functionalize the HP GBs in a continuous, precisely-controlled manner. The key to the unprecedent success of the confocal functionalization is the strong molecular interaction between HPs grains and functionalizing agents. Microscopic characterization methods including analytical transmission electron microcopy have been employed to confirm the microstructures in our HP thin films. Combined experimental and theoretical studies have showed that the confocal functionalization of HP GBs not only leads to electronic passivation of defects, but also prevents HP grains from moisture/oxygen ingression and unfavorable phase transformation. As a result, highly efficient and stable perovskite solar cells are demonstrated. The concept of continously functionalization of the HP GBs is paving the way for developing higher-performance perovskite solar cells of the future.