The Scottish Government has joined an international alliance on artificial intelligence, cybersecurity and space after calls to address the dangers of new technology.