Theory predicts that natural selection will erode additive genetic variation in fitness-related traits. However, numerous studies have found considerable heritable variation in traits related to immune function, which should be closely linked to fitness. This could be due to trade-offs maintaining variation in these traits. We used the Egyptian cotton leafworm, Spodoptera littoralis, as a model system to examine the quantitative genetics of insect immune function. We estimated the heritabilities of several different measures of innate immunity and the genetic correlations between these immune traits and a number of life history traits. Our results provide the first evidence for a potential genetic trade-off within the insect immune system, with antibacterial activity (lysozyme-like) exhibiting a significant negative genetic correlation with haemocyte density, which itself is positively genetically correlated with both haemolymph phenoloxidase activity and cuticular melanization. We speculate on a potential trade-off between defence against parasites and predators, mediated by larval colour, and its role in maintaining genetic variation in traits under natural selection.