The US is committed to not allowing either Pakistan or Afghanistan to become a safe haven for terrorists from where they can attack the US and its allies, said the senior Trump administration official.