Individuals with hostile expectations (HEX) anticipate harm from seemingly neutral or ambiguous stimuli, and this can trigger antisocial behaviour. However, it is unclear how HEX are acquired, how the level of environmental threat affects the learning process, and to what extent HEX acquisition predicts real-world measures of antisocial thought, conduct, and personality. In an online sample of healthy young individuals (n=256, 70% women), we administered a virtual shooting task and employed computational modelling of behaviour to investigate HEX learning under high and low threat, respectively. We found that HEX acquisition was best explained by a two-level hierarchical Bayesian model of reinforcement learning, and that a threatening context facilitated HEX. The tendency to shoot under threat was correlated with hostile appraisals of angry faces in a separate task, which speaks for a general hostility bias across learning and perception. Crucially, we also examined whether computational measures of cognitive processes involved in HEX learning predicted real-world indices of antisocial tendencies. Structural equation modelling revealed that individuals with relatively higher self-reported aggressiveness and psychopathy developed more pronounced and uncertain hostile beliefs as well as stronger prediction errors in a high- but not in a low-threat context. Surprisingly, aggressive and psychopathic traits were further associated with more temporally stable hostility representations under high threat. Our study thus shows that HEX acquisition stems from an exaggerated coupling of ambiguous stimuli with hostile outcomes via reinforcement learning, and that aggressiveness and psychopathy are linked with strong yet imprecise hostile beliefs.