In this study, we show that consumption of a common nonnutritive sweetener, sucralose, modifies microbiome composition, restricts T-cell metabolism and function, and limits immunotherapy response in preclinical models of cancer and patients with advanced cancer treated with anti–PD-1–based immune checkpoint inhibitors. Here, PDCD1 is linked to cancer.