For example, every battery cell could have a built in discharge circuit. Whenever the cell no longer received a signal from the cars computer indicating "the car is healthy" it goes into failsafe mode.
Failsafe mode consists of every cell discharging to zero volts through a PTC resistor to keep a constant temperature of 150 degrees C. That will discharge cells as quickly as possible while avoiding starting a fire.
If the vehicle cooling system is functioning, the whole battery will probably be discharged in 30 mins. If it is not, emergency crews can spray water on the battery and it'll be safe as soon as it's cool. Or they can not spray water and know that it'll stay at a constant (hot) temperature, but that thermal runaway isn't possible due to the PTC heating.