The capacity to adapt behaviour in response to threats is essential for survival and requires both the integration of internal and external stimuli and the selection and execution of appropriate responses. Gehrlach et al. show that, in mice, the posterior insular cortex (pIC) has a central role in the detection and integration of aversive emotional and bodily states and regulates related motivated behaviours in a top-down manner through its projections to subcortical brain regions.