Definition
To attempt to prevent a negative outcome after it has already occurred; to take preventative measures too late.
The company only started improving its services after noticing a massive customer churn, which was a case of shutting the stable door after the horse had bolted.
He waited until his house was flooded to buy insurance, which was definitely shutting the barn door after the horse had bolted.
They only started safety inspections after the accident happened; this was completely shutting the stable door after the horse had bolted.