The American Civil Liberties Union suffered major defeats on Friday, when two of its cases involving clear violations of civil rights and civil liberties were dismissed, both undone by the judiciary’s deference to executive-branch secrecy.

A dramatically divided three-judge panel on the U.S. Court of Appeals for the D.C. circuit ruled in favor of Department of Justice lawyers who argued that Amir Meshal couldn’t sue for damages for his alleged torture at the hands of FBI agents in three African countries because it happened overseas and because the litigation would jeopardize “national security.” Meshal is a U.S. citizen who FBI agents suspected had ties to al Qaeda.

And a Maryland district court judge threw out a massive legal challenge to the National Security Agency and its “Upstream” surveillance program on behalf of Wikimedia, Amnesty International USA, The Nation magazine and six other groups, because they couldn’t prove that the NSA had specifically spied on them — despite the troves of publicly available information on how the mass-surveillance program works, primarily from NSA whistleblower Edward Snowden.

In both cases, the ACLU had appealed to the judicial branch for relief from the excesses of the executive branch. But both courts allowed the federal government to escape judicial oversight simply by insisting that national security matters should remain secret.

Meshal v. Chris Higgenbotham, FBI Supervising Special Agent

Amir Meshal, a U.S. citizen and New Jersey resident, traveled to Somalia in 2006 to study its culture and Islamic religious traditions. When he fled the country due to violence, he was apprehended by Kenyan authorities, whom he says passed him off to the FBI, who wanted to investigate him for ties to al Qaeda.

The ACLU filed suit against the FBI agents in November 2009 on behalf of Meshal, who alleges the agents detained him secretly for four months, denying him access to counsel and threatening to kill him or “make [him] disappear.” He lost 80 pounds while detained. He was subsequently released and was never charged with a crime.

The U.S. District Court for the District of Columbia originally concluded his treatment was “appalling,” but dismissed the case because it concluded there was no legal precedent to help him.

The ACLU appealed in 2014, citing the legal precedent of a 1971 case called Bivens v. Six Unknown Named Agents, in which the Supreme Court decided that individuals whose constitutional rights are violated by federal agents can sue for that violation and are entitled to a remedy.

Judge Janice Rogers Brown rejected that precedent, writing in her majority opinion that Meshal’s case was “unprecedented” because it dealt with a terrorism investigation overseas that could not be disclosed. She found a remedy “unavailable.” Brown was joined by her fellow George W. Bush-nominee Brett Kavanaugh.

But in her 29-page dissent, Obama-appointed Judge Cornelia Pillard argued that there was no real reason that Meshal did not qualify for compensation under Bivens, especially because the majority agreed that his allegations of constitutional violation and torture were “quite troubling.”

As for the national security argument for secrecy, Pillard wrote that she was “unpersuaded that adjudicating Meshal’s constitutional damages claim would necessarily pose unacceptable risks.” The government neither explained in any detail why national security would be irreparably harmed if the case went forward, nor sought to present classified evidence to the court.

The ACLU is concerned. “This opinion creates a legal black hole for the incommunicado detention and gross mistreatment of American citizens,” said Jonathan Hafetz, the ACLU-affiliated lawyer representing Meshal. “The line of national security is an amorphous, malleable concept that is frequently subject to manipulation and abuse.”

Pillard called on the rest of the bench to fight more vigorously for individual rights. “Judicial scrutiny becomes particularly important when executive officials assert that individual rights must yield to national security and foreign policy imperatives,” she wrote.

Wikimedia v. NSA

Upstream surveillance, which the NSA says it conducts under the authority of Section 702 of the Foreign Intelligence Surveillance Act, involves vacuuming up Internet and telephone communications traveling along the “backbones” of the Internet in search of foreign data — while “incidentally” grabbing a bunch of domestic material, too.

The agency can then search it, no court approval required, using keywords associated with foreign targets, and send the hits into a widely used law-enforcement database.

The ACLU sued in March 2015 on behalf of human rights, legal, media, and educational organizations arguing that “upstream surveillance,” which most certainly swept up private communications of at least some of the plaintiffs, violated their constitutional rights to freedom of speech and protection from unreasonable search and seizure.

But the district court judge hearing the case accepted the government’s request to dismiss it, because he said the ACLU couldn’t prove that the NSA spied on its individual clients, and therefore didn’t injure them in any way. The court declared that the groups lacked “standing” to sue the government.

The same thing happened in the 2012 Supreme Court case Clapper v. Amnesty, when several organizations including Amnesty International USA challenged the foreign surveillance conducted under the Foreign Intelligence Surveillance Act, but were denied because they couldn’t prove they were negatively affected by the program.

That case was thrown out before Snowden disclosed information about Upstream and other NSA programs in 2013 — including specific details on how they work.

In its new case, the ACLU argued that Snowden’s revelations, referenced in its complaint, changed assumptions. “Since Clapper, the public has learned that the NSA is not surveilling only its targets — it is instead surveilling virtually everyone, looking for information about those targets,” wrote Ashley Gorski, a staff attorney for the ACLU, in a blog post.

The ACLU also maintains that the court misunderstood the publicly available details about the technical architecture of Upstream. The plaintiffs “engage in more than one trillion international Internet communications each year, with individuals in virtually every country on earth,” wrote Gorski.

“Given what we know about upstream surveillance, there’s no question that plaintiffs have been subject to this spying and have standing to sue,” she wrote in an email to The Intercept.

But the court said the ACLU relied on “probabilities and speculation,” because most facts about Upstream surveillance remain classified.

Gorski wrote that the decision “erected an impossibly high hurdle for plaintiffs in civil suits.” Short of receiving an explicit government admission, the court’s reasoning is that “virtually no one subject to secret government surveillance will be able to vindicate her constitutional rights in a public court. It’s a classic catch-22.”

Hina Shamsi, the director of the ACLU’s National Security Project, despaired over the common thread between the two cases. “The Obama administration insistently invokes secrecy and ‘national security’ to prevent courts from hearing constitutional cases on the merits,” she wrote in an email to The Intercept. “In Meshal, it argued that national security considerations precluded a judicial remedy for FBI agents’ flagrantly unlawful detention and coercion of a U.S. citizen. The government has followed a similar playbook in Wikimedia and other surveillance cases, asserting that plaintiffs cannot show that they’ve been subjected to secret spying, and thus the court shouldn’t hear the merits of their claims.”

Caption: 1789 copy of the U.S. Constitution which belonged to George Washington.