Carnivorous plants allocate more resources to carnivorous structures under nutrient-limited conditions, and relative investment can also be influenced by animals (infauna) that live in association with these plants and feed on their prey. We investigated these effects within a population of the pitcher plant Cephalotus follicularis containing varying densities of larvae of the fly Badisis ambulans. For plants with a relatively high proportion of adult pitchers, increasing larval density was associated with lower relative leaf allocation to new pitcher buds. For plants with relatively few adult pitchers, however, there was greater relative leaf allocation to pitcher buds with increasing larval density. In a field experiment, there was no significant effect of experimental larval presence or absence on the change in carbon-tonitrogen (C/N) ratio of plants. Although the direction of the correlation between B. ambulans larvae and relative investment in carnivorous and non-carnivorous structures depends on the relative number of mature structures, whether the larvae enhance or reduce nutrient stress under different conditions remains unclear. The change in C/N was, however, less variable for pitchers that contained larvae, suggesting a stabilizing effect. Eighteen of 52 experimental pitchers were damaged by an unknown species, causing the pitcher fluid to drain. These pitchers were significantly more likely to survive if they contained larvae. These results suggest that the relationship between infauna and host varies with the initial resource status and environmental context of the host plant.