Mr. Obama has made “no decisions” on troop levels, said Caitlin M. Hayden, the spokeswoman for the National Security Council. “We will be weighing inputs from our military commanders, as well as the intelligence community, our diplomats and development experts, as we make decisions about our-post 2014 presence in Afghanistan,” she said.

In his State of the Union address on Tuesday night, however, Mr. Obama is expected to say that by the end of this year the Afghan war will be over — at least for Americans — slightly more than 13 years after it began, making it the longest in American history.

Mr. Obama’s hope is to keep 8,000 to 12,000 troops — most of them Americans, some from allies — in Afghanistan after the NATO combat mission ends this year. The resurgence of Al Qaeda’s affiliate in Iraq, combining with insurgents in Syria, has offered a sobering reminder of the consequences of the American decision to withdraw all its troops from Iraq. Mr. Karzai seems to be betting that the damage that a withdrawal would do to American intelligence operations is so great that he may be able to strike a better deal.

Even though the zero option has few supporters in the administration, the idea has gained renewed credence with each day that Mr. Karzai delays signing the security accord and poses new demands to the United States. “Karzai has believed for some time that he has this leverage — that we need him and his bases more than he needs us,” said Daniel Markey, a former State Department official and the author of “No Exit From Pakistan,” published last year.

Secretary of State John Kerry is to meet Pakistan’s foreign and national security policy adviser, Sartaj Aziz, here on Monday, and counterterrorism operations are to be a major subject of discussion, a senior State Department official said Sunday. Talking with Pakistan about its nuclear program is especially delicate.

In recent years the country has accelerated its drive to build small tactical nuclear weapons — similar to what the United States placed in Europe during the Cold War — that could be used to repel an invasion from India. But those weapons are considered more vulnerable to theft or use by a rogue commander, and they are one reason that American intelligence agencies have invested so heavily in monitoring the Pakistani arsenal.

A scare in 2009, when the United States feared that nuclear materials or a weapon was missing in Pakistan, led Mr. Obama to order the basing of a permanent monitoring and search capability in the region.