The Supreme Court of Canada and a senior executive with the Canada Revenue Agency anxiously reached out to Canada's communications spy agency for help after the CBC revealed cellphone tracking technology was being used near Parliament Hill, according to documents.

In April, a months-long CBC News and Radio-Canada investigation revealed that someone was using cellphone spying and tracking technology in the parliamentary precinct.

A day later, Public Safety Minister Ralph Goodale announced the RCMP and CSIS would launch an investigation into who was using the trackers, while saying that it wasn't a Canadian security agency.

The revelation prompted an IT manager from the Supreme Court to request help from the Communications Security Establishment, according to emails released to CBC News through the Access to Information Act.

What kind of assistance was requested from CSE is unclear because that part of the email was redacted.

Questions about BlackBerry Messenger

In a statement to CBC News, a spokesperson for the Supreme Court said the court wanted "to better understand any possible implications of this technology for the court." CSE met with officials from the Supreme Court to explain how the technology worked, Remi Samson said.

A special cellphone purchased by CBC and Radio-Canada was used to detect when an IMSI catcher was trying to intercept it. (CBC)

In another exchange, an IT specialist from the Canada Revenue Agency reached out to CSE with concerns a director general with the agency raised, including "whether or not the BBM Enterprise is protected against the espionage tools found on Parliament Hill yesterday."

The specialist wanted assurances from the spy agency that BlackBerry Messenger (BBM) — an encrypted instant messaging and video app — is protected for all three kinds of messages: voice, text and video. Answers were not included in the email chain.

But in a statement to CBC News, CRA said it "received clarification from CSE that no unknown security vulnerabilities were identified."

In an email to CBC News, CSE said that its IT team provided guidance to both CRA and the Supreme Court, including information about the threats posed by the tracking devices known as IMSI catchers and possible mitigation measures.

How the technology works

IMSI catchers work by mimicking a cellphone tower to interact with nearby phones and read the unique ID associated with the phone — the international mobile subscriber identity, or IMSI.

That number can then be used to track the phone. In some instances, IMSI catchers can be used with other technology to access a phone's text messages and listen in on calls.

IMSI catchers pretend to be a cellphone tower to attract nearby cell signals. When it does it can intercept the unique ID number associated with your phone, the international mobile subscriber identity or IMSI. That number can be used to track your phone. (CBC)

The emails from CSE also provide a window into the reaction to the CBC/Radio-Canada investigation from the highest levels across Canada's security agencies hours after the story went to air.

One chain includes the heads of the RCMP, CSIS, CSE and the National Security Adviser to the prime minister, among others in the Privy Council Office, on how each organization was responding. The emails included media lines being sent out and advice about what the public safety minister and MPs might be asked the following day.

Confusion around role of CSIS

A separate set of emails from Public Safety reveal there was initial confusion about CSIS's role.

Amid concerns about what to communicate, it wasn't initially clear whether a Canadian agency might have been the one doing the spying.

"Can we be categorical on security agencies NOT being involved?" asked Christiane Fox, then the assistant secretary to the cabinet, in an email to representatives from Public Safety, the Privy Council office and CSE.

A director at Public Safety Canada writes back: "I don't know that we can say that categorically."

The locations in black are where CBC/Radio-Canada detected IMSI catchers in Ottawa. The circles show the range the IMSI catchers could cover. (CBC)

Twenty-one minutes after Fox's initial question, he replied again.

"CSIS confirmed they can't be categorical," wrote Ryan Baker.

However, Goodale was categorical when he spoke to reporters the next morning that it was not a Canadian agency that was doing the spying.

CBC News checked in again with the minister's office this week and was told that "while CSIS was unable on the night of April 3rd to confirm specific details on the service's use of this technology, Minister Goodale was provided with updated information from CSIS and the RCMP by the next morning," before the minister spoke to reporters.