Plants continuously monitor the presence of microorganisms through their immune system to establish an adaptive response. Unlike immune recognition of pathogenic bacteria, mechanisms by which beneficial bacteria interact with the plant immune system are not well understood. Analysis of colonization of Arabidopsis thaliana by auxin producing beneficial bacteria revealed that activating the plant immune system is necessary for efficient bacterial colonization and auxin secretion. A feedback loop is established in which bacterial colonization triggers an immune reaction and production of reactive oxygen species, which, in turn, stimulate auxin production by the bacteria. Auxin promotes bacterial survival and efficient root colonization, allowing the bacteria to compete with other members of the root microbial community and inhibit fungal infection, promoting plant health.