The immune system plays an important role in survival of organisms. Despite an increasing complexity in its evolution, we still see individual variability in sensitivity to diseases. Life-history theory states that maintaining the immune system and producing an immune response is costly, leading to trade-offs with other life-history traits such as growth and reproduction. In environments with few resources, those trade-offs should be exacerbated. We aimed to understand how variations of individual phenotype such as immune responses are shaped by environmental and genetic factors. In a context of increasing human activities, such as agricultural intensification, how immunity could be affected in a population of Tree swallows (Tachycineta bicolor)? Moreover, are there genetic markers that could characterise immunity to detangle the causes of variations in immune responses at the individual level? Contrary to what we expected, individuals in intensive breeding habitats (monocultures on large surfaces) had a higher constitutive immune response than those breeding in non-intensive farmlands. Moreover, we noticed a temporal decline in immune response at the population and individual levels. Finally, when looking at specific immune genes (βdefensin), the genetic variations we detected was not linked to the constitutive immune response, suggesting that this immune response was mainly affected by environmental factors.