A Bayesian approach to breaking things: efficiently predicting and repairing failure modes via sampling