Water quality failure is a long-standing problem worldwide, causing illness, poisoning, disease outbreak, and claiming human lives in the urban communities. Potable water can be compromised due to a myriad of physical, operational, and environmental factors, such as contaminants intrusion into water pipelines, leaching, disinfection byproducts , chemical or microbial permeation , and pollution. The prediction of potable water quality has seldom been researched, while a novel automated model that offers a proactive approach can be developed to promote sustainability-based strategies. This paper elaborates the impacts of the aforementioned factors on the quality of potable water using the Artificial Neural Networks (ANNs) and risk analysis techniques . The ANN model was developed based on historical data obtained from the water distribution networks (WDNs) of the City of El Pedregal, Peru. The data were streamlined and fed to the neural network to be trained. Subsequent to multiple iterations via the scaled conjugate gradient algorithm, the optimized performance was generated and passed to the trained network to forecast the water quality failure in WDNs. The model performance was tested and validated against different statistical error terms and indicators. The mean absolute error and root-mean-squared error in the ANN failure prediction were computed as 0.08 and 0.15, whereas the average validity of the network was generated to be 92%. Based on the trained neural network, the degree of influence of each factor was determined through implementing a sensitivity analysis. It was found that water quality, water pressure, and operational and maintenance practices had the maximum influence on the risk of failure in water infrastructure. Policy makers and managers can benefit from the proposed model since ANN is already trained, by predicting water quality whenever new data become available. Prediction results will indicate the level of risk (low, moderate, high) to the inhabitants, thereby preemptive measures can be taken to avoid any illness or disease outbreak. • Prediction of water quality via artificial neural network and risk analysis model. • The model assessed water contamination and pipe sustainability with 92% average validity. • Sensitivity analysis assessed the influence of model’s factors on the risk of failure. • Water quality and its related environmental factors had the highest influence rate. • Pipe diameter, and pipe thickness had the least influence rates.