The loss of situational awareness by pilots is one of the harshest risk factors leading to catastrophic accidents. In this paper a situational awareness analysis model based on multiple agents is presented to simulate the human-computer interaction process in the aircraft cockpit. From the perspective of human-in-loop, the integrated model consists of modularized pilot agent model, technical system agent model and environment agent model. Following the structured levels of situational awareness, the pilot's cognitive behaviors are modelled based on Adaptive Control of Thought-Rational (ACT-R) theory and Bayesian network, with the triggering inputs from the visual and auditory sensory channels. Considering the effects of overlapping information from different channels, the formation and evolution mechanism of the pilot's situational awareness is analyzed in a probabilistic inference manner. The tests of input-output characteristics prove that the model can well reflect the distribution and resist the uncertain fluctuation of different cognitive elements. The safety issues based on two simplified real risk scenarios, under the background of the incidents/accidents related with Boeing 737-8 (MAX), were analyzed. The mechanism of accident evolution along with the possible preventive measures were discussed. It is concluded that an early control priority transmission from the technical system to the pilots and the display of direct prompt messages could make a difference in avoiding the serious risk.