Mutualisms are interspecific interactions in which both players benefit. Explaining their maintenance is problematic, because cheaters should outcompete cooperative conspecifics, leading to mutualism instability. Monoecious figs (Ficus) are pollinated by host-specific wasps (Agaonidae), whose larvae gall ovules in their “fruits” (syconia). Female pollinating wasps oviposit directly into Ficus ovules from inside the receptive syconium. Across Ficus species, there is a widely documented segregation of pollinator galls in inner ovules and seeds in outer ovules. This pattern suggests that wasps avoid, or are prevented from ovipositing into, outer ovules, and this results in mutualism stability. However, the mechanisms preventing wasps from exploiting outer ovules remain unknown. We report that in Ficus rubiginosa, offspring in outer ovules are vulnerable to attack by parasitic wasps that oviposit from outside the syconium. Parasitism risk decreases towards the centre of the syconium, where inner ovules provide enemy-free space for pollinator offspring. We suggest that the resulting gradient in offspring viability is likely to contribute to selection on pollinators to avoid outer ovules, and by forcing wasps to focus on a subset of ovules, reduces their galling rates. This previously unidentified mechanism may therefore contribute to mutualism persistence independent of additional factors that invoke plant defences against pollinator oviposition, or physiological constraints on pollinators that prevent oviposition in all available ovules.