© 2017 The Netherlands Entomological Society Predator-prey interactions are an important evolutionary force affecting the immunity of the prey. Parasitoids and mites pierce the cuticle of their prey, which respond by activating their immune system against predatory attacks. Immunity is a costly function for the organism, as it often competes with other life-history traits for limited nutrients. We tested whether the expression of antimicrobial peptides (AMP) of the larvae of the greater wax moth Galleria mellonella (L.) (Lepidoptera: Pyralidae) changes as a consequence of insertion of a nylon monofilament, which acts like a synthetic parasite. The treatment was done for larvae grown on a high-quality vs. a low-quality diet. The expression of Gloverin and 6-tox were upregulated in response to the insertion of the nylon monofilament. The expression of 6-tox, Cecropin-D, and Gallerimycin were significantly higher in the ‘low-quality diet’ group than in the ‘high-quality diet’ group. As food quality seems to affect AMP gene expression in G. mellonella larvae, it should always be controlled for in studies on bacterial and fungal infections in G. mellonella.