Direct evaluation of the contribution of somatic hypermutation (SHM) to mucosal immunity has been hampered by the lack of models able to dissociate SHM from class-switch recombination, which are both dependent on the cytidine deaminase AID. A new mouse AID model now demonstrates the critical role of SHM in the control of gut bacteria.