Attributing intentions to others’ actions is important for learning to avoid their potentially harmful consequences. Here, we used functional magnetic resonance imaging multivariate pattern analysis to investigate how the brain integrates information about others’ intentions with the aversive outcome of their actions. In an interactive aversive learning task, participants (n =33) were scanned while watching two alleged coparticipants (confederates)—one making choices intentionally and the other unintentionally—leading to aversive (a mild shock) or safe (no shock) outcomes to the participant. We assessed the trial-by-trial changes in participants’ neural activation patterns related to observing the coparticipants and experiencing the outcome of their choices. Participants reported a higher number of shocks, more discomfort, and more anger to shocks given by the intentional player. Intentionality enhanced responses to aversive actions in the insula, anterior cingulate cortex, inferior frontal gyrus, dorsal medial prefrontal cortex, and the anterior superior temporal sulcus. Our findings indicate that neural pattern similarities index the integration of social and threat information across the cortex.