While animal aggregations can benefit the fitness of group members, the behaviour may also lead to higher risks of parasite infection as group density increases. Some animals are known to moderate their investment in immunity relative to the risk of infection. These animals exhibit density-dependent prophylaxis (DDP) by increasing their immune investment as group density increases. Despite being documented in many taxa, the mechanisms of DDP remain largely unexplored. Snails are known to aggregate and experience large fluctuations in density and serve as required hosts for many parasites. Further, they are known to use chemical cues to aggregate. To test whether freshwater snails exhibit DDP and investigate the role that chemical signaling compounds may play in triggering this phenomenon, we performed four experiments on the freshwater snail Stagnicola elodes, which is a common host for many trematode parasite species. First, we tested if DDP occurred in snails in laboratory-controlled conditions (control vs snail-conditioned water) and whether differences in exposure to chemical cues affected immune function. Second, we used gas chromatography to characterize fatty acids expressed in snail-conditioned water to determine if precursors for particular signaling molecules, such as oxylipins, were being produced by snails. Third, we characterized the oxylipins released by infected and uninfected field-collected snails, to better understand how differences in oxylipin cocktails may play a role in inducing DDP. Finally, we tested the immune response of snails exposed to four oxylipins to test the ability of specific oxylipins to affect DDP. We found that snails exposed to water with higher densities of snails and raised in snail-conditioned water had higher counts of haemocytes. Additionally, lipid analysis demonstrated that fatty acid molecules that are also precursors for oxylipins were present in snail-conditioned water. Trematode-infected snails emitted 50 oxylipins in higher amounts, with 24 of these oxylipins only detected in this group. Finally, oxylipins that were higher in infected snails induced naïve snails to increase their immune responses compared to sham-exposed snails. Our results provide evidence that snails exhibit DDP, and the changes in oxylipins emitted by infected hosts may be one of the molecular mechanisms driving this phenomenon.