Metal halides have been demonstrated to be 1 promising candidates for X-ray detectors. However, its large 2 leakage current caused by the severe ion migration and 3 intrinsic defect substantially degrades device performance. 8 (0.80 eV) and conductivity mutation at the interface ensure 9 stable baseline and suppress leakage current; 2) CsPbI 3 10 ensures effective absorption of X-ray, while BA 2 CsPb 2 I 7 11 induces larger bulk resistance, which is expected to achieve 12 higher photocurrent and lower dark current. Finally, the 13 obtained X-ray detector exhibits negligible baseline drift, 14 faster response, and smaller leakage current compared to 15 the CsPbI 3 counterparts. Specifically, the device exhibits 16 a detection limit of 0.092 μGy air /s, and the CsPbI 3 -based 17 device was 2.63 μGy air /s.