Sand production in oil wells is a significant challenge that negatively impacts productivity and compromise equipment integrity. This study explores the application of Optimized Support Vector Machine (SVM) binary classification algorithm to predict the onset of sand production in oil wells. A dataset from 63 oil wells was utilized, and class labels were determined based on the bulk and shear modulus product. The model development incorporated geological and mechanical parameters that could influence sand detachment such as: Young’s modulus, Poisson’s ratio, minimum and maximum horizontal stresses, overburden pressure, pore pressure, depth, fracture gradient, and formation strength. Instances above the threshold of 8E+11 were classified as indicative of no sand production, while those below were considered potential sand production scenarios. The SVM model demonstrated remarkable accuracy in predicting sand production onset, trained and tested rigorously with field data. The model's accuracy was evaluated using statistical parameters, such as: accuracy (ACC), sensitivity (SE), specificity (SP), and Matthew's Correlation Coefficient (MCC). From the results, the model achieved a score of 1 across all parameters, indicating high reliability and accuracy in sand production prediction. The practical implications of this model are significant, offering assistance to completion engineers in making proactive decisions regarding sand control strategies. Furthermore, the integration of this model into oil and gas industry processes can optimize operational efficiency by foreseeing potential sand production events, hence, preventing production impairment and ensuring loss prevention.