On Wednesday morning, in the U.S. District Court for the Eastern District of Virginia, Judge T.S. Ellis III presided over opening arguments in the espionage trial of former U.S. intelligence officer Kevin Mallory. Last summer, a grand jury returned an indictment against Mallory for turning over classified information to aid a foreign power in violation of the Espionage Act and lying to the FBI about it.

It’s not every day that an accused spy sees his day in court—such cases rarely go to trial.

Mallory is a 61-year-old former employee of the CIA, DIA, State Department and U.S. Army, who held a top-secret security clearance that terminated at the end of his government service in October 2012. He is fluent in Mandarin and has been stationed in countries including Iraq, China, and Taiwan.

The government’s affidavit in support of its criminal complaint says Mallory told FBI agents in an interview that in February 2017, he had been contacted on social media by two people—one posing as a recruiter, and the other posing as a think-tank employee and prospective client for Mallory’s consulting firm—who he later suspected to be Chinese intelligence officers. Mallory took two trips to China in March and April of 2017, during which he met with the officer posing as a think-tank employee. Mallory allegedly told investigators about those trips in an interview. Upon Mallory’s arrival at Chicago O’Hare International Airport on April 21 while returning from the second trip, he allegedly checked “no” on a customs-declaration form that asked whether he was carrying more than $10,000. Prosecutors claim that, contrary to that representation, Customs and Border Protection found $16,500 in his carry-on bags during a secondary screening. During a customs interview, he told CBP agents that he had met with someone he knew through church and that he did not receive anything from that individual during the trip.

Both the government and defense filings acknowledge that Mallory contacted at least one former coworker at a U.S. government agency (not specified in the criminal complaint but named as the CIA in defense filings) about his contacts with the intelligence officers. According to defense filings, Mallory reached out to his agency contact on Feb. 22, prior to his travels to China or the O’Hare incident, requesting help to get in touch with a specific CIA department. The FBI affidavit alleges that Mallory told agents in an interview the contact occurred in March—and that Mallory said he followed up with one of the CIA employees in April. Further investigation by the bureau confirmed that the follow-up contact occurred after the O’Hare incident.

The government filing alleges that Mallory had a May 12 meeting at CIA in which Mallory told a CIA employee that he believed his contacts in China were intelligence operatives and that the operatives had given Mallory a cell phone. On May 24, Mallory met with the CIA employee again in Ashburn, Va. This time, the employee was accompanied by FBI agents. Mallory agreed to a voluntary interview with the agents, the affidavit alleges, and consented to let the FBI search the cell phone, which he had brought to the meeting. Mallory told the agents that the operatives had encouraged him to seek employment in the U.S. government, which he had already been pursuing prior to meeting with them. Mallory also said the intelligence officer paid him two payments of $10,000 and $15,000 to write two unclassified white papers about U.S. policy.

According to government filing, while showing the FBI agents how to use the cell phone, Mallory voluntarily demonstrated how to switch from “normal” to “secure” messaging mode. He told the agents that the system was designed to delete messaging history, but in fact, some secure messages reamined visible. The government says Mallory “expressed surprise” when those messages appeared after Mallory switched the device to secure mode. The analyst who reviewed the phone for the FBI testified in court that he believes the encrypted communication app crashed, creating an unintentional record of some of Mallory’s communications.

The government alleges that the following exchange took place on May 3:

Operative: I suggest you send all and retype the handwriting. And NO1 is obvious the first page of a complete article, where the else is and why it is black on top and bottom....We will try our best to apply for another sum of amount, as you required. However, I'm not sure it will be the same amount for now and I will try, and for safety, we cannot send u in one time or in a short period altogether, need to figure out a better way. Mallory: The black was to cross out the security classification (TOP SECRET//ORCON//...I had to get it out without the chance of discovery. Unless read in detail, it appeared like a simple note...I have arranged for a USD account in another name. You can send the funds broken into 4 equal payments over 4 consecutive days...When you agree I will send you the bank E.g. instructions. … It was dicey (look it up) when they asked for me by name. If they we looking for me in terms of State Secrets, and found the SD card..., we would not be talking today. I am taking the real risk as you, [PRCS], and higher up bosses know... "When you get the OK to replace the prior payment, then I will send more docs. I will also type my notes. NOTE: In the future, I will destroy all electronic records after you confirm receipt...! Already destroyed the paper records. I cannot keep these around, too dangerous.

Then, on May 5, the following interaction occurred:

Mallory: [Y]our object is to gain information, and my object is to be paid for. Operative: My current object is to make sure your security and try to reimburse you.

Later on May 5, Mallory allegedly wrote: “I can also come In the middle of June I can bring the remainder of the documents I have at that time.” (The government says Mallory told investigators he had no further documents and was merely stringing the operatives along.)

According to a government filing:

Analysis of the device revealed a handwritten index describing eight different documents. Four of the eight documents on this list were found stored on the device.

The government further confirmed that three documents located on the device were government documents that contained classified information. One document was classified top secret and the other two were classified secret.

The Justice Department alleges that Mallory turned over defense information to aid a foreign power in violation of the Espionage Act (18 U.S.C. § 794), then lied to federal investigators about his activities in violation of 18 U.S.C. §1001.

What is unusual about the Mallory case is that it’s actually made it to trial. Typically espionage prosecutions result in a plea deal prior to a courtroom trial. This is, in part, because the U.S. intelligence community does not want to risk compromising sources and methods by producing sensitive information in court or pursuant to Brady obligations. Moreover, the government has an interest in obtaining complete information via a plea agreement in order to conduct a full damage assessment. Meanwhile, by the time cases result in arrests, the government often has substantial evidence against defendants, making the likelihood of an acquittal extremely remote. The cumulative result is that a plea deal is typically in both sides’ best interests.

So that leaves Mallory’s case—where an actual jury is hearing an actual case—as an outlier. Why has it gone to trial?

One possibility is that the government is not particularly concerned about protecting the sources and methods at issue here. Or, because Mallory already disclosed substantial information during his FBI interview, the government may not need his cooperation in order to conduct a damage assessment. But it’s worth noting the government does appear to have released some potentially sensitive information in order to prosecute Mallory. Indeed, the affidavit seems to reveal that the FBI has believed since 2014 that a major Chinese think tank has been penetrated by their intelligence services—and that China may need to fix the faulty encrypted communications technology it uses to communicate with informants.

If the government was unwilling to offer Mallory a deal that substantially ameliorates his situation, the costs of trial in his situation may not be that high. It appears Mallory’s financial situation is somewhat dire, and he is represented by public defenders. If it is the case that he was not able to hire counsel anyway, then the marginal expense of going to trial might be limited. The substantive defense strategy isn’t yet clear, though Mallory’s attorneys have emphasized that their client turned over “essentially worthless” information and that he withheld details about several major programs he knew of that would be of interest to them. Mallory’s goal, they say, was to obtain information about the spies’ operations for the United States.

The government did give a rationale when it announced the charges last June: deterrence. Dana Boente, then the U.S. attorney in eastern Virginia and acting head of the Justice Department’s National Security Division said in a statement that the charges against Mallory “should send a message to anyone who would consider violating the public’s trust and compromising our national security by disclosing classified information.”

Two other high-profile espionage cases are currently pending—those of ex-CIA officer Jerry Chun Shing Lee, who is believed to have compromised the U.S.’s informant networks in China over a decade, and former CIA employee Joshua Adam Schulte, who is suspected of turning over CIA cybertools to WikiLeaks in what became known as the “Vault 7 breach.” Whether those cases also go to trial may demystify whether Mallory’s trial is an anomaly based on the particular facts of the case, or whether federal law enforcement is taking a new approach to spy prosecutions.