Regulating AI for a safe future