The role that Pakistan’s intelligence service, the Directorate for Inter-Services Intelligence, played in the bomb making is most likely central to Mr. Laux’s story, but C.I.A. censors have blacked out those sections, along with other large chunks of the narrative, as part of an agency review process required for all books by former C.I.A. employees.

Mr. Laux said he was struck by how little the military seemed to know about Afghanistan after so many years in the country, and that many C.I.A. officers had developed little more insight. Soldiers and spies served short tours of duty — with much of that time spent just becoming familiar with their surroundings — and then turned their jobs over to new arrivals forced to make the same mistakes as their predecessors.

By 2011, Mr. Laux said it became a common refrain among Americans in Afghanistan that the United States had not been in the country for 10 years. “It had been in Afghanistan one year, 10 times,” he said.

Thousands of American troops were patrolling eastern Afghanistan hunting for Taliban fighters, while C.I.A. operatives focused almost exclusively on Al Qaeda. Mr. Laux recalls the confusion this sowed, and the occasionally tragicomic results.

One example was the military’s regular practice of broadcasting on Pashto-language radio stations the names of Taliban fighters they were hunting, offering money for information about their possible whereabouts. Mr. Laux and other C.I.A. officers, not knowing of the military broadcasts, would pay people who approached them with what they claimed was specific information about the same names that had been on the military broadcasts. The information was often bogus.

Mr. Laux and his colleagues, who at first thought it was valuable intelligence about high-level Taliban fighters, eventually realized it was a game that had been going on for years. The Americans were desperate for intelligence, and some Afghans were exploiting that desperation to line their pockets.

Mr. Laux, concerned about reprisals from his former employer, refused to give details about what is in the redacted sections of his book — including a section about collecting information about a Qaeda operative who appears to have been killed by a C.I.A. drone. A source had been tracking the operative, and one day sent Mr. Laux a text message “*73”— the signal that the operative was in a specific location.