Extrafloral nectar (EFN) mediates food‐for‐protection mutualisms between plants and ants. Such mutualisms exist within a complex web of biotic interactions, and in a framework provided by the abiotic environment. Both biotic and abiotic factors, therefore, affect the outcome of ant–plant interactions. We conducted an experiment to determine the effects of ant activity, and light intensity, on herbivory rates, growth, and reproductive fitness in Senna mexicana var. chapmanii, a perennial legume native to pine rockland habitats of south Florida. Forty plants were divided among four treatments in a factorial experimental design with two independent variables: ant activity and light intensity. Plants were divided equally between sunny and shady habitats, and ants were excluded from half of the plants in each habitat type. The presence of ants significantly reduced herbivory rates in S. chapmanii. In shaded habitats, the presence of ants had no effect on plant reproductive fitness, however, in sunny habitats plants with ants produced significantly more seeds over the duration of the 1‐yr study. Ants represent an important biotic defense against herbivores in S. chapmanii; however, their effects on plant fitness are dependent on light conditions. Pine rockland habitats in south Florida have been widely destroyed or mismanaged. In fragments that remain, suppression of fire has led to increased canopy closure and shading of the understory. These changes will likely negatively impact plants that rely on ants for defense. We highlight the importance of conservation efforts to preserve the pine rocklands and the fire regimes on which they rely.