The soil-dwelling amoeba Dictyostelium discoideum lives in close association with bacterial symbionts. It can carry, seed and later harvest the bacterium Pseudomonas fluorescens in a process described as farming. However, farming amoebae carry both food and non-food strains, and the function of the non-food strains was unclear. D. discoideum clone QS161 carries two strains of P. fluorescens. Liquid chromatography–mass spectrometry analysis of culture extracts of the food and non-food strains revealed that the inedible strain produces two beneficial secondary metabolites: the antifungal pyrrolnitrin and a new compound called chromene. Both metabolites stimulated D. discoideum QS161 spore production, a process that depends on successful symbiosis. Genome sequencing identified a premature stop codon in the gacA gene of the food strain. This mutation inactivates the two-component GacA–GacS system, which normally upregulates the production of antimicrobials such as pyrrolnitrin. Thus, the mutation converts the beneficial but inedible symbiont into a food source.