Helicobacter pylori is the strongest risk factor for gastric adenocarcinoma, yet only a minority of infected persons ever develop this malignancy. One cancer-linked locus is the cag type 4 secretion system (cagT4SS), which translocates an oncoprotein into host cells. A structural component of the cagT4SS is CagY, which become rapidly altered during in vivo adaptation in mice and rhesus monkeys, rendering the cagT4SS nonfunctional; however, these models rarely develop gastric cancer. We previously demonstrated that the H. pylori cag+ strain 7.13 rapidly induces gastric cancer in Mongolian gerbils. We now use this model, in conjunction with samples from patients with premalignant lesions, to define the effects of a carcinogenic host environment on the virulence phenotype of H. pylori to understand how only a subset of infected individuals develop cancer. H. pylori cagY sequence differences and cagT4SS function were directly related to the severity of inflammation in human gastric mucosa in either a synchronous or metachronous manner. Serial infections of Mongolian gerbils with H. pylori strain 7.13 identified an oscillating pattern of cagT4SS function. The development of dysplasia or cancer selected for attenuated virulence phenotypes, but robust cagT4SS function could be restored upon infection of new hosts. Changes in the genetic composition of cagY mirrored cagT4SS function, although the mechanisms of cagY alterations differed in human isolates (mutations) versus gerbil isolates (addition/deletion of motifs). These results indicate that host carcinogenic phenotypes modify cagT4SS function via altering cagY, allowing the bacteria to persist and induce carcinogenic consequences in the gastric niche.