In the current era, many of the military threats that state leaders face come from domestic and transnational nonstate actors. Military alliances are recognized as an important policy strategy to counter military threats, but existing research has primarily been focused on threats from other states and has difficulty uncovering a consistent relationship between external threat and alliance formation. We argue that this discrepancy arises from the failure to recognize that many threats are not external to the state. We contend that alliance formation is motivated both by external threats from other states and by internal threats that make civil conflict more likely. Moreover, we argue that leaders design alliance obligations differently when faced with internal threats. An empirical analysis of alliance formation from 1946 to 2009 shows that while external threats motivate the formation of defense pacts, internal threats encourage the formation of consultation pacts. Internal threats with the greatest potential for internationalization also encourage the formation of neutrality/nonaggression pacts. This research deepens our understanding of how states design security policies to deal with the threats posed by nonstate actors, a salient concern of leaders in the twenty-first century, and helps us to understand the variety of alliance obligations that we observe.