The reliance on non-renewable energy sources poses significant risks to energy security, including geopolitical tensions, supply disruptions, and environmental concerns. To address these challenges, many countries have recognized the potential of renewable energy to enhance energy security. This paper examines the impact of renewable energy consumption on energy security risk, incorporating the mediating roles of the effect of economic policy uncertainty, globalization, economic performance, and natural resources from 1990 to 2023. Econometric methodologies are used for empirical analysis, including cross-section dependence, slope heterogeneity, panel unit root test, LM bootstrap cointegration, and CS-ARDL models. The results explain that renewable energy consumption decreases energy security risk. Economic growth decreases energy security risk in the long run while increasing it in the short run. Economic policy uncertainty increases the energy security index in the short and long run. The government should encourage using renewable energy resources by providing incentives and adopting policies involving direct financial assistance, such as grants, or indirect financial support, such as tax incentives. Enhancing Energy Security by encouraging troubled industries to develop renewable energy sources can improve the overall energy security index, and possible risks associated with energy sources can be reduced.