Getty Images

A new lawsuit in Manhattan pitting the U.S. Department of Justice against Google offers a rare glimpse of how determined prosecutors are to defend a process that allows federal agents to gain warrantless access to user records, and how committed the Mountain View, Calif., company is to defending its customers' privacy rights against what it views as illegal requests.

The Justice Department's lawsuit, filed April 22 and not disclosed until this article, was sparked by Google's decision to rebuff the FBI's legal demands for confidential user data. It centers on the bureau's controversial use of so-called National Security Letters (NSL), a secret electronic data-gathering technique that does not need a judge's approval and recently was declared unconstitutional in an unrelated court case.

U.S. District Judge Richard Sullivan has been assigned the New York case, which has taken place under seal, but as of last week has not made a final ruling. A law clerk for Sullivan did not immediately respond to queries from CNET this morning.

The use of NSLs is controversial because they gag the recipient: If you receive one, it's illegal to tell anyone. They're only supposed to be used in national security investigations, not routine criminal probes, and there's no upper limit on the amount of data a single NSL can demand.

An inspector general's report (PDF) found that the FBI made 50,000 NSL requests in 2006, and 97 percent of those included mandatory gag orders. NSLs can demand user profile information, but the law does not permit them to be used to obtain the text of e-mail messages or most log files. (Even if NSLs are eventually ruled unconstitutional, the FBI would still have a formidable array of investigative tools including subpoenas, court orders, search warrants, wiretap orders, pen registers, sneak and peek warrants, and surveillance under the Foreign Intelligence Surveillance Act.)

Court documents hint that the FBI has become vexed by Google's legal stand.

Immediately after the FBI's New York field office sent an NSL on April 22, the bureau filed a "petition to enforce" in Manhattan federal court on the same day, an abrupt and arguably undiplomatic move that Google says did not give it a chance to either comply or exercise its legal right to seek judicial review.

Because Google already had been challenging NSLs in a lawsuit filed weeks earlier in California, it asked U.S. District Judge Susan Illston in San Francisco to toss out the New York NSL. Illston declined, saying that issue "is more squarely raised" in the New York litigation, but adding that she would revisit the topic if necessary.

Neither the FBI nor Google responded to requests for comment. (The case before Illston is largely under seal, with Google's identity redacted. But, citing initial filings, Bloomberg disclosed last month that it was Google that had initiated the legal challenge.)

Sarah Tew/CNET

Why is Google fighting?

It's not entirely clear why Google has chosen to face off against the Justice Department in court.

"My instinct tells me that Google doesn't pick a fight with the government easily," said Cindy Cohn, legal director of the Electronic Frontier Foundation, which has filed its own lawsuit challenging NSLs on behalf of an unnamed telecommunications company. "There's probably something going on here that's different from a run-of-the-mill NSL."

Google's history shows it prefers to resolve disputes with government agencies amicably. In 2011, rather than litigate, it paid $500 million to settle Justice Department claims relating to Canadian pharmacies. It settled allegations over Safari ad tracking. It settled complaints over Google Buzz. It settled with the Federal Trade Commission over concerns about its business practices and competition. A 2006 case in which Google resisted the Justice Department's request for search logs -- and mostly won -- was a rare exception.

One possibility is that Google has simply concluded that the FBI's demands are illegal. An NSL (PDF) that the FBI sent Nicholas Merrill, who ran a New York-based Internet service provider, asked for "electronic communication transactional records" -- language that would sweep in Internet addresses and e-mail and Web browsing logs -- including "all e-mail header information."

Merrill's NSL, signed by then-FBI national security attorney Marion Bowman, requested more than federal law permitted. The law, 18 USC 2709, says the FBI may use an NSL to obtain only a user's "name, address, length of service, and local and long-distance toll billing records."

Merrill, who founded the Calyx Institute and is raising funds to launch a privacy-protective Internet provider, said:

The FBI has been abusing its power and the letters have sought information to which the FBI was not entitled. Without the gag orders issued on recipients of the letters, it is doubtful that the FBI would have been able to abuse the NSL power the way that it did. So the combination of free reign for FBI to write its own warrants without judicial review, combined with the never-ending gag orders are the ingredients of a perfect storm of abuse potential.

Google effectively put the FBI on notice on March 5 that it would only divulge what the law requires. In a statement on its Web site at the time, the company said that "the FBI can't use NSLs to obtain anything else from Google, such as Gmail content, search queries, YouTube videos, or user IP addresses."

The litigation over NSLs began three weeks later.

Another possibility, said EFF's Cohn, is that Google is "fighting to give notice" to their subscribers. That would mean arguing that the NSL gag orders are unconstitutional, which the Second Circuit Court of Appeals said was the case in a mixed ruling (PDF).

A three-judge panel of the Second Circuit took an odd approach: The judges agreed "that the challenged statutes do not comply with the First Amendment," but went on to rewrite the statute on their own to make it more constitutional. They drafted new requirements, including that FBI officials may levy a gag order only when they claim an "enumerated harm" to an investigation related to international terrorism or intelligence will result.

EFF is hoping to convince the Ninth Circuit to reach a different result, which would be near-guaranteed to result in review by the U.S. Supreme Court. The civil liberties group won a preliminary victory in March, when Judge Illston in San Francisco ruled the gag order "violates the First Amendment."

Illston, who is stepping down from her post in July, noted that "there is no evidence" that the FBI has adopted policies or regulations to comply with the Second Circuit's requirements.

She gave the Obama administration 90 days to appeal to the Ninth Circuit, which it did on May 6.

While the FBI's authority to levy NSL demands predates the Patriot Act, it was that controversial 2001 law that dramatically expanded NSLs by broadening their use beyond espionage-related investigations. The Patriot Act also authorized FBI officials across the country, instead of only in Washington, D.C., to send NSLs.