U.S. Defense Secretary Pete Hegseth arrives to observe a U.S.-sponsored multinational military exercise in Panama City, Thursday, Aug. 13, 2026 (AP Photo/Matias Delacroix).

The DOJ and Pentagon "surprised" a federal judge multiple times over the course of their defense, leading to a First Amendment win for Anthropic in California.

"The empty invocation of national security is not a blank check to punish and retaliate against government critics," U.S. District Judge Rita Lin stated at the start of her summary judgment ruling, which fell almost entirely in the AI company's favor on Thursday evening.

The judge sided with Anthropic "on all claims, except for the ultra vires separation of powers claim and certain claims concerning Agency Defendants who undisputedly did not take any relevant action or who took only interim measures[.]"

That means Lin found that the Department of War — the agency name in the case's caption — engaged in "unlawful retaliation in violation of the First Amendment, and that Anthropic was denied the pre-deprivation process required under the Fifth Amendment." Further, she ruled that Defense Secretary Pete Hegseth made an "arbitrary and capricious" decision to designate Anthropic a "supply chain risk."

"Though the Department of War is undisputedly free to select the AI vendor of its choice, the evidence demonstrates that the broad measures imposed on Anthropic were illegal and baseless," the order said.

In the earlier stages of the case, the Joe Biden-appointed jurist called out the "Orwellian" way President Donald Trump and Hegseth tried to sever ties with the AI contractor. The president and his Cabinet official separately posted on Feb. 27 that Anthropic was "WOKE" and "sanctimonious" for believing its model Claude could not and should not be used for "autonomous lethal warfare and mass surveillance of Americans."

Anthropic CEO Dario Amodei had made a public statement explaining why he believed the "two exceptions" to Claude's use matter at an "existential" level, and Trump responded by "directing EVERY Federal Agency in the United States Government to IMMEDIATELY CEASE all use of Anthropic's technology."

Hegseth then promptly claimed to issue a "directive" — effective "immediately" — to ban other military contractors from doing business with Anthropic, on top of Trump's executive order permanently banning Anthropic from ever contracting with any agency.

The designation of Anthropic as a "supply-chain risk and threat to national security" came days later.

The first aspect of the case Lin found "surprising" was the DOJ's concession in March that Hegseth's initial "directive" banning other U.S. contractors from doing business with Anthropic had "no legal effect."

"So, why did Secretary Hegseth say this if it has no legal effect and he didn't intend to cause it to happen?" Lin asked, noting he could have just stated he was designating Anthropic as a "supply chain risk."

"I don't know," a DOJ attorney replied.

Late last month, a different DOJ lawyer "surprised" Lin when he could not "give a yes to what seems to [her] to be an easy question" on the First Amendment.

Would it be unconstitutional, the judge asked, if the government "just publicly announced that it is terminating every defense contract with anyone who's ever publicly criticized President Trump?"

The DOJ answered that the hypothetical did not match "this case."

While acknowledging that the executive branch is "certainly owed deference on weighty issues of national security," Lin wrote Thursday that Trump and Hegseth's "contemporaneous words and deeds confirm that the challenged actions were based on a desire to make a public example out of Anthropic for its 'arrogance' in criticizing the government, not based on any articulable basis to believe that Anthropic would actually sabotage its model."

It was not immediately clear whether the Trump administration will appeal. There is a separate Anthropic case already on appeal at the D.C. Circuit.