Polyoxometalates (POMs) can enable energy level tuning to match perovskite layers. They are considered electronic bridges to modify perovskite and improve the performance of photovoltaic devices. Therefore, in the present work, we dispersed the vacancy POMs K 8 [α-SiW 11 O 39 ]•H 2 O ({SiW 11 }) in the metal-organic frameworks (MOFs) to modify the perovskite layer. {SiW 11 } could adjust the energy level between the layers of the perovskite photodetector. Moreover, the hydrogen bonds formed between SiW 11 @ZIF-8 and perovskite effectively passivated the grain boundaries (GBs) of the perovskite layer. Xray diffraction spectroscopy (XRD) showed that the crystallinity of perovskite was significantly improved. In addition, scanning electron microscopy (SEM) images demonstrated that the average size of perovskite grains increased from 254.50 to 719.27 nm, proving the effective passivation of the GBs. Furthermore, a series of tests such as infrared spectroscopy (IR), N 2 adsorption/desorption isotherms, transmission electron microscopy (TEM), and X-ray photoelectron spectroscopy (XPS) also proved that {SiW 11 } could be successfully loaded into the pores of ZIF-8 through electrostatic interactions. The photocurrent of the SiW 11 @ZIF-8 doped device reached 41.95 μA, about three times as high as that of the blank device (14.41 μA). Also, under unencapsulated conditions, it could still maintain more than 90% stability for nearly 700 h.