Group size and vigilance are tools that animals can use to mitigate predation risk, and many studies have reported a negative relationship between them. Vigilance studies often investigate the direct effect of group size on vigilance, but they ignore the effect of ecological factors on group size. As a consequence, these studies can overlook important indirect effects of ecological factors on vigilance via group size. We investigated how ecological factors affect vigilance behavior in rock hyraxes (Procavia capensis), both directly and indirectly via group size. First, we showed a direct negative relationship between group size and vigilance behavior by measuring vigilance behavior before and after a change in group size. Second, we conducted a path analysis that included group size and several ecological factors (distance from shelter, distance from center of kopje, vegetation cover, and time since start of foraging session). Similar to the 1st analysis, the path analysis identified a strong negative relationship between group size and vigilance behavior; however, the other variables had little effect on group size or vigilance behavior, or both.