A streamlined stack of supplements designed to meet your most critical needs - Adapt Naturals is now live. Learn more

How the Gut Microbiome Programs the Immune System

by Katie Melville, Ph.D.

Published on

microbiome and immune system
The gut microbiome shapes the immune system, and gut disturbances can contribute to immune-related problems like allergies. Stock/Cecilie_Arcurs

Maybe you’ve heard the claim that “70 percent of the immune system is in the gut,” but what does that mean? Read on to learn about the anatomy of the gut, which immune cells are in the gut, and how the gut microbiome influences almost everything about the immune system.

Free eBook

Learn More about the Gut

You’re only as healthy as your gut. Enter your email below to find out how to support a healthy gut.

"*" indicates required fields

I hate spam, too. Your email is safe with me. By signing up, you agree to our privacy policy.

Your Gut—What It Is and What It Does

Gut microbes populate the human gastrointestinal tract, increasing in density from the mouth down to the rectum. The majority of the bacteria in the gut belong to three phyla: Firmicutes, Proteobacteria, and Bacteroidetes followed by Actinobacteria and Verrucomicrobia. (1) Fungi species and viruses, though not the focus of this article, are also normally present in the human gut. The estimated thousands of billions of gut microbes perform vital functions in the body: (2, 3, 4, 5)

  • Ferment indigestible carbohydrates
  • Synthesize vitamins including vitamin K2, vitamin B12, folate, and thiamine
  • Produce metabolites that confer benefits to the host, including short-chain fatty acids (SCFAs)
  • Modify bile acids
  • Contribute to gut motility
  • Support gut barrier integrity
  • Compete with pathogens
  • Communicate with and shape the immune system

This list should give you a good appreciation of how the gut is linked to every aspect of health. Since the gut shapes the immune system (in ways we’ll get to below), it makes sense that gut disturbances can contribute to immune-related diseases, including allergies and autoimmune diseases like inflammatory bowel disease, multiple sclerosis, rheumatoid arthritis, and type 1 diabetes. (6, 7) Leaky gut and gut dysbiosis are also linked to chronic inflammation and a long list of other diseases, including: (8, 9, 10, 11, 12)

Check out this article from Katie Melville for an in-depth look at how your gut programs your immune system. #optimalhealth #wellness

Gut Anatomy: Three Layers of Protection

The gastrointestinal tract comprises a very large surface area vulnerable to outside invaders (i.e., bacteria, viruses, allergens) found in food and the environment. Therefore, the gut barrier is organized into three specialized and protective layers, in order from the inside out:

  1. The mucous layer
  2. The epithelium
  3. The lamina propria

Mucous Layer

The mucous layer of the gut contains a mixture of mucus, gut microbes, and various other molecules, like cytokines, antimicrobial peptides, and immunoglobulin A (IgA). (13) The mucus acts as a physical barrier of first-line immune defense. This viscous layer keeps food antigens and pathogens from reaching the epithelium or crossing the epithelium and getting into circulation where they can trigger inflammation and other immune reactions.


The epithelial layer consists of a single layer of cells that are held together by highly selective gap junctions. Most of the cells are enterocytes, which transport fluid and absorb molecules from the gut. Other cell types include: (14)

  • Mucus-secreting goblet cells
  • Antimicrobial-secreting paneth cells
  • Enteroendocrine cells that can signal to the endocrine system

Epithelial cells can receive and transmit signals from the mucous layer to the lamina propria, and vice versa. Some dendritic immune cells span the epithelium to send and receive signals, as well. (15)

Lamina Propria

Located beneath the epithelium, the lamina propria is the gut component that physically connects to the systemic circulation. But, for a foreign substance to actually get to the bloodstream, it would have to cross the mucous layer and epithelium and get past the lamina propria immune cells first. The majority of the intestinal immune cells are found in the lamina propria: T cells, B cells, macrophages, dendritic cells, etc. (16)

Through cell signaling mechanisms, the cells in the lamina propria can interact with what’s in the gut. For example, dendritic cells can detect bacteria in the mucous layer and then cross the epithelium, making it to circulation and lymph nodes, where they can activate T cells and the inflammatory response. (17)

Four Ways the Gut Microbiome Programs and Regulates the Immune System

With its selective barrier, thick mucous layer, and high density of immune cells, the gut and gut microbiota are intimately involved in the body’s immune function. I’m going to focus on four different ways:

  1. Initial development of the immune system
  2. Resisting pathogenic infections
  3. Promoting self-tolerance
  4. Ongoing communication through secreted substances

1. Initial Development of the Immune System

The immune system requires the cooperation of gut microbes. Without gut bacteria, the immune system will not develop properly, as has been shown in mouse and other animal models, time and time again. “Germ-free mice” that are raised in a sterile environment do not acquire a microbiome, and their immune systems suffer. Just some of the immune system issues they experience include: (18, 19, 20)

  • Deformed spleen and lymph nodes
  • Altered ratio between T helper 1 (Th1) and T helper 2 (Th2) cells, which shifts the immune system toward autoimmunity
  • Reduced numbers of immune cells in the lamina propria
  • Lower production of IgA in the mucus
  • Overall reduced capacity for antibody production

Contrary to long-held belief, evidence demonstrates that some bacteria may be present before birth in humans. (21) However, the vast majority of microbiome colonization occurs after birth. The first two to three years of life are the critical window of opportunity for the microbiome to develop and program the immune system. (22, 23) During this time, commensal bacteria “train” the immune system to recognize common gut bacteria as helpers, not invaders. (24, 25, 26) Likewise, the microbiome sends messages to the body about early environmental exposures (food, allergens, etc.) to enable tolerance to these substances later in life.

2. Training the Immune System to Tolerate Commensal Bacteria and to Attack Pathogenic Bacteria

Gut bacteria have co-evolved with humans and their ancestors over millions of years to create the symbiotic relationship that exists today.

  • Commensal bacteria are the normal inhabitants that generally cooperate with human health.
  • Opportunistic bacteria are strains normally present in low levels in the gut, but can, given the right conditions, overpower and cause infection.
  • Pathogenic bacteria are not normally in the gut but can enter through contaminated food or water.

How does the immune system know which microbes are friends, and which are foes? Early life colonization as discussed above is of paramount importance. Once the immune system is properly trained, it lets the “good” flora go about their business. When innate immune cells in the mucus come in contact with pathogenic bacteria, the cells secrete inflammatory cytokines and chemokines that recruit more innate immune cells and may activate the dendritic cells that can signal to the systemic circulation in the lamina propria. Additionally, commensal bacteria secrete peptides that compete with opportunistic and pathogenic bacteria. (27)

3. Ensuring the Immune System Tolerates Itself

Early in life, gut microbes regulate the differentiation of T lymphocytes into either effector T cells that attack antigens or regulatory T cells (Tregs) that tolerate antigens. For example, Bacteroides fragilis is recognized by Tregs to promote immune tolerance. (28) On the other hand, microbes in the gut secrete peptides and cytokines that eventually trigger T effector cells in the lamina propria to release IgA, cytokines, and inflammatory mediators in the affected gut regions. (29)

With the proper balance, the immune system will activate in response to invaders but tolerate the body’s own cells and food antigens. This balance helps to prevent food allergies and autoimmune disorders.

4. Secretion of Substances to Facilitate Ongoing Communication between the Immune System and Gut

Although early life plays a large role in proper immune system development, all hope is not lost after age 2 or 3. The gut microbiome continually shapes and refines the immune system throughout life, given that it receives proper nutrition and care. Based on inputs from the host, gut microbes secrete a variety of substances to build up the gut barrier and inform the immune system. I’ll highlight a few well-studied ones below.


Some species of gut bacteria ferment indigestible fiber from the diet into lactate, gas, and the SCFAs acetate, propionate, and butyrate. Butyrate is the primary source of fuel for the epithelial cells. SCFAs activate various receptors on immune cells to regulate the gut’s immune system in the following ways: (30, 31, 32)

  • Upholding tight gap junctions
  • Anti-inflammatory effects
  • Promoting the differentiation of T lymphocytes
  • Boosting antibody production in adaptive immune cells
  • Enhancing the activity of innate immune cells including dendritic cells and macrophages

Polysaccharide A

Commensal bacteria species B. fragilis produces polysaccharide A, an indigestible sugar with strong anti-inflammatory effects. (33) Polysaccharide A also influences T helper cell activity to favor immune tolerance by shifting the Th1 to Th2 ratio toward Th1. (34)


Indoles are synthesized by gut bacteria from the essential amino acid tryptophan, but they also are derived from plants in the diet. Indoles influence the first line of immune defense—the gut barrier—by affecting mucous production from goblet cells and also reinforcing gap junctions between endothelial cells. (35, 36)


Polyamines are derived from most types of food and absorbed into the small intestine. They also are produced by gut bacteria farther along in the digestive tract in the large intestine. Polyamines counteract proinflammatory cytokines released by innate immune cells. They help maintain the mucous layer by influencing endothelial cells. (37, 38)

When Things Go Wrong

The microbiome and immune system are continually alert and at work to keep invaders from crossing the gut barrier. But they’re not invincible. Many factors can wreak havoc on the gut, including:

If the mucous layer becomes inadequate, or if microbial diversity isn’t upheld with good fiber and nutrient intake, or if antibiotics wipe out lots of the good bacteria, then antigens and pathogenic bacteria can reach the epithelium.

If antigens or proteins reach the epithelium when they shouldn’t, innate immune cells and the microbiome mediate local inflammation. Chronic inflammation eventually can compromise gap junctions between epithelial cells, allowing normally harmless proteins to enter the lamina propria and be exposed to the bloodstream. Since these proteins shouldn’t be in the blood, the immune system recognizes them as a threat, which can eventually lead to an allergy or autoimmune attack. (43)

How to Take Care of Your Gut

Keeping the gut healthy influences the immune system and virtually every aspect of health. For more information, Chris has written several articles on how to heal your gut. Some of the ways to take care of your gut include:

If you need help implementing these changes in your diet and lifestyle, you have options. Working with a health coach can help you establish your goals and make long-lasting changes that support your health. If you’re looking for a Functional care team to help you transform your health, the California Center for Functional Medicine might be the right option for you.
Katie Melville
Katie Melville, Ph.D.

Katie Melville earned a Ph.D. in Biomedical Engineering from Cornell University, where she studied the mechanisms of bone formation and resorption. In particular, she elucidated the effects of sex hormones and their receptors on bone mass and architecture. She also researched estrogen's role in bone's response to mechanical loading. She has co-authored several peer-reviewed research papers, written book chapters, and has presented at national conferences, including those held by the Orthopaedic Research Society and the American Society for Bone and Mineral Research.

Her interest in Ancestral Health and Functional Medicine began over a decade ago, when she started following Chris Kresser's articles and podcasts. Over the years, she has made significant changes to her family’s lifestyle, including adopting a Paleo diet template, installing a reverse-osmosis water filter, and incorporating a standing desk into her office space.

Since 2016, she has been honored to be a writer and researcher for Chris Kresser and Kresser Institute, relying on peer-reviewed literature and incorporating Chris's clinic experiences into her articles. Katie strives to understand the current knowledge surrounding human chronic disease, and enjoys digging deep into the scientific literature. She believes the future of healthcare lies in functional medicine.

Katie has also written for Natural Womanhood, a popular website that shares the benefits of fertility tracking and using natural, fertility awareness-based methods of birth control. For continued education, Katie has completed online courses from Stanford on scientific writing and how to critically interpret clinical trials.

Professionally, Katie works for Recruitomics Biotalent Consulting as a Scientific Recruiter for start-up biotech companies in the Boston area. Being in this role exposes her to the latest technological and medical


She lives near Boston with her husband and 3 young children, and she enjoys powerlifting and cooking in her spare time.

View other articles by

Affiliate Disclosure
This website contains affiliate links, which means Chris may receive a percentage of any product or service you purchase using the links in the articles or advertisements. You will pay the same price for all products and services, and your purchase helps support Chris‘s ongoing research and work. Thanks for your support!