Tryptophan catabolites from microbiota engage aryl hydrocarbon receptor and balance mucosal reactivity via interleukin-22. Endogenous tryptophan (Trp) metabolites have an important role in mammalian gut immune homeostasis, yet the potential contribution of Trp metabolites from resident microbiota has never been addressed experimentally. Here, we describe a metabolic pathway whereby Trp metabolites from the microbiota balance mucosal reactivity in mice. Switching from sugar to Trp as an energy source (e.g., under conditions of unrestricted Trp availability), highly adaptive lactobacilli are expanded and produce an aryl hydrocarbon receptor (AhR) ligand-indole-3-aldehyde-that contributes to AhR-dependent Il22 transcription. The resulting IL-22-dependent balanced mucosal response allows for survival of mixed microbial communities yet provides colonization resistance to the fungus Candida albicans and mucosal protection from inflammation. Thus, the microbiota-AhR axis might represent an important strategy pursued by coevolutive commensalism for fine tuning host mucosal reactivity contingent on Trp catabolism.