Mucosal surfaces such as the intestinal tract are continuously exposed to both potential pathogens and beneficial commensal microorganisms. This creates a requirement for a homeostatic balance between tolerance and immunity that represents a unique regulatory challenge to the mucosal immune system. Recent findings suggest that intestinal epithelial cells, although once considered a simple physical barrier, are a crucial cell lineage for maintaining intestinal immune homeostasis. This Review discusses recent findings that identify a cardinal role for epithelial cells in sampling the intestinal microenvironment, discriminating pathogenic and commensal microorganisms and influencing the function of antigen-presenting cells and lymphocytes.