Hours before US Defence Secretary Donald Rumsfeld was to arrive in Afghanistan, the Afghan government said it had foiled a Taliban attack near the Pakistani border.