Food safety risk control and comprehensive assessment are crucial measures to ensure food safety. However, existing food safety risk assessment methods face challenges, such as unreasonable weight distribution of hazard factors and poor adaptability. Therefore, a safety risk assessment model based on conditionally constrained game theory and adaptive ensemble learning is proposed in this paper. Firstly, new constraints are established on the traditional game theory combination weighting method and solved using the augmented Lagrange multiplier method to obtain the optimal linear combination coefficients and actual composite risk values of the samples, which are taken together with the hazard factor detection data as inputs to the adaptive ensemble learning model. Then, an adaptive ensemble learning model is constructed, which prefers the base learner based on the combined measure of stability and accuracy, and predicts the composite risk value by using robust weighted random forest as the meta-learner. Finally, the model's validity was verified using wheat flour and rice hazard factor detection data. The experimental results indicate that the model's fit on the two datasets is 0.996 and 0.991, respectively, demonstrating strong generalization ability and high prediction accuracy. Meanwhile, unqualified products in wheat flour and rice can be effectively identified through risk thresholds, which helps to provide early warning of potential safety risks.