With President Xi Jinping of China beside him at a news conference in the White House Rose Garden last month, President Obama said the two had come to an agreement that China and the United States would refrain from cyberattacks aimed at pilfering company intellectual property or trade secrets for commercial advantage.