KABUL — A new network of Special Operations forces will serve as the backbone of a smaller U.S. military mission in Afghanistan, hunting Islamic State fighters as the United States withdraws and providing firepower against the Taliban if a peace agreement with the group crumbles, military officials said.

The network was established as Army Gen. Austin “Scott” Miller, the top U.S. commander in Afghanistan, prepared to shrink the number of U.S. troops last summer while the Trump administration negotiated a U.S. troop withdrawal deal with the Taliban. The idea was to improve coordination between coalition and Afghan forces in a way that would still be possible if the number of U.S. service members shrinks, relying on WhatsApp to share information.

The force is designed to “withstand any change in policy, whatever that may be, or a change in any conditions on the ground,” said a senior U.S. military official, speaking on the condition of anonymity because of the sensitivity of the operations. The force will work with coalition partners, “but the core of it will obviously be U.S.,” the official said.

The network, which has not previously been disclosed to the public, was detailed to The Washington Post as military officials seek to reassure U.S. and Afghan citizens that the United States can still provide security in coming months.

The initial version is expected to withstand any cuts as the U.S. military shrinks from about 12,000 service members to 8,600 over the span of 135 days under the terms of a deal reached with the Taliban on Feb. 29. U.S. officials did not reveal how many people the network includes, but the senior military official said it is built to function with a few thousand U.S. troops in Afghanistan or fewer.

The deal, negotiated for more than a year, calls for the United States to withdraw all its service members within 14 months if the Taliban meets certain requirements, including beginning negotiations with the Afghan government to end the war and ensuring that Afghan soil is not used to plot or carry out attacks against the United States or its allies.

But U.S. officials have described the timeline as “aspirational,” citing concerns about whether the Taliban will follow through on its obligations. The U.S. withdrawal will be “conditions-based,” the officials have said, repeatedly declining to offer specifics.

On Wednesday, the uncertainty was underscored by 43 Taliban attacks and a U.S. airstrike targeting the group in Helmand province, said Army Col. Sonny Leggett, a U.S. military spokesman. The U.S. strike, the first in 11 days anywhere in the country, was carried out in defense of Afghan forces, Leggett said.

Army Gen. Mark A. Milley, the chairman of the Joint Chiefs of Staff, played down the recent attacks in testimony before the Senate Armed Services Committee on Wednesday, saying they occurred at “small, little outposts,” and that cities have not been hit.

The complexities of the counterterrorism arrangement in the deal with the Taliban have not been released to the public, but Defense Secretary Mark T. Esper said Thursday that documents known as “implementing arrangements” address the issue.

As the United States has explored whether its relationship with the Taliban can evolve, it has continued to carry out strikes against the Islamic State. Leggett tweeted Tuesday that U.S. forces had killed 18 Islamic State fighters in Konar province in recent days.

Miller, in an interview last week in his office, said “there will probably be something there” for the U.S. military in Afghanistan as long as the United States believes there are “national interests to safeguard.”

“What I do understand about Afghanistan is there are no straight lines,” Miller said. “You have to understand that you have multiple paths forward, and ideally based on our assessment and judgment, we are taking the correct path.”

Miller, who previously commanded the elite Joint Special Operations Command, directed Maj. Gen. Christopher T. Donahue to design the network. Donahue incorporated lessons learned in Syria, where he oversaw forces fighting the Islamic State, and other operations involving JSOC, U.S. military officials said.

The force includes “regional targeting teams” primarily comprising Special Operations troops in locations where the United States plans to maintain a presence.

At the center of the network is the Combined Situational Awareness Room, or CSAR, on a base in Kabul. Primarily comprising members of Afghanistan’s security forces, it gathers information about Taliban and Islamic State attacks, combines it with other reports, and passes it on for possible action.

On a recent afternoon in the CSAR, Afghan officers monitored video screens and waded through WhatsApp messages on their phones.

“Attention to CSAR!” Afghan officers yelled in English as new reports of Taliban attacks arrived.

An Afghan lieutenant colonel, speaking on the condition of anonymity because of his role, said Afghans typically work 24 hours at a time in the CSAR, and then go home to their families. Most live within driving distance — a major reason the operations center was moved in the past few months from 45 miles north at Bagram Airfield.

“We chose the best officers,” said the Afghan officer directing the CSAR. “Most of them are Western-educated.”

The teams are typically led by an American major or lieutenant colonel and report to the CSAR, which is commanded by Donahue, who leads NATO Special Operations Component Command-Afghanistan.

The network first provided major assistance in June, when it helped stave off Taliban attacks on Afghan forces after Ramadan, the senior U.S. military official said. In the following months, the U.S. military boosted airstrikes, reaching a crescendo of 918 in September, according to Air Force statistics.

The strikes occurred as the network assisted Afghan forces in taking back swaths of northern Afghanistan in Badakhshan, Baghlan, Takhar and Kunduz provinces, the senior military official said. The majority of the operations consisted of Afghan forces maneuvering down a road as airstrikes killed a few dozen Taliban fighters ahead of them.

“It’s not rocket science,” the official said. “It just works.”