Living in groups provides benefits but also incurs costs such as attracting disease vectors. For example, synanthropic flies associate with human settlements, and higher fly densities increase pathogen transmission. We investigated whether such associations also exist in highly mobile nonhuman primate (NHP) Groups. We studied flies in a group of wild sooty mangabeys (Cercocebus atys atys) and three communities of wild chimpanzees (Pan troglodytes verus) in Taï National Park, Côte d’Ivoire. We observed markedly higher fly densities within both mangabey and chimpanzee groups. Using a mark–recapture experiment, we showed that flies stayed with the sooty mangabey group for up to 12 days and for up to 1.3 km. We also tested mangabey-associated flies for pathogens infecting mangabeys in this ecosystem, Bacillus cereus biovar anthracis (Bcbva), causing sylvatic anthrax, and Treponema pallidum pertenue, causing yaws. Flies contained treponemal (6/103) and Bcbva (7/103) DNA. We cultured Bcbva from all PCR-positive flies, confirming bacterial viability and suggesting that this bacterium might be transmitted and disseminated by flies. Whole genome sequences of Bcbva isolates revealed a diversity of Bcbva, probably derived from several sources. We conclude that flies actively track mangabeys and carry infectious bacterial pathogens; these associations represent an understudied cost of sociality and potentially expose many social animals to a diversity of pathogens. © 2019 John Wiley & Sons Ltd