Memory T cells exert antigen-independent effector functions, but how these responses are regulated is unclear. We discovered an in vivo link between flagellin-induced NLRC4 inflammasome activation in splenic dendritic cells (DCs) and host protective interferon-γ (IFN-γ) secretion by noncognate memory CD8(+) T cells, which could be activated by Salmonella enterica serovar Typhimurium, Yersinia pseudotuberculosis and Pseudomonas aeruginosa. We show that CD8α(+) DCs were particularly efficient at sensing bacterial flagellin through NLRC4 inflammasomes. Although this activation released interleukin 18 (IL-18) and IL-1β, only IL-18 was required for IFN-γ production by memory CD8(+) T cells. Conversely, only the release of IL-1β, but not IL-18, depended on priming signals mediated by Toll-like receptors. These findings provide a comprehensive mechanistic framework for the regulation of noncognate memory T cell responses during bacterial immunity.