Why do individuals have an imperfect immune system? Most studies suggest trade-offs associated with immunity and metabolism, and neglect ecological factors, such as predation. We provide one of the first experimental studies demonstrating a context-dependent survival cost to immune activation. In the presence of a predator, immune-challenged male field crickets showed significantly lower survival than controls, whilst there was no difference in a predator-free environment. Immune-challenged males spent more time outside their burrows and reacted slower to a simulated predator attack. We conclude that some costs of immunity are expressed via increased susceptibility to predation, indicating the importance of integrating the ecological context when investigating optimal investment in immunity.