One-fifth of the world’s population lives in countries affected by fragility, violence and conflict, impeding long-term economic growth. However, little is known about how firms respond to local changes in security, partly because of the difficulty of measuring firm activity in these settings. This paper presents a novel methodology for observing private sector activity using mobile phone metadata. Using Afghanistan as the empirical setting, the analysis combines mobile phone data from over 2,300 firms with data from several other sources to develop and validate measures of firm location, size, and economic activity. Combining these new measures of firm activity with geocoded data on violent events, the paper investigates how the private sector in Afghanistan responds to insecurity. The findings indicate that firms reduce presence in districts following major increases in violence, that these effects persist for up to six months, and that larger firms are more responsive to violence. The paper concludes with a discussion of potential mechanisms, firms’ strategic adaptations, and implications for policymakers.