Animal and human social networks are shaped by multiple selection pressures, including the need to ensure efficient group functioning and communication while simultaneously limiting the spread of infectious diseases. It has been hypothesised that social animals could further reduce epidemic risk in the presence of pathogens by altering the transmission properties of their social networks, yet there is little evidence for such pathogen-triggered network changes. Nathalie and colleagues tested this hypothesis experimentally in colonies of the ant Lasius niger using a combination of automated behavioural tracking, controlled exposure to an infectious pathogen, precise quantification of individual pathogen load, and temporally-explicit transmission simulations. They first describe important constitutive properties of the ant social network that simultaneously inhibit overall transmission and isolate valuable individuals (queen, brood and young workers) from disease sources. They then show that the ants adaptively respond to the presence of an infectious pathogen by reinforcing key disease-inhibitory properties of their social network, conferring additional disease defence to the colony. Finally, they show that these network changes result from early behavioural changes in both pathogen-exposed workers and their untreated nestmates, increasing the spatial and social segregation between individuals. The results indicate that the alteration of social organisation in response to pathogen entry is an effective strategy to mitigate the effects of disease in social groups.