If there was ever a moment of clarity over the danger of government overreach in the case of the NSA and its surveillance programs, it came — ironically — from the British government. Taking advantage of a law passed specifically for counterterrorism efforts, the United Kingdom detained the civil-union partner of the journalist at the center of reporting on the NSA scandal, detaining him for all but five minutes of the maximum nine hours allowed without charges. The U.K. eventually released David Miranda without charges, but not without protest from Brazil, where he and Guardian reporter Glenn Greenwald live, and not without a firestorm of criticism over the use of power granted to the government to combat terrorism.

According to Greenwald, his partner was merely traveling through London to get back home, and the U.K. had no reason to suspect that Miranda had anything to do with leaking classified information. Greenwald accused British security officials of retaliating for Greenwald's reporting on the NSA by targeting "the family members and loved ones of journalists," calling the practice "despotic."

Miranda turned out to be more of a player than the first reports of outrage allowed, however. The Guardian paid his travel expenses — a fact they did not immediately acknowledge — as he left filmmaker and Edward Snowden contact Laura Poitras in Berlin, carrying documents on digital media through Heathrow. This, too, the Guardian did not immediately acknowledge. It changes the tenor of the story and explains why British officials might have wanted a look at the data, and at Miranda himself, to see whether any more classified material was being transmitted.

That, however, falls under the heading of espionage, not terrorism. The specific power to detain suspects traveling across U.K. borders for a period of time not to exceed nine hours comes from the Terrorism Act, passed into law in 2000, and its Schedule 7. This statute allows security officials a maximum of nine hours to determine whether a detainee poses a terrorist threat under Section 40(1) of the act without first having a "reasonable suspicion" of a threat, which refers back to a number of activities — but all of which must relate to terrorism.

It doesn't usually take security officials too long to figure out whether someone presents a threat. According to their own three-year study, security officials release 97 percent of detainees within the first hour; only 0.1 percent are held for more than six hours before a determination is made about whether a suspect presents a terrorism threat. According to the Home Office code of practice in application of Schedule 7, "the powers should not be used arbitrarily," but rather "solely for the purpose of ascertaining if the person examined is or has been concerned in the commission, preparation, or instigation of acts of terrorism.... The powers must not be used to stop and question persons for any other purpose."

Miranda spent eight hours and 55 minutes in custody before being released to continue traveling. While British officials had reason to suspect that Miranda may have been engaged in what is arguably espionage, no one seems to buy Miranda as a terrorist threat, and neither does there appear to be any reason to have kept Miranda for more than the length of time it took to confiscate his digital media and laptops.

British politicians voiced outrage over the use of the Terrorism Act to conduct what looks like a vendetta on behalf of the U.S. The chair of Parliament's Home Affairs committee expressed concern over the use of the Terrorism Act to go after suspects of other crimes. "They may have a perfectly reasonable explanation," said MP Keith Vaz, but "if we are going to use the act in this way, for those issues that are not related to terrorism, then at least we need to know." Britain's independent reviewer of counterterrorism efforts, David Alexander, called Miranda's detention "extremely unusual" and promised an investigation.

This highlights the problem that naturally follows from giving government extraordinary power in a nutshell. Parliament passed the Terrorism Act for good reasons; few Western countries have as much painful experience with terrorism as the British, after all, and they needed a way to keep terrorists from infiltrating their country. But power grants that carry little oversight and no effective checks eventually expand in ways unforeseen by those who tried to solve very real problems in the first place. In effect, such grants allow governments to abuse those powers to further their own ends, and those of their allies, which very much appears to be the case with Miranda's detention.

That lesson applies to the NSA, too. The risk of terrorist attack against the U.S. is undeniable, and the vulnerabilities many. The people who work at the NSA are not our enemies, but that doesn't mean the lack of oversight and the breadth of power at their command to intrude on our privacy is healthy, either. Eventually that power will get used in arbitrary ways, in areas that have little to do with national security and more to do with political agendas, even if that time has not yet arrived.

Without effective checks on that power, abuses are inevitable. An internal audit exposed last week showed thousands of violations each year of privacy controls by the NSA. No one outside the agency had even been aware of the audit — not the FISA courts that supposedly oversee the surveillance programs, nor the congressional committees that oversee the NSA itself. The chair of the Senate Select Committee on Intelligence, Dianne Feinstein, first found out about it when reading the Washington Post. How long before that lack of outside scrutiny provides the kind of environment where a more-political NSA goes after critics as well as terrorists? It would be preferable to create effective oversight and accountability now, when the threat is hopefully theoretical, rather than wait until it becomes a reality. At that point, it's too late.