In a world of ballooning communications, the agency is sometimes simply overwhelmed. In 2008, the N.S.A.’s Middle East and North Africa group set about updating its Sigint collection capabilities. The “ambitious scrub” of selectors — essentially search terms — cut the number of terms automatically searched from 21,177 to 7,795 and the number of messages added to the agency’s Pinwale database from 850,000 a day to 450,000 a day.

The reduction in volume was treated as a major achievement, opening the way for new collection on Iranian leadership and Saudi and Syrian diplomats, the report said.

And in a note that may comfort computer novices, the N.S.A. Middle East analysts discovered major glitches in their search software: The computer was searching for the names of targets but not their email addresses, a rather fundamental flaw. “Over 500 messages in one week did not come in,” the report said about one target.

Those are daily course corrections. Whether the Snowden disclosures will result in deeper change is uncertain. Joel F. Brenner, the agency’s former inspector general, says much of the criticism is unfair, reflecting a naïveté about the realpolitik of spying. “The agency is being browbeaten for doing too well the things it’s supposed to do,” he said.

But Mr. Brenner added that he believes “technology has outrun policy” at the N.S.A., and that in an era in which spying may well be exposed, “routine targeting of close allies is bad politics and is foolish.”

Another former insider worries less about foreign leaders’ sensitivities than the potential danger the sprawling agency poses at home. William E. Binney, a former senior N.S.A. official who has become an outspoken critic, says he has no problem with spying on foreign targets like Brazil’s president or the German chancellor, Angela Merkel. “That’s pretty much what every government does,” he said. “It’s the foundation of diplomacy.” But Mr. Binney said that without new leadership, new laws and top-to-bottom reform, the agency will represent a threat of “turnkey totalitarianism” — the capability to turn its awesome power, now directed mainly against other countries, on the American public.

“I think it’s already starting to happen,” he said. “That’s what we have to stop.”

Whatever reforms may come, Bobby R. Inman, who weathered his own turbulent period as N.S.A. director from 1977 to 1981, offers his hyper-secret former agency a radical suggestion for right now. “My advice would be to take everything you think Snowden has and get it out yourself,” he said. “It would certainly be a shock to the agency. But bad news doesn’t get better with age. The sooner they get it out and put it behind them, the faster they can begin to rebuild.”