Trying to remember exactly how the last heater failed (whether from the overflow pipe or internal leak), but when it did, the heater kept calling for water and dumping it into the basement. Imagine turning on your faucet full blast and letting it keep running overnight, We do not have a sump so our basement was like a bathtub when I came down in the AM. In the mid-winter, so it stayed cold and damp down there for a long while.
The shut-offs use a solenoid connected to a water sensor. Quick google search found these items.
How to Install a Water Heater Shut-off Valve | Video | Water Heaters | This Old House
Hot Water Heater Feed Water Alarm/Shut-Off - Floodmaster