Preventing an AI-related catastrophe