NAFLD indirectly impairs antigen-specific CD8+ T cell immunity against liver cancer in mice. Here, CD8A is linked to metabolic dysfunction-associated steatotic liver disease.