Insect societies face many social parasites that exploit their altruistic behaviours or their resources. Due to the fitness costs these social parasites incur, hosts have evolved various behavioural, chemical, architectural and morphological defence traits. Similar to bacteria infecting multicellular hosts, social parasites have to successfully go through several steps to exploit their hosts. Here, we review how social insects try to interrupt this sequence of events. They can avoid parasite contact by choosing to nest in parasite-free locales or evade attacks by adapting their colony structure. Once social parasites attack, hosts attempt to detect them, which can be facilitated by adjustments in colony odour. If social parasites enter the nest, hosts can either aggressively defend their colony or take their young and flee. Nest structures are often shaped to prevent social parasite invasion or to safeguard host resources. Finally, if social parasites successfully establish themselves in host nests, hosts can rebel by killing the parasite brood or by reproducing in the parasites' presence. Hosts of social parasites can therefore develop multiple traits, leading to the evolution of complex defence portfolios of co-dependent traits. Social parasites can respond to these multi-level defences with counter-adaptations, potentially leading to geographical mosaics of coevolution.This article is part of the Theo Murphy meeting issue 'Evolution of pathogen and parasite avoidance behaviours'.