Recognition of relatives is considered a key factor in the evolution of sociality as it ensures that the benefits of altruism flow to those who share the altruist's genes. However, theory predicts that genetically based recognition systems will not persist if the only selection maintaining them derives from the recognition system itself. Kin-recognition systems, therefore, are hypothesized to involve genetic variation maintained by other functions. Polyembryonic wasps are parasites of moth larvae that clonally produce large numbers of offspring and two morphologically distinct castes. Some embryos develop into reproductive larvae that mature into adult wasps, whereas others develop into soldier larvae whose function is defence. Soldiers from Copidosoma floridanum distinguish relatives from non-relatives on the basis of relatedness. Here, we report that the recognition cues used by soldiers derive from the extraembryonic membrane, which also protects these parasites from the host's immune response. This suggests that the kin-recognition system used by C. floridanum may be maintained in part by selection for resistance against the host.