The agreement, reached four months after Pyongyang stunned the world with its first nuclear test, requires the secretive communist state to shut down the reactor at the heart of its nuclear ambitions and to allow international inspections.