The banking industry is a high-risk industry. With the continuous expansion of business areas and business scale, bank credit risk has become the most important risk. In this paper, a credit risk assessment model based on random forest (RF) algorithm is proposed, and the initial RF is optimized by parameter optimization, which further improves the recognition accuracy of the model. The experimental results show that, after many iterations, the accuracy of this method is obviously better than that of traditional support vector machine (SVM) algorithm, with an accuracy of 95.73%, 19.24% higher than that of SVM algorithm, and an error reduction of 30.26%. It can be seen that the credit risk assessment model based on RF algorithm is effective in identifying high-risk customers of bank credit, and it can provide some theoretical support for identifying high-risk customers of bank credit. Constructing the credit risk identification system of commercial banks with the help of modern intelligent algorithms can change the situation of superficial credit risk judgment and lagging risk response under the traditional management mode, improve the technical content and accuracy of risk analysis, and is of great significance for promoting commercial banks to improve their risk management level and realizing the stability and development of the financial industry.