At the time of Chalabi 's visit , Iran and the United States were engaged in a complicated diplomatic dance ; the American ambassador in Baghdad , Zalmay Khalilzad , had been authorized to open negotiations with the Iranians over their involvement in Iraq .