Using the mouse polyomavirus (MuPyV) encephalitis model, we demonstrate that CD4 T cells regulate development of functional antiviral brain-resident CD8 T cells (bTRM) and renders their maintenance refractory to systemic CD8 T cell depletion. This evidence concerns the gene CD8A and viral encephalitis.