© 2017. Published by The Company of Biologists Ltd |. Communities of symbiotic microorganisms that colonize the gastrointestinal tract play an important role in food digestion and protection against opportunistic microbes. Diet diversity increases the number of symbionts in the intestines, a benefit that is considered to imposenocost forthe host organism. However, lessisknown about the possible immunological investmentsthat hosts have to make inorder to control the infections caused by symbiont populations that increase because of diet diversity. Using taxonomical composition analysis of the 16S rRNAV3 region, we show that enterococci are the dominating group of bacteria in the midgut of the larvae of the greater wax moth (Galleria mellonella). We found that the number of colony-forming units of enterococci and expressions of certain immunity-related antimicrobial peptide (AMP) genes such as Gallerimycin, Gloverin, 6-tox, Cecropin-D and Galiomicin increased in response to a more diverse diet, whichin turn decreased the encapsulation response ofthe larvae. Treatment with antibiotics significantly lowered the expression of all AMP genes. Diet and antibiotic treatment interaction did not affect the expression of Gloverin and Galiomicin AMP genes, but significantly influenced the expression of Gallerimycin, 6-tox and Cecropin-D. Taken together, our results suggest that diet diversity influences microbiome diversity and AMP gene expression, ultimately affecting an organism’s capacity to mount an immune response. Elevated basal levels of immunity-related genes (Gloverin and Galiomicin) might act as a prophylactic against opportunistic infections and as a mechanism that controls the gut symbionts. This would indicate that a diverse diet imposes higher immunity costs on organisms.