The hacking ability of AI is leading Beijing to see threats in a new light, with its spy agency warning that national security could be in danger.