Mutualisms can be viewed as biological markets in which partners of different species exchange goods and services to their mutual benefit. Trade between partners with conflicting interests requires mechanisms to prevent exploitation. Partner choice theory proposes that individuals might foil exploiters by preferentially directing benefits to cooperative partners. Here, we test this theory in a wild legume-rhizobium symbiosis. Rhizobial bacteria inhabit legume root nodules and convert atmospheric dinitrogen (N-2) to a plant available form in exchange for photosynthates. Biological market theory suits this interaction because individual plants exchange resources with multiple rhizobia. Several authors have argued that microbial cooperation could be maintained if plants preferentially allocated resources to nodules harbouring cooperative rhizobial strains. It is well known that crop legumes nodulate non-fixing rhizobia, but allocate few resources to those nodules. However, this hypothesis has not been tested in wild legumes which encounter partners exhibiting natural, continuous variation in symbiotic benefit. Our greenhouse experiment with a wild legume, Lupinus arboreus, showed that although plants frequently hosted less cooperative strains, the nodules occupied by these strains were smaller. Our survey of wild-grown plants showed that larger nodules house more Bradyrhizobia, indicating that plants may prevent the spread of exploitation by favouring better cooperators.