Attenuation of a virulent virus is a proven approach for generating vaccines but can be unpredictable. For example, synonymous recoding of viral genomes can attenuate replication but sometimes results in pleiotropic effects that confound rational vaccine design. To enable specific, conditional attenuation of viruses, we examined target RNA features that enable zinc finger antiviral protein (ZAP) function. ZAP recognized CpG dinucleotides and targeted CpG-rich RNAs for depletion, but RNA features such as CpG numbers, spacing and surrounding nucleotide composition that enable specific modulation by ZAP were undefined. Using synonymously mutated HIV-1 genomes, we defined several sequence features that govern ZAP sensitivity and enable stable attenuation. We applied rules derived from experiments with HIV-1 to engineer a mutant enterovirus A71 genome whose attenuation was stable and strictly ZAP-dependent, both in cell culture and in mice. The conditionally attenuated enterovirus A71 mutant elicited neutralizing antibodies that were protective against wild-type enterovirus A71 infection and disease in mice. ZAP sensitivity can thus be readily applied for the rational design of conditionally attenuated viral vaccines.