The potential effect of larval condition on adult immunity in holometabolous insects is rarely considered. We show here that larval food composition can impact adult immunity independent from effects on general condition of the animal. Rather, our data indicate a plastic allocation of resources to immunity in high-protein environments. Specifically, we found that increasing the nutritional yeast (protein) available to larval Drosophila melanogaster increased the adult's constitutive transcription of two genes encoding defensive antimicrobial peptides. Adult dry weight was not significantly affected by larval food composition, while adult fat content decreased when larval yeast increased. Larval immune activity was unaffected by alterations of larval diet, indicating a lack of covariation in this trait across life-stages. We conclude that the nutritional environment of insect larvae can affect adult immunity by influencing plastic allocation of resources. These influences are less predictable than constraints linked to general condition would be.