All-inorganic perovskite is a promising candidate for solar cell applications. However, a significant challenge lies in its poor phase stability to environmental moisture. To address this problem, we develop a strategy for in-situ reconstruction of the CsPbI3 surface using siloxane surfactants such as 3-aminopropyltriethoxysilane (APTES) and 3-aminopropyltrimethoxysilane (APTMS), which both demonstrate multifunctional roles in surface engineering. The siloxanes undergo air-induced hydrolysis, leading to the formation of Si-O-Si networks. Additionally, the –NH2 convert to –NH3+, enabling interaction with the I− ions on the surface of CsPbI3. This facilitates the formation of a self-assembled siloxane cross-linked ligand layer, which offers extra function for providing water and oxygen shielding, consequently stabilizing the surface of CsPbI3. Furthermore, the siloxane surfactants can passivate uncoordinated Pb2+ ions, resulting in a reduction of non-radiative recombination at the interface, thereby significantly augmenting device performance and stability. Following research comparisons, APTES with longer alkyl chains displays superior performance. As a result, with the APTES passivation, the PCE is increased from 19.01 % to 21.42 %, which is one of the highest PCE devices in pure CsPbI3 PSCs reported so far. Meanwhile, the devices treated with APTES show superior moisture stability over those without APTES, especially in the absence of encapsulation.