Senior US officials, fighting to forestall a push to end the bulk collection of Americans' phone data, told a Senate panel they would be "failing" the country if the controversial surveillance practice ceased, and suggested that a congressional move to stop it would not be the final word on the matter.

National Security Agency director Keith Alexander, in an indication of the political crisis roiling his agency, compared the bulk collection on Wednesday to "holding a hornet's nest," but said he did not know how to detect future domestic terrorist attacks without swooping up the phone records of every American.

"There is no other way we know of to connect the dots," Alexander told a nearly empty Senate judiciary committee hearing that was at turns heated, probing and humorous.

But Alexander – along with his colleagues, deputy attorney general James Cole and top intelligence community lawyer Robert Litt – declined to take a firm position on a bill before the committee, sponsored by chairman Patrick Leahy, that would end the bulk collection without a court order.

Although the bill's text and stated intent would be to prevent suspicionless bulk data collection domestically, Cole said that the actual extent of the prohibition would "depend on how the courts interpret it."

It was the first time the NSA or its allies have suggested that its dragnets on American phone data might not be stopped even if Leahy's bill, which supporters claim has 120 co-sponsors in the House and Senate, passes through Congress.

Chuck Grassley, the senior Republican on the committee, who sounded skeptical of Leahy's proposed USA Freedom Act, expressed disappointment that the Obama administration declined to say whether or not Congress should pass it.

"I would hope we would have a firm statement from the administration of whether this legislation is harmful or not," Grassley said. "I think the administration owes that to all of us."

Echoing earlier testimony over the past six months, Alexander, Cole and Litt said they were grappling with how to provide greater transparency to a process of legal oversight that currently occurs in secret. They said that in theory, they supported disclosing how many times Americans' data has ended up in their dragnets, but said they feared tipping off terrorists under surveillance.

"I'm talking about a range," said Senator Al Franken, a Minnesota Democrat who is pushing a seperate legislative measure to compel the disclosure of those estimates. Franken, a former comedian, pantomimed fear at the occasional reference to terrorists who hypothetically lurked nearby, a rare moment of light-heartedness during surveillance testimony.

Alexander testified that the NSA does not necessarily know in all cases when it collects Americans' data, particularly through its data collection overseas. The Guardian reported in June that the NSA has a datamining tool, known as Boundless Informant, that allows the NSA to examine incoming data by country of origin.

"The number isn't that big," Alexander said. "When the American people understand that, they'll know we're doing this right."

The appearance is the last NSA leaders and their allies will likely make before Congress in 2013, a year to be remembered at their Fort Meade headquarters for the disclosures revealed by whistleblower Edward Snowden. For Alexander, it is one of his final appearances on Capitol Hill, as he is slated to retire in the spring.

Yet even as NSA leaders – and President Obama himself – say they recognize that some curbs on their authority are inevitable, Congress will leave surveillance as they found it at the start of the year: without passing any reform legislation aimed at constraining what is perhaps the world's powerful spy agency.

The Senate judiciary committee has yet to pass Leahy's bill, nor have three committees in the House currently considering its legislative companion. Supporters pledge to renew the effort in the new year.

Obama, in an interview last week with MSNBC, said he would propose some restraints on the NSA in January, following the report of a review panel he announced in August. The panel is stocked with former intelligence officials and Obama's political loyalists.

But even as the congressional calendar winds down, the NSA's critics received additional support this week from several technology companies. Microsoft, Google, Yahoo – all participants in NSA's online foreign communications dragnet known as Prism – and others issued an open letter to Obama calling for both additional restraint on surveillance and increased transparency surrounding what the government demands of their customer data.

Ed Black, the president of a tech-industry trade group, the Computer and Communications Industry Associstion, hailed Leahy's bill. "US surveillance policy has been so focused on collecting more data that it failed to collect more input, and [failed] to see how this narrow national security strategy would be not only damaging, but ineffective," Black said. Black said the NSA had "harmed US companies, US competitiveness, and the internet itself."

In his first public comments since the Washington Post reported that the NSA collects location data on mobile devices from cellular towers, Alexander said that it was possible that Americans overseas had their cell phone geolocation information acquired by NSA without the NSA knowing.

"If an American travels overseas and his communcations are collected, the chances are in that collection, we may not know that's been collected [and] that it was an American person, but the chances are that if it was collected, you'd probably get the cell site location with it there. Beecause that's something that's also been collected," Alexander said.

Alexander did not comment on a report Monday from the Guardian, the New York Times and ProPublica that the NSA has put virtual communities and online gaming under surveillance, although Leahy expressed consternation over the practice.

"Just because you can do something, does it really make sense to do it?" Leahy asked, later musing that infamous FBI director J Edgar Hoover would have envied NSA's surveillance capabilities, drawing a sharp rebuttal from Litt, who swore the intelligence community was committed to the law and the constitution.

Alexander, in what is likely to be among his final congressional appearances before he retire, disclosed that he had taken "41 different actions" to better protect information collected by NSA to prevent future Edward Snowdens, describing them as "compartmentalizing and encrypting data" and providing access only to "communities of interest." He also referred to "three cases" currently under NSA review that might result in penalties to employees or contractors related to the Snowden disclosures.