The gut and immune system form a complex structure that provides defence against ingested toxins and pathogenic bacteria.