Progressive multifocal leukoencephalopathy (PML) is a rare demyelinating disorder of the brain caused by reactivation of the JC virus (JCV), a polyomavirus that infects at least 60% of the population but is asymptomatic or results in benign symptoms in most people. PML occurs as a secondary disease in a variety of disorders or as a serious adverse event from immunosuppressant agents, but is mainly found in three groups: HIV-infected patients, patients with hematological malignancies, or multiple sclerosis (MS) patients on the immunosuppressant therapy natalizumab. It is severely debilitating and is deadly in ~50% HIV cases, ~90% of hematological malignancy cases, and ~24% of MS-natalizumab cases. A PML risk prediction test would have clinical utility in all at risk patient groups but would be particularly beneficial in patients considering therapy with immunosuppressant agents known to cause PML, such as natalizumab, rituximab, and others. While a JC antibody test is currently used in the clinical decision process for natalizumab, it is suboptimal because of its low specificity and requirement to periodically retest patients for seroconversion or to assess if a patient's JCV index has increased. Whereas a high specificity genetic risk prediction test comprising host genetic risk variants (i.e., germline variants occurring at higher frequency in PML patients compared to the general population) could be administered one time to provide clinicians with additional risk prediction information that is independent of JCV serostatus. Prior PML case reports support the hypothesis that PML risk is greater in patients with a genetically caused immunodeficiency disorder. To identify germline PML risk variants, we performed exome sequencing on 185 PML cases (70 in a discovery cohort and 115 in a replication cohort) and used the gnomAD variant database for interpretation. Our study yielded 19 rare variants (maximum allele frequency of 0.02 in gnomAD ethnically matched populations) that impact 17 immune function genes (10 are known to cause inborn errors of immunity). Modeling of these variants in a PML genetic risk test for MS patients considering natalizumab treatment indicates that at least a quarter of PML cases may be preventable.