Electrochemical cells based on lithium and sodium metal anodes are considered among the most versatile platforms for high-energy electrical energy storage. Unfortunately, unstable dendritic metal deposition at currents below the diffusion limit lead to premature cell failure by internal short circuits. In a volatile electrolyte, the ohmic heat generated by these shorts pose significant safety risks. The article reports that electrodeposition of metals can be stabilized by confining ion transport to length scales below a few hundred nanometers. It is also shown that dendrite growth can be arrested in electrolytes with mechanical moduli well below that of the metal. This finding contradicts current orthodoxy, which holds that solid-state electrolytes with moduli higher than the metal are required for preventing dendrite growth.