AI ‘hallucinations’ can lead to catastrophic mistakes, but a new approach makes automated decisions more reliable