Abstract Chronic hepatitis B virus (HBV) infection affects 300 million patients worldwide 1,2 , in whom virus-specific CD8 T cells by still ill-defined mechanisms lose their function and cannot eliminate HBV-infected hepatocytes 3–7 . Here we demonstrate that a liver immune rheostat renders virus-specific CD8 T cells refractory to activation and leads to their loss of effector functions. In preclinical models of persistent infection with hepatotropic viruses such as HBV, dysfunctional virus-specific CXCR6 + CD8 T cells accumulated in the liver and, as a characteristic hallmark, showed enhanced transcriptional activity of cAMP-responsive element modulator (CREM) distinct from T cell exhaustion. In patients with chronic hepatitis B, circulating and intrahepatic HBV-specific CXCR6 + CD8 T cells with enhanced CREM expression and transcriptional activity were detected at a frequency of 12–22% of HBV-specific CD8 T cells. Knocking out the inhibitory CREM / ICER isoform in T cells, however, failed to rescue T cell immunity. This indicates that CREM activity was a consequence, rather than the cause, of loss in T cell function, further supported by the observation of enhanced phosphorylation of protein kinase A (PKA) which is upstream of CREM. Indeed, we found that enhanced cAMP–PKA-signalling from increased T cell adenylyl cyclase activity augmented CREM activity and curbed T cell activation and effector function in persistent hepatic infection. Mechanistically, CD8 T cells recognizing their antigen on hepatocytes established close and extensive contact with liver sinusoidal endothelial cells, thereby enhancing adenylyl cyclase–cAMP–PKA signalling in T cells. In these hepatic CD8 T cells, which recognize their antigen on hepatocytes, phosphorylation of key signalling kinases of the T cell receptor signalling pathway was impaired, which rendered them refractory to activation. Thus, close contact with liver sinusoidal endothelial cells curbs the activation and effector function of HBV-specific CD8 T cells that target hepatocytes expressing viral antigens by means of the adenylyl cyclase–cAMP–PKA axis in an immune rheostat-like fashion.