Risk is a fundamental driver of prey behaviour, but the importance of risk in the decision-making processes of top predators is poorly understood. We investigated the functions of vigilance behaviour in wild spotted hyaenas. These large carnivores have few predators but face frequent threats of attack and food theft by conspecifics. We made repeated observations of vigilance behaviour by hyaenas when they were resting, feeding and nursing, and examined variation due to age, group size, social rank, and factors related to predation risk. We used these observations to test whether vigilance functions in hyaenas to detect prey, mates, conspecific threats or interspecific threats, and whether functions differ between juveniles and adults. We found that adults were more vigilant than juveniles in all contexts. Vigilance by adults was greatest when nursing, but nursing females reduced their vigilance as cubs matured. Among both age groups, vigilance decreased with increasing group size, and hyaenas were less vigilant when feeding on high-quality food than when feeding on low-quality food. Social rank did not affect vigilance in either age group. Individual adults, but not juveniles, showed consistent patterns of vigilance within, but not between, behavioural contexts. Surprisingly, our results indicate that the primary function of vigilance in hyaenas is to detect interspecific threats. Furthermore, vigilance was context specific, and adult hyaenas showed individual variation in vigilance within behavioural contexts. These findings illustrate the relative importance of particular risks in shaping vigilance behaviour of a top carnivore.