The water ecological security pattern is a core factor. A scientific, accurate, and practical evaluation of water ecological security provides a theoretical basis for regional water ecological management. Using water resource data from five cities in the Hexi Corridor of Gansu Province (Jiuquan (JQ), Jiayuguan (JYG), Zhangye (ZY), Jinchang (JC), and Wuwei (WW)) from 2006 to 2021, a water ecological security evaluation index system based on the PSR (pressure-state-response) framework was constructed, covering 27 factors related to water resources, socio-economics, and the ecological environment. The main obstacle factors of water ecological security were identified using the obstacle degree model, and the grey GM(1,1) model was employed to predict water ecological security. Results indicated that the comprehensive assessment index of water ecology in the Hexi Corridor increased from 2006 to 2021, showing a transition from relatively unsafe (0.319) to basic safety and then to relatively safe (0.672). The pressure and response systems were the main limiting factors affecting water ecological security in the Hexi Corridor. After a slight decline in 2008, the overall spatial distribution continued to rise, with WW City and ZY City leading since 2016. ZY had a higher safety grade proportion (25%) compared to other areas in the Hexi region. The pressure system was the most significant obstacle to water ecological security after 2006. Prediction results indicated that the comprehensive evaluation index of water ecological security would continue to rise annually from 2022 to 2031, reaching a very safe level by 2025. The evaluation results provide a scientific basis for ecological security and risk decision-making in the study area.