Set shifting involves the capacity to effectively and efficiently direct mental resources in the service of dynamically changing goal representations. This capacity is important in everyday life and may be vital in situations where processing resources needed for adaptive action may be diverted by cues for external danger or threat (e.g., first responding, military combat, trauma surgery). Although considerable research has investigated performance in set-shifting tasks, little work exists on how the presence of external threats may affect the capacity to flexibly deploy cognitive resources. Even less is known about individual difference factors that might moderate such effects. The current study addressed these gaps in the literature through use of a novel task-switching procedure in which participants (N = 77) performed two tasks in alternation under shock-threat and no-shock ("safe") conditions. Results indicated that behavioral performance was impacted by the presence of threat. However, these effects were moderated by individual differences in threat reactivity as indexed by both self-report and physiological measures. Our findings serve to clarify the impact of explicit threat on set-shifting performance. In addition, they encourage further use of the threat/task-switching paradigm as a laboratory model for studying individual differences in performance under conditions of pressure or peril. Public Significance Statement The current study examined factors related to cognitive performance in the context of an external threat, in this case threat of electric shock. Analyses revealed evidence for effects of threat on performance of a task calling for flexible shifting of cognitive set. We also found that individuals who reported more fearless personality traits were more resilient to the effects of threat on cognitive performance. These findings have implications for identifying individuals who may be particularly well-suited to tasks requiring cognitive control under stressful conditions (e.g., first responding, military operations).