"He sent what he thought was worthless information to keep his Chinese contacts interested in him until the CIA would meet with him," the defence lawyers wrote in one court filing.
Prosecutors say that, on the contrary, Mallory's plan was to cash in on his covert knowledge to get himself out of debt.
If he did not share everything he knew, they argue in court filings, it was only because he was holding out for better pay. And if he was somewhat open with old colleagues at the CIA, it was only to cover his tracks.
He "was seeking to develop a long-term, financially profitable relationship," prosecutors John Gibbs and Jennifer Kennedy Gellie said in one motion.
Mallory is one of two former CIA officers accused in Alexandria federal court of working with Chinese intelligence. Jerry Chun Shing Lee, 53, is set to go to trial in February on similar charges. Prosecutors say Lee, like Mallory, was co-opted by Chinese spies when his post-government career was foundering.
Mallory served in the military from 1977 to 2011, on active duty for the first decade and as a reservist after. According to his lawyers, he was kidnapped and seriously wounded while serving in Iraq in 2005.
He also spent years in the intelligence world, working as a covert case officer for the CIA from 1990 to 1996, for the Defence Intelligence Agency from 2007 to 2010, and at various government agencies and defense contractors in between. Since 2012 he has run his own consulting business.
Prosecutors say that business was failing though, and Mallory's only income in 2017 was the US$25,000 he was paid by the Chinese spies.
Court filings say Mallory was contacted by one of those spies through the networking site LinkedIn in February 2017. Richard Yang presented himself as a recruiter for the Shanghai Academy of Social Sciences, a think-tank prosecutors describe as in part a cover for government spies. In March, Mallory went to Shanghai and met Yang and his boss, Michael Yang.
Before that trip, according to court filings, Mallory asked Michael Yang for a mobile phone, saying he might bring information on an SD card. Mallory told Yang to put the phone in a double-sealed envelope, and to initial around the seals before leaving it for him at his hotel. He emailed Yang three documents he had scanned at a FedEx store in Virginia that were not classified but were government documents related to intelligence.
"I will look for a person who has a newspaper under their left arm with keys in their left hand," Mallory wrote, according to the filings. "Please find a private place that we can meet one another for a few minutes."
The Chinese contacts paid Mallory US$10,000 in cash on that trip, according to prosecutors, and for his hotel and flights. Mallory did not declare the cash to customs when he returned.
On another trip the following month, Mallory was given a Samsung phone and paid US$15,000, according to the court filings. In May, he sent two more documents that have been determined to contain classified information. Prosecutors say he even lied to the Chinese and claimed the US$15,000 was seized at the US border, asking them to replace it. He promised to deliver more documents, prosecutors added.
"Your object is to gain information, and my object is to be paid for it," he said in one message, according to court filings.
Yet all along, Mallory was also contacting former contacts at the CIA, and he told them he had been approached by Chinese intelligence.
"I've been over their again, and I keep getting banged on," he wrote in one text message, according to court filings. "In the past I suspected who they are and didn't really know but this time they were even more suspicious with me."
In May 2017, Mallory sat down with a CIA agent, revealing he had met intelligence agents in Shanghai and that he had been given a phone. He said he would meet again and bring the phone to be examined.
The next meeting was two weeks later. Instead of CIA officers, Mallory was met by two FBI agents.
He let the agents copy the phone. But according to his indictment, Mallory was surprised when messages he had sent and received appeared, saying he thought the phone was set up to delete all previous history.
He also lied, prosecutors say, claiming he had given the Chinese only unclassified white papers on policy in exchange for the US$25,000.
From jail, Mallory asked his wife and son in Chinese to look for the SD card he had bought. FBI agents had found it wrapped in foil in a shoe in his closet; eight documents containing classified information were on it, according to court papers, including the two given to the Chinese.
But Mallory said then and argues now that the documents he did hand over were to string the operatives along.
He believed the information he gave "was essentially worthless," his lawyers argue in one filing, while he withheld his knowledge of "several highly classified and sensitive projects that would be of enormous interest and value to the People's Republic of China."
In one document Mallory added false classification markings, according to his lawyers, and another contained "virtually illegible handwritten notes" that were not classified.