Perovskite solar cells (PSCs) incorporating 2,2 ',7,7 '-tetrakis(N, N-di-p-methoxyphenylamine)-9,9 '-spirobi-fluorene (spiro-OMeTAD) still face critical stability challenges, causing by the environment-dependent oxidation and the unsatisfactory oxidizing additives decaying perovskite films. Here, the Co(III)-grafted ultrathin graphitic carbon nitride (Co(III)-CN) nanosheets with few atom layers are prepared through a bottom-up strategy, which possess the Co(III)-CN/Co(II)-CN redox couple for controllably oxidizing spiro-OMeTAD and selectively reducing the released I2 from perovskite to generate I-, thereby enhancing the conductivity and hole mobility of HTL and passivating defects at the interface with perovskite. Moreover, the Co(III)-CN with a large specific surface area and abundant nitrogen sites could inhibit the migration of Li+ ions and the volatilization of 4-tert-butylpyridine (tBP), maintaining the regular morphology of the hole transport layer (HTL) film under humid and thermal conditions. Consequently, the improvement in the hole extraction and reduction in interfacial recombination enable the power conversion efficiency (PCE) of the doped device reaching to 23.01 %, exceeding 21.21 % for the pristine device. Specifically, the optimized PSCs maintain 88 % and 80 % of initial PCE after exposure to the ambient environment for 1200 h and 85 degrees C for 720 h. This work exhibits controllable oxidation and interface passivation by ultrathin Co(III)-grafted CN nanosheets for high-performance PSCs.