Civil libertarians and privacy advocates were applauding yesterday after the House of Representatives overwhelmingly passed legislation to stop the National Security Agency from collecting Americans’ phone records. But they’d best not break out the bubbly.

The really big winner here is the NSA. Over at its headquarters in Fort Meade, Maryland, intelligence officials are high-fiving, because they know things could have turned out much worse.

“What no one wants to say out loud is that this is a big win for the NSA, and a huge nothing burger for the privacy community,” said a former senior intelligence official, one of half a dozen who have spoken to The Daily Beast about the phone records program and efforts to change it.

Here’s the dirty little secret that many spooks are loath to utter publicly, but have been admitting in private for the past two years: The program, which was exposed in documents leaked by Edward Snowden in 2013, is more trouble than it’s worth.

“It’s very expensive and very cumbersome,” the former official said. It requires the agency to maintain huge databases of all Americans’ landline phone calls. But it doesn’t contribute many leads on terrorists. It has helped prevent few—if any—attacks. And it’s nowhere near the biggest contributor of information about terrorism that ends up on the desk of the president and other senior decision makers.

If, after the most significant public debate about balancing surveillance and liberty in a generation, this is the program that the NSA has to give up, they’re getting off easy.

The bill that the House passed yesterday, called the USA Freedom Act, doesn’t actually suspend the phone records program. Rather, it requires that phone companies, not the NSA, hold on to the records.

“Good! Let them take them. I’m tired of holding on to this,” a current senior U.S. official told The Daily Beast. It requires teams of lawyers and auditors to ensure that the NSA is complying with Section 215 of the Patriot Act, which authorizes the program, as well as internal regulations on how the records can and can’t be used, he said. The phone records program has become a political lightning rod, the most controversial of all the classified operations that Snowden exposed. If the NSA can still get access to the records but not have to hold on to them itself, all the better, the senior official said.

“It’s a big win for common sense and for the country,” Joel Brenner, the NSA’s former inspector general, told The Daily Beast. “NSA can get to do what it needs to do with a higher level of scrutiny and a little more trouble, but it can do what needs to do. At same time the government is not going to hold the bulk metadata of the American people.”

“The NSA is coming out of this unscathed,” said the former official. If the USA Freedom Act passes the Senate—which is not a foregone conclusion—it’ll be signed by President Obama and create “a more efficient and comprehensive tool” for the NSA. That’s because under the current regime, only the logs of landline calls are kept. But in the future, the NSA would be able to get cell phone records from the companies, too.

“That’s great,” the former official said. “I think no one thought it was in the realm of the possible before this bill.”

And there’s another irony. Before the Snowden leaks, the NSA was already looking for alternatives to storing huge amounts of phone records in the agency’s computers. And one of the ideas officials considered was asking Congress to require phone companies to hang onto that information for several years. The idea died, though, because NSA leaders thought that Congress would never agree, current and former officials have said.

Enter Snowden. Suddenly the NSA found itself under orders from the White House to come up with some alternative to the phone records program that preserved it as a counterterrorism tool, but also put more checks on how the records are used. That’s when General Keith Alexander, then the agency’s director, dusted the old idea off the shelf and promoted it on Capitol Hill.

“The USA Freedom Act”—the supposed reining in of the NSA—“was literally born from Alexander,” the former official said.

So the NSA effectively got what it wanted. But that doesn’t mean privacy activists got nothing, or that they’d count the law’s passage as a loss.

Consider their significant victories. Before Snowden, the NSA was secretly collecting records on hundreds of millions of Americans, a program that some members of Congress didn’t even understand they were voting for when they renewed the Patriot Act, and that an appeals court ruled last week is illegal. Now the world knows what the agency exposed hundreds of millions of innocent people to potential scrutiny.

“These are reforms NSA ultimately was prepared to accept; it’s not as though the agency had been secretly wishing for these changes all along and was finally able to get them only now,” Julian Sanchez, a senior fellow at the Cato Institute, told The Daily Beast. “So it seems a little odd to call it a ‘win’ for them.”

“But,” Sanchez continued, “I’d certainly agree it’s not a loss for NSA in any meaningful way. Indeed, there are some respects in which a shift to the carrier-centric model is likely to give them greater flexibility by allowing them to query on data the FISC order doesn’t permit them to collect.” For instance, billing addresses, which the NSA database doesn’t have now, but that the phone companies could, in principle, provide.

The FISC is the Foreign Intelligence Surveillance Court, which has been secretly authorizing the program for years. Under the new law, the NSA would have to get court approval to query the phone records. That adds another layer of oversight to the intelligence operations, but it doesn’t suspend them. And there’s no guarantee it would curtail them, either. The court has repeatedly found that the phone records program is legal. Presumably it’s not going to stop granting NSA’s requests just because the records now sit in an AT&T database instead of one owned by the U.S. government.

But the NSA is not out of the woods, because surveillance critics don’t see the USA Freedom Act as the last chapter. “The only downside for privacy advocates would be if the passage of this bill were invoked to claim we’ve now accomplished ‘surveillance reform’ and there’s no work left to be done,” Sanchez said.

Now, advocates will turn their sights on another controversial portion of surveillance law, Section 702 of the Foreign Intelligence Surveillance Act. That’s what lets the NSA collect email and other electronic data from big tech companies like Google, Facebook, and Yahoo, including under the so-called Prism program that was the subject of the second big leak from Snowden.

That program does provide the NSA with a huge amount of information. According to intelligence officials, it’s the single largest source of intelligence included in the president’s daily national security briefing. And it also allows the NSA to collect large amounts of global communications as they course through equipment in the United States.

Take those authorities away, and it’d be like putting out one of the NSA’s eyes. Section 702 is slated to sunset in 2017. If members of Congress and privacy activists mount an effort to restrict or repeal those authorities, the NSA will go to the barricades to stop them.

But that’s another day. For now, the NSA is taking its lumps, and thanking its lucky stars.