Due to factors such as the availability of assembly equipment, technology, and site management level, prefabricated building construction safety accidents often occur. To ensure the safety of prefabricated buildings and effectively reduce the accident rate, the concept of resilience is introduced into the safety management of prefabricated buildings. Based on the resilience absorption capacity, adaptation capacity, recovery capacity, and optimization capacity, a comprehensive evaluation index system for the safety resilience of prefabricated buildings is established. By combining prior knowledge with structural learning and parameter learning, a dynamic Bayesian network (DBN) model is constructed to dynamically evaluate the safety resilience of prefabricated buildings. Through forward causal reasoning and backward diagnostic reasoning, the dynamic safety resilience value of prefabricated buildings and the chain of maximum failure causes are obtained. Finally, by conducting a sensitivity analysis on the target nodes, the key influencing factors of the safety resilience of prefabricated construction are identified, and improvement suggestions for enhancing resilience are proposed. The results indicate that establishing a resilience safety culture, preventing unsafe behaviors of personnel, safety management, and supervision on the construction site, emergency management actions, and building a risk management information system are crucial factors influencing the safety resilience of prefabricated buildings. The enhancement of absorption capacity has the greatest impact on the safety resilience of prefabricated buildings.