Safety issues have been a long-standing obstacle impeding large-scale adoption of next-generation high-energy-density batteries. Materials solutions to battery safety management are limited by slow response and small operating voltage windows. Here we report a fast and reversible thermoresponsive polymer switching material that can be incorporated inside batteries to prevent thermal runaway. This material consists of electrochemically stable graphene-coated spiky nickel nanoparticles mixed in a polymer matrix with a high thermal expansion coefficient. The as-fabricated polymer composite films show high electrical conductivity of up to 50 S cm-1 at room temperature. Importantly, the conductivity decreases within one second by seven to eight orders of magnitude on reaching the transition temperature and spontaneously recovers at room temperature. Batteries with this self-regulating material built in the electrode can rapidly shut down under abnormal conditions such as overheating and shorting, and are able to resume their normal function without performance compromise or detrimental thermal runaway. Our approach offers 103-104 times higher sensitivity to temperature changes than previous switching devices.