Undernutrition remains the primary cause of mortality in Madagascar, especially among poor rural communities, who rely to a large extent on subsistence agriculture and wild foods for their nutrition. Furthermore, Madagascar, a biodiversity hotspot, is registering rapidly diminishing levels of biodiversity, notably due to deforestation driven by shifting agriculture and unsustainable wild species harvesting. Biodiversity provides ecosystem services to farmers, sustaining agricultural production, and allows them to supplement their diets with wild foods. However, the impact of biodiversity loss on undernutrition in rural Madagascar remains largely unknown. The overarching aim of the study was to explore the links between biodiversity and nutrition in the context of eastern Madagascar. The specific objectives were to identify key social and ecological processes directly related to biodiversity and nutrition, represent them in an agent-based model, and observe whether and how the dynamic relationships between these processes reproduce empirical patterns of biodiversity loss and undernutrition in eastern Madagascar. In the agent-based model, alternative scenarios with varying impact on biodiversity were compared: a baseline scenario in which farming households resort to shifting agriculture and foraging to achieve their nutritional needs; a scenario introducing forest and wild species conservation, thus impacting agricultural expansion and foraging practices; and a scenario introducing a portfolio of agroecological practices adapted to the local context.