The immune system is costly to maintain and use because it requires a lot of energy. This can make parasite resistance dependent on host nutritional state. The dependence of immune function on host condition can have broad ecological (e.g., disease dynamics) and evolutionary (e.g., expression of trade-offs related to parasite resistance) consequences. Research on the dependence of immune function on host condition is typically conducted in laboratory experiments that manipulate either the quantity or composition of available resources. Such studies are essential in establishing conceptual frameworks, but their results are difficult to generalise to natural populations because the experimental treatments may deviate from natural variation in host resource level and use. We examined the condition dependence of immune function in a generalist freshwater snail Lymnaea stagnalis by relating the activity of two immune parameters of snail haemolymph, phenoloxidase (PO)-like and antibacterial activity, to snail resource level and use using field-collected individuals. We measured several variables that reflect the snails’ quality based on their recent (i.e., within the past few days; amount and stable isotope composition [δ 15N and δ 13C] of produced faeces) and longer-term (i.e., weeks to months; stable isotope composition of tissues) resource use. The PO-like activity of the snails’ haemolymph was condition-dependent. Snails that had recently consumed food from higher trophic levels, presumably including more animal protein (high δ 15N values of faeces), had a stronger defence. Additionally, snails with low energy (i.e., lipid) reserves in their tissues (high δ 13C values of tissues) showed higher PO-like activity. The antibacterial activity of the snails’ haemolymph was not condition dependent. The finding of the importance of the composition of recently consumed food on immune function (namely PO-like activity) suggests that the parasite resistance of snails may change rapidly depending on the type of resources available in their environment. Thus, environmental variation may influence the outcome of host–parasite interactions on fine spatial and temporal scales. Furthermore, the negative relationship between the snails’ energy reserves and PO-like activity suggests substantial energetic costs of immune activity in L. stagnalis.