OTTAWA -- Federal lawyers want closed-door hearings in a high-profile court case about allegations of Canadian Security Intelligence Service spying on anti-pipeline activists.

The civil liberties group behind a complaint about the purported CSIS wrongdoing opposes the federal secrecy request, saying it blatantly violates the principle that justice must be seen to be done.

The matter was argued Thursday in an open session of the Federal Court of Canada.

The judge's decision, expected in a month or so, will determine how much the public gets to see and hear when the court looks at the central issue: whether Canada's spy agency overstepped the law in monitoring environmental activists.

The decision could also set a precedent that dictates whether future court challenges of CSIS activities are held openly or in secret.

It all began four years ago when the British Columbia Civil Liberties Association complained to the CSIS watchdog after media reports suggested the spy service and other government agencies considered opposition to the petroleum industry as a threat to national security.

The association's complaint to the Security Intelligence Review Committee also cited reports that CSIS shared information with the National Energy Board about so-called "radicalized environmentalist" groups seeking to participate in the board's hearings on Enbridge's now-defunct Northern Gateway pipeline project.

In addition, the association alleged CSIS passed information to oil companies and held secret conferences with these petroleum industry players at its headquarters.

The complaint cited records, released through the Access to Information Act, that suggested certain organizations were viewed as potential security risks simply because they pushed for environmental protections.

The association argued CSIS's intelligence gathering violated the law governing the spy service, which forbids CSIS from collecting information about Canadians unless there are reasonable grounds to suspect they constitute a threat to national security.

The review committee held closed-door hearings in Vancouver in August 2015. The association called witnesses from environmental and public-interest organizations including LeadNow, ForestEthics Advocacy Association, the Dogwood Initiative and the Sierra Club of British Columbia.

Last year, the review committee rejected the civil liberties association's complaint.

That prompted the rights group to ask the Federal Court to toss out the decision and order the committee to take a fresh look.

Meanwhile, the committee -- citing confidentiality provisions in the law governing CSIS -- placed a sweeping seal of secrecy on evidence it heard in the original probe, including the transcript of the hearing and all documents created or obtained by the committee during its investigation.

In anticipation of the Federal Court review of the committee findings, the government is preparing an unclassified version of the committee's records.

However, government lawyers argue even this version -- stripped of national security information and other privileged details -- should be sealed and excluded from the public Federal Court record. In addition, they want any hearings that mention such details to be held behind closed doors.

In a written submission in advance of Thursday's hearing, the government says the traditional notion that courts should be open is of vital importance to the fair administration of justice, and confidentiality orders are granted only in special circumstances.

However, in this case, "the public interest in confidentiality outweighs the public interest in openness."

In its submission, the civil liberties association says there is no evidence of any risk in making the unclassified materials public, or hearing arguments in open court about the committee's probe of alleged spying.

The open-court principle is fundamental to democracies based on the rule of law, said Paul Champ, lawyer for the civil liberties association and its vice-president.

"When the court hearing deals with allegations of government misconduct, it is more important than ever for the public and the press to be allowed to see and hear what is said," he added.

"One needs to wonder why the hearing needs to be secret if the government's position is that no spying on environmentalists occurred."

If the government motion for confidentiality is successful, then all future court challenges to intelligence review committee decisions will also have to be in secret, Champ said.

"In our view, that would have a detrimental impact on public accountability of CSIS."

In the House of Commons, Prime Minister Justin Trudeau said Thursday he could not comment extensively because the matter is before the court. But he said the government "believes in the rights of all Canadians to protest and communicate their positions in peaceful manners."