Agricultural expansion and intensification are major drivers of global change. Quantifying the importance of different processes governing the assembly of local communities in agroecosystems is essential to guide the conservation effort allocated to enhancing habitat connectivity, improving habitat quality or managing species interactions. We used multiple detection methods to record the occurrence of medium‐sized and large‐sized mammals in three managed landscapes of a heterogeneous Mediterranean region. Then we used a joint species distribution model to evaluate the relative influence of dispersal limitation, environmental filtering, and interspecific interactions on the local assembly of mammal communities in 4‐km2 plots. The partitioning of the explained variation in species occurrence was attributed on average 99% to environmental filters and 1% to dispersal filters. No role was attributed to biotic filters, in agreement with the scarce support for strong competition or other negative interactions found after a literature review. Four principal environmental factors explained on average 63% of variance in species occurrence and operated mainly at the landscape scale. The amount of shrub cover in the neighboring landscape was the most influential factor favoring mammal occurrence and accounted for nearly one‐third of the total variance. The proportion of intensively managed croplands and proxies of human activity within landscape samples limited mammal presence. At the microhabitat scale (~80 m2 plots) the mean percentage area deprived of woody vegetation also had a negative effect. Functional traits such as body mass or social behavior accounted for a substantial fraction of the variation attributed to environmental factors. We concluded that multiscale environmental filtering governed local community assembly, whereas the role of dispersal limitation and interspecific interactions was negligible. Our results suggest that further removal of shrubland, the expansion of intensive agriculture, and the increase of human activity are expected to result in species losses. The fact that community integrity responds to a single type of ecological process simplifies practical recommendations. Management strategies should focus on the conservation and restoration of shrubland, adopting alternatives to intensive schemes of agricultural production, and minimizing recreational and other human activities in remnant natural habitats within agroecosystems or mosaic landscapes.