Large animal species are most likely to survive human-induced rapid environmental change if they display high levels of behavioural flexibility. Examining social responses in species that form closely bonded social groups and display high fission–fusion dynamics, such as chimpanzees, Pan troglodytes , will help determine their resilience to dynamic human activities and the potential for sustainable human–wildlife interactions. Coinciding with the seasonal availability of cultivated jackfruit, Artocarpus heterophyllus , a dominant food available in croplands and village gardens, we examined the social adjustments of wild chimpanzees to risks presented by a human-modified landscape at Bulindi, Uganda. Absolute party size decreased when chimpanzees moved from low-risk ‘natural’ habitat (forest fragments) to high-risk ‘anthropogenic’ habitat (croplands and other village areas), driven mainly by parties containing fewer females. Using social network analysis, we found that chimpanzee social structure showed partial flexibility in response to anthropogenic risk. The strength of social ties in a 5 m proximity network stayed similar and individual centrality measures were correlated between low- and high-risk habitats. Nevertheless, in high-risk habitat males were more central than females and exclusively dominated the core of the network's core–periphery structure. However, sex differences were not apparent when we corrected for party membership, indicating that differences were driven by changes to party membership between habitat types rather than changes in social proximity within parties. We suggest that perception of anthropogenic risk can drive continual adjustments to grouping dynamics in response to changing conditions that modify social lives of male and female chimpanzees in different ways. Consequently, changes in grouping patterns induced by continuing anthropogenic change could impact ecological and evolutionary processes influenced by social structure, including cultural evolution and the spread of infectious disease. • Party size decreased from low-risk ‘natural’ to high-risk ‘anthropogenic’ habitat. • Males had higher social centrality than females in high-risk habitat only. • Sex differences in centrality were caused by females avoiding high-risk habitat. • No sex difference in centrality was apparent when controlling for party membership. • Chimpanzee social structure showed partial flexibility to anthropogenic risk.