In China, the excessive application and improper disposal of chemical inputs have posed a great threat to the agricultural ecological environment and human health. The key to solve this problem is to promote the sustainable behaviors of farmers’ agricultural green production (AGP). Based on the micro-survey data of 652 farmers, this study adopts the binary probit model to investigate the impacts of risk perception and environmental regulation on the sustainable behaviors of farmers’ AGP. Results show that both risk perception and environmental regulation have significant effects on farmers’ willingness to engage in sustainable behaviors. Moreover, environmental regulation can positively adjust risk perception to improve farmers’ willingness to engage in sustainable behaviors. In terms of the two-dimensional variables, economic risks create the greatest negative impacts, and their marginal effect is 7.3%, while voluntary regulation creates the strongest positive impacts, and its marginal effect is 14.1%. However, both constrained and voluntary regulation have an enhanced moderating effect, where the effects of voluntary regulation are more remarkable. This is mainly because the environmental regulation policy signed by the government and farmers through the letter of commitment can inspire farmers to continue to implement green agricultural production from the deep heart. Therefore, government policies should constantly reduce farmers’ risk perception in terms of economic input, and adopt restrictive behaviors measures, such as regulatory punishment and voluntary contract, to promote their sustainable behaviors of AGP to the maximum extent.