Emails revealed during Sen. Mike Duffy’s trial are shedding light on what was going on in the Prime Minister’s Office as Stephen Harper’s inner circle attempted to avert an unfolding Senate expense scandal.

Nigel Wright

The latest emails were introduced in an Ottawa courthouse Thursday, as Duffy’s defence lawyer Donald Bayne cross-examined Nigel Wright, Harper’s former chief of staff and a star witness in the criminal trial.

The long chains of damaging emails date between February and May 2013, and include exchanges between Wright, Duffy, other senators, journalists, legal counsel and various key aides in Harper’s office.

At a campaign stop in Regina on Thursday, Harper insisted he was unaware of the secret plan devised by his own staff to bail out Duffy.

But newly released emails suggest a PMO in crisis.

On May 14, 2013, hours before CTV News first broke the story that Nigel Wright paid Duffy’s expense claims, Harper’s then-communications director Andrew MacDougall alerted his inner circle.

Mike Duffy trial

“Heads up,” he wrote of the CTV News report.

Through email, MacDougall said he spoke to Wright and told CTV “I’m neither confirming nor denying any Nigel involvement.”

Mike Duffy trial

Another communications aide, Carl Vallee, asks: “Would the PM know the actual answer to the question? Just in case he asks us.”

Mike Duffy trial

Wright replies: “The PM knows, in broad terms only, that I personally assisted Duffy when I was getting him to agree to repay the expenses.”

Mike Duffy trial

But on Thursday, Harper said he only knew one day later, on May 15 of that year.

“Mr. Wright has been crystal clear: He did not tell me that, he said that in court,” Harper said. “He told me that on May the 15th, when I became aware that in fact, Mr. Duffy had not paid the expenses as I had requested, as Mr. Duffy had claimed he had done.

Mike Duffy trial

“When I found out that was not true, I made it immediately public.”

Emails show the PMO was getting increasingly worried about Duffy’s housing expenses. So Wright asked the prime minister’s legal counsel, Benjamin Perrin, to look at changing the definition of residency rules.

“I am gravely concerned that Sen. Duffy would be considered a resident of Ontario,” Wright writes.

Perrin then floats the idea “of a more flexible alternative … on main question of what the residency qualification means.”

Wright suggests stacking the Senate committee with Conservatives to endorse the changes, saying: “If the committee doesn’t have the right membership, then the Senate by motion should constitute a special committee that will have the right Senators on board. We cannot rely on the Senate Leaders’ office to get this right.”

Two days later, Wright writes: “I think we should lay out the approach in a brief memo to the PM.”

Mike Duffy trial

As the Tory plan began to crumble, it appears Duffy was feeling the pressure.

Duffy writes to the prime minister’s then-principal secretary, Ray Novak: “Ray, I am cooked. I did nothing wrong.”

Mike Duffy trial

Duffy believes the PMO strategy has backfired, and that he’ll take the fall.

“I swing between team player mode and do anything for pmsh (Prime Minister Stephen Harper) and it is time for me to say phack it,” Duffy writes.

It’s still unclear if Wright quit or was fired as the PM’s chief of staff.

Novak, who replaced Wright as chief of staff, was looped in on many of the emails. He is currently in Harper’s inner circle for his re-election campaign.

NDP MP Charlie Angus alleged Thursday that the emails show a pattern of “corruption, collusion” and “cover-up.”

“And it seems that everyone around the prime minister was involved,” Angus said. “Where was the moral compass here?”

With a report by CTV’s Richard Madan