Mg2+, the most abundant divalent cation in cells, catalyzes RNA cleavage but can also promote RNA folding. Because folding can protect RNA from cleavage, we predicted a "Goldilocks zone", which is a local maximum in RNA lifetime at the minimum Mg2+ concentration required for folding. By simulation and experiment, we characterized the RNA Goldilocks zone and its dependence on cleavage parameters and extent of folding. We show experimentally that yeast tRNAPhe can inhabit a Goldilocks zone. The Goldilocks phenomena appears to be robust and is tunable by changes in magnesium affinity, and a variety of other factors. Goldilocks behavior can be more pronounced for RNAs with intermediate folding states. Goldilocks behavior allows ultrafine control of RNA chemical lifetime. A subset of RNAs in vivo are expected to occupy the Goldilocks zone. In evolutionary context, Goldilocks behavior may have shaped RNA in an early Earth environment containing Mg2+ and other metals. RNAs that do not fold cannot access a Goldilocks zone.