In a scathing ruling released Thursday, a Federal Court judge said the Canadian Security Intelligence Service illegally held on to potentially revealing electronic data about people over a 10-year timeframe.

We break down the ramifications of the major decision and what it means for the future of Canada’s spy agency:

What do we know?

Justice Simon Noel said CSIS held on to metadata that was not directly linked to threats to Canadian security. Keeping the information was a breach of the agency’s duty to inform the courts, the judge ruled, since the information was obtained through judicial warrants.

According to court documents, the information was crunched beginning in 2006 and includes data trails linked to family and friends of people under CSIS surveillance, but who were not under investigation themselves.

What is metadata?

Metadata is information associated with a communication, such as an email address or telephone number. Metadata does not include contents of the correspondence. However, it can reveal a person’s movement, communication patterns or other identifying details.

In this case, it is difficult to pinpoint the exact type of metadata CSIS held because the 126-page ruling was heavily redacted.

You can see it for yourself here.

What has CSIS said?

CSIS director Michel Coulombe said Thursday that the agency has stopped allowing access and analysis of the metadata until it has time to fully assess the judge’s decision. He added that he regrets “the court’s serious concerns with respect to meeting our duty of candour.”

What happens next?

The decision immediately sets new rules on how metadata can be used by CSIS. Only metadata that relates to a specific security threat, investigation, prosecution, national defence or foreign affairs can be kept and used.

The judge also suggested that the federal government should seriously take a fresh look at the CSIS Act of 1984, which he said is "showing its age" thanks to modern technology.

How has the government reacted?

Public Safety Minister Ralph Goodale said the government won’t appeal the decision and said he will follow up with CSIS top brass about the ruling. He added that “Canadians need to have confidence” about all federal departments and agencies.

With files from the Canadian Press