Error-correction for AI safety