FBI Director nominee James Comey is sworn in on Capitol Hill in Washington on Tuesday prior to testifying before the Senate Judiciary Committee.

WASHINGTON — The Obama administration’s nominee to become the next FBI director, James Comey, told members of Congress on Tuesday that federal judges who oversee government intelligence programs are “anything but a rubber stamp.” But Comey also agreed to work with legislators to improve the laws governing surveillance activities.

Comey said he wasn’t familiar with the details of the government’s phone and Internet surveillance programs that recently became public, but he said that collecting that type of information can be “a valuable tool in counterterrorism.”

“Folks don’t understand that the FBI operates under a wide variety of constraints,” Comey told the Senate Judiciary Committee, which is considering his nomination for FBI director. He added that when critics discount the oversight of federal judges and call them a rubber stamp, it “shows you don’t have experience before them.”

Committee Chairman Sen. Patrick Leahy, D-Vt., said the expansive scope of the surveillance programs raises the question of “when is enough enough?”

“Just because we have the ability to collect huge amounts of data doesn’t mean that we should be doing so,” Leahy said.

The senator asked Comey if he would be willing to work with legislators “to enact some common sense improvements to our surveillance laws,” and Comey agreed to do that if confirmed as FBI director.

In the aftermath of the uproar over NSA spying, Leahy has introduced legislation that would improve privacy protections and strengthen oversight and transparency provisions in U.S. surveillance programs.

Comey stepped carefully when asked what positions he would take as FBI director.

Sen. Charles Schumer, D-N.Y., asked Comey whether he would be willing to support declassifying or releasing declassified summaries of rulings by the Foreign Intelligence Surveillance Court.

“Senator, I agree with you that transparency is a critical value, especially when weighing tradeoffs between security and liberty,” said Comey. “I think it is a worthy exercise to look closely at it.”

Comey spent 15 years as a federal prosecutor before serving in the George W. Bush administration, where he is best known for facing down the White House over a warrantless surveillance program. The White House made changes in the program when Comey and current FBI Director Robert Mueller threatened to resign.

Comey got a warm reception from the both Democrats and Republicans on the committee, who repeatedly referred to his independence in standing up to the Bush White House.

Civil liberties groups have nonetheless expressed concerns that Comey signed off on abusive CIA interrogation techniques for terrorist suspects during the Bush administration, when he was the Justice Department’s No. 2 official.

Comey told the committee that he argued strongly within the Justice Department against the interrogation techniques, telling the attorney general that “this is wrong, this is awful” and insisting that his arguments be presented to the White House. But his objections were overruled.

Leahy said he was concerned that while Comey was deputy attorney general under Bush, he approved a legal memo that authorized use of waterboarding “and other techniques long recognized as torture under both domestic and international law.”

Comey explained that he regarded one Justice Department memo that said waterboarding would not violate federal law on torture as “a serious and reasonable opinion” about individual interrogation techniques.

Comey said he fought a subsequent legal memo that allowed a combination of harsh techniques to be used by CIA interrogators.

The second memo “was terrible. I thought it was irresponsible both as a policy matter and as a legal matter, and so I objected to it and took that directly to the attorney general and made my case that that was wrong. He disagreed with me and overruled me.”

After leaving the Justice Department, where he served as the agency’s No. 2 official, Comey was senior vice president and general counsel at defense contractor Lockheed Martin. He later became general counsel at hedge fund Bridgewater Associates. His financial assets include $5.2 million in securities and a home in Westport, Conn., valued at $3 million, according to financial statements filed with the Senate.