If you're outraged by the Internal Revenue Service's invasive questioning and harassment of Tea Party groups, why wouldn't you be worried about the National Security Agency surreptitiously collecting bulk internet, email and phone data on millions of Americans? Aren't both episodes examples of a government that's out of control?

Not so fast, say some on the right. The NSA activity is less alarming, Professor Richard Epstein argued recently, because, among other things, "the military community" of which the agency is a part, "internalizes the norms against abuse in ways in which other government agencies do not."

And Jed Babbin insists in the American Spectator that "the NSA Isn't the IRS," and indeed the intelligence community is "a whole lot more trustworthy than most of the rest of our government."

At National Review Online, David French stresses "the limitations of the NSA/IRS comparison," which ignores that "national defense is a core, constitutional function of government."

True, as the writer Jim Henley once put it, national security is "a legitimate function of the state," but "it is still the state when it does this." Its various bureaucracies will be tempted to conflate their own interests with the common good, and, if history is any guide, its programs will be susceptible to mission creep and political abuse.

Mark Ambinder and D.B. Grady lay out much of that history in their new book Deep State: Inside the Government Secrecy Industry. One of the most arresting sections covers Project SHAMROCK, the NSA program that collected the content of virtually all cable traffic entering or leaving the United States from 1945 to 1975, and which "at its height would collect 150,000 messages a month, illegally."

Using SHAMROCK, the NSA "acted as an information broker to the FBI and CIA" -- which the agency referred to as its "customers." Watchlists of potential subversives "eventually became blanket requests," expanding to track Americans suspected of drug trafficking, as well as Vietnam War opponents, including such dangerous characters as folksinger Joan Baez and peace-activist pediatrician Dr. Benjamin Spock.

Ambinder and Grady quote former NSA official Frank Raven: "When J. Edgar Hoover gives you a requirement for complete surveillance of all Quakers in the United States, and when Richard Nixon is a Quaker and he's president of the United States, it gets pretty funny."

Deep State also recounts how the NSA "covered up its role in mistakenly reporting that two U.S ships had been attacked" in the Gulf of Tonkin in August 1964, helping to get us embroiled in what, until Afghanistan, was America's longest war. President Lyndon Johnson authorized airstrikes in response to the false intelligence and exploited it to sell Congress on the Gulf of Tonkin Resolution authorizing the Vietnam military commitment.

Though NSA officials discovered the mistake fairly quickly, the agency stuck to "a lie perpetrated by secrecy" for four decades. In 2005, Freedom of Information Act requests and pressure from the press finally forced the release of classified documents on the Tonkin incident.

The NSA resisted almost until the end, fearing, as one intelligence official told the New York Times, their release "might prompt uncomfortable comparisons with the flawed intelligence used to justify the war in Iraq."

If, as Babbin suggests, the U.S. intelligence community is "a whole lot more trustworthy than the rest of the government," one wonders just when that miraculous transformation happened.

Still, in one sense, Epstein, Babbin, and French are right -- the NSA and the IRS are different. Among other things, the IRS can't shield itself behind a veil of state secrecy, and its functionaries might actually pay a price for lying to Congress. But these are hardly differences that inspire trust.