The outcome of natural enemy attack in insects is commonly impacted by the presence of defensive microbial symbionts residing within the host. Beyond their presence, the outcome of the interaction can also depend on genetic and environmental factors. The thermal environment is a key factor known to affect symbiont-mediated traits in insects, including their ability to defend against natural enemy attack. Cooler temperatures, for instance, have been previously shown to reduce Spiroplasma-mediated protection in Drosophila. Here, we dissect the effect of the thermal environment on Spiroplasma-mediated protection against Leptopilina boulardi in Drosophila melanogaster by examining the effect of temperature before, during and after wasp attack on fly survival and wasp success. We observed that the developmental temperature of the mothers' of attacked larvae, and not the temperature of the attacked larvae themselves during or after wasp attack, strongly determines the protective influence of Spiroplasma. Spiroplasma-mediated fly survival was found to be weaker when parental flies were reared at 21 C before their larvae were exposed to wasps compared to larvae derived from parental flies reared at 23 C or 25 C. Contrastingly, there was no effect of thermal environment on protection when mothers were reared at 25 C, and their progeny exposed to lower temperatures during and after wasp attack. The effect of developmental temperature on Spiroplasma-mediated protection is likely mediated by reduced Spiroplasma titre combined, at cooler temperatures, with segregation of infection. These results indicate the historical thermal environment is a stronger determinant of protection than current environment, and that protective capacity is partly an epigenetic trait.