Interface modification of perovskite solar cells (PSCs) has been widely explored not only to achieve defect passivation but also to facilitate charge transport and stabilize the physical/electrical contact at device interfaces. In this study, [2-(9H-carbazol-9-yl)ethyl]phosphonic acid (CEPA) is introduced as an interface modifier at the interface of perovskite and the hole transporting material (HTM) layer into n-i-p PSCs. CEPA reduces surface traps, manipulates the surface dipole for energy-level alignment, and induces molecular interaction at the interface of the CEPA-HTM for enhanced interfacial adhesion energy and good mechanical stability. The power conversion efficiency of interface-optimized PSC is 23.6% using a 2D/3D perovskite structure, representing the highest efficiency among poly(triarylamine) HTM-based devices. The encapsulated CEPA-treated PSCs maintain nearly 90% of their initial efficiency during a damp heat lasting for more than 1530 h and retain their initial efficiency during continuous operation under illumination.