The gastrointestinal tract is inhabited by a vast community of microorganisms, termed the gut microbiota. Large colonies can pose a health threat, but the gastrointestinal mucus system protects epithelial cells from microbiota invasion. The human colon features a bilayer of mucus lining. Due to imbalances in intestinal homeostasis, bacteria may successfully penetrate the inner mucus layer, which can lead to severe gut diseases. However, it is hard to tease apart the competing mechanisms that lead to this penetration. To probe the conditions that permit bacteria penetration into the inner mucus layer, we develop an agent-based model consisting of bacteria and an inner mucus layer subject to a constant flux of nutrient fields feeding the bacteria. We find that there are three important variables that determine bacterial invasion: the bacterial reproduction rate, the contact energy between bacteria and mucus, and the rate of bacteria degrading the mucus. Under healthy conditions, all bacteria are naturally eliminated by the constant removal of mucus. In diseased states, imbalances between the rates of bacterial degradation and mucus secretion lead to bacterial invasion at certain junctures. We conduct uncertainty quantification and sensitivity analysis to compare the relative impact between these parameters. The contact energy has the strongest influence on bacterial penetration, which, in combination with bacterial degradation rate and growth rate, greatly accelerates bacterial invasion of the human gut mucus lining. Our findings will serve as predictive indicators for the etiology of intestinal diseases and highlight important considerations when developing gut therapeutics.