show Abstracthide AbstractSpecialist herbivorous insects are more commonly observed in nature than are generalists. However, despite the abundance of host plant specialists, specialization may come with drawbacks, as host range and thereby food availability are constrained. We are interested in the causes and consequences of host plant specialization in the heliothine moth Heliothis subflexa, which feeds exclusively on plants in the genus Physalis. This requires the ability to tolerate withanolides, secondary metabolites of Physalis species that have antifeeding and immune-inhibiting effects. We found that H. subflexa does not display any negative effects from withanolide exposure, either on larval performance or the immune system. Instead, withanolides stimulate the immune responses of H. subflexa, while suppressing them in the closely related hostplant generalist, H. virescens. Withanolides also have antibacterial and growth-inhibiting activity against Bacillus thuringiensis (Bt). H. subflexa larvae benefit from this property by gaining a higher tolerance to Bt spores when fed with withanolides. We argue that the specialization in the H. subflexa-Physalis system has been guided to a large extent by plant chemistry, with H. subflexa adapting its immune system to the immune-altering properties of the withanolides. Instead of simply tolerating or detoxifying plant defensive compounds, H. subflexa has used them to its own advantage in its immune system, demonstrating an unusual benefit to specialization.