In the wild, the fruit fly Drosophila melanogaster thrives on rotten fruit. The digestive tract maintains a powerful gut immune barrier to regulate the ingested microbiota, including entomopathogenic bacteria. This gut immune barrier includes a chitinous peritrophic matrix that isolates the gut contents from the epithelial cells. In addition, the epithelial cells are tightly sealed by septate junctions and can mount an inducible immune response. This local response can be activated by invasive bacteria, or triggered by commensal bacteria in the gut lumen. As with chronic inflammation in mammals, constitutive activation of the gut innate immune response is detrimental to the health of flies. Accordingly, the Drosophila gut innate immune response is tightly regulated to maintain the endogenous microbiota, while preventing infections by pathogenic microorganisms.