Lithium-metal batteries offer high energy density but are prone to thermal runaway due to reactive lithium and flammable electrolytes. Research now reports a thermoresponsive electrolyte that rapidly solidifies near the separator’s melting point, forming a protective scaffold that prevents short circuits while allowing normal operation.