In order to protect itself from a diverse set of environmental pathogens and toxins, the body has developed a number of barrier mechanisms to limit the entry of potential hazards. Here, we compare two such barriers: the gut immune barrier, which is the primary barrier against pathogens and toxins ingested in food, and the blood-brain barrier, which protects the central nervous system from pathogens and toxins in the blood. Although each barrier provides defense in very different environments, there are many similarities in their mechanisms of action. In both cases, there is a physical barrier formed by a cellular layer that tightly regulates the movement of ions, molecules, and cells between two tissue spaces. These barrier cells interact with different cell types, which dynamically regulate their function, and with a different array of immune cells that survey the physical barrier and provide innate and adaptive immunity.