Defense lawyers representing a Navy SEAL who has been charged with several war crimes— including the 2017 slaying of an Islamic State prisoner—allege in a Monday court filing that they were being spied on by federal prosecutors.

In the new motion filed in San Diego court, Special Operations Chief Edward Gallagher’s legal team accuses military prosecutors of secretly embedding tracking software in emails sent to defense lawyers and a reporter in order to determine who was leaking information to the press. The defense lawyers argue that the tracking software may have violated constitutional protections against illegal searches and their client’s right to a lawyer.

“It’s complete insanity,” his lawyer, Timothy Parlatore, said Monday of the encrypted email, which was sent to 13 lawyers and a Navy Times reporter last Wednesday. “I was stunned to see the messages, especially since the government may be behind the leaking.”

Gallagher, who has pleaded not guilty to all charges, is accused of fatally stabbing an injured teenage militant in Iraq before his platoon commander and holding a reenlistment ceremony next to the body. The veteran, who’s served in eight overseas deployments, is also under investigation for the shooting death of a civilian in Afghanistan in 2010, according to a document leaked last month to The New York Times.

Parlatore alleges that he immediately noticed the tracking software by an unusual, non-official logo beneath the signature of one of the prosecutors, Cmt. Christopher Czaplak. The logo was an American flag with a bald eagle perched on a scale of justice, he said. Believing Czaplak had been hacked, Parlatore said he contacted the prosecutor about the suspicious logo, who said he would “check on it.”

“I wanted to make sure his system wasn’t compromised,” Parlatore said. “I didn’t think the government would be tracking defense lawyer’s emails.”

After days of pushing for information, prosecutors finally acknowledged in a closed-door meeting with a judge that the email was sent “as part of an investigation” but declined to elaborate or explain, Parlatore claimed.

According to the motion, lawyers for Gallagher and his platoon commander, Lt. Jacob Portier, are now asking a military judge to order prosecutors to turn over whatever information they’ve gathered. Portier has been charged with conduct unbecoming an officer for allegedly performing the 2017 reenlistment ceremony.

“The fact that prosecutors have embedded their emails with devices designed to monitor defense communications at least implicates the Fourth and Sixth Amendment rights of Lt. Portier, and also impacts Air Force defense operations in the entire Western Circuit,” Air Force Lt. Col. Nicholas McCue, one of Portier’s lawyers, wrote in the motion, adding the information is an intrusion of attorney-client privilege.

Czaplak declined to comment on the allegations in the motions on Monday.