Social organisms face a high risk of epidemics, and respond to this threat by combining efficient individual and collective defences against pathogens. An intriguing and little studied feature of social animals is that individual pathogen resistance may depend not only on genetic or maternal factors, but also on the social environment during development. Here, we used a cross-fostering experiment to investigate whether the pathogen resistance of individual ant workers was shaped by their own colony of origin or by the colony of origin of their carers. The origin of care-giving workers significantly influenced the ability of newly eclosed cross-fostered Formica selysi workers to resist the fungal entomopathogen Beauveria bassiana. In particular, carers that were more resistant to the fungal entomopathogen reared more resistant workers. This effect occurred in the absence of post-infection social interactions, such as trophallaxis and allogrooming. The colony of origin of eggs significantly influenced the survival of the resulting individuals in both control and pathogen treatments. There was no significant effect of the social organization (i.e. whether colonies contain a single or multiple queens) of the colony of origin of either carers or eggs. Our experiment reveals that social interactions during development play a central role in moulding the resistance of emerging workers.