It took a Chinese artificial-intelligence tool to protect an American company from an American AI attack.