Canada’s electronic eavesdropping agency defended itself Wednesday following allegations it spied on Brazil’s energy and mining ministry, saying it follows Canadian law.

Communications Security Establishment Canada’s chief John Foster told an Ottawa tech conference on Wednesday that everything the agency does is reviewed by an independent commissioner.

"He and his office have full access to every record, every system and every staff member to ensure that we follow Canadian laws and respect Canadians' privacy," Foster said.

Wednesday’s event was Foster’s first public appearance since news of the spying allegations first broke.

On Monday, an investigative news program on Brazil’s Globo TV reported that Canadian spies from CSEC had used email and phone metadata to map internal communications within Brazil’s Mines and Energy Ministry through a software program called Olympia.

The report was based on leaked documents first obtained by former U.S. National Security Agency contractor and whistleblower Edward Snowden.

The revelations sparked outraged throughout Brazil and had President Dilma Rousseff demanding answers from Canada.

In wake of the allegations, Prime Minister Stephen Harper said Tuesday he was very concerned about the reports and said Canadian officials are reaching out to their Brazilian counterparts.

National security expert Wesley Wark says if information about Brazil’s energy and mining ministry was collected by CSEC, it was likely for its U.S. counterpart, the NSA.

“I don’t think there’s any reason why Canada, on its own, independently, would go down to Brazil and try and build a collection capability and target a civilian Brazilian department,” Wark told CTV News.

“I’m 100 per cent certain it was never designed for the pockets of private sector companies in Canada,” Wark, a University of Ottawa professor, said.

However, Carleton University international affairs professor Martin Rudner said collecting economic information is common practice.

“Countries engage in economic intelligence collection. All countries, including Canada,” he said.  

Meanwhile, NDP Leader Thomas Mulcair said the spying allegations are “a black eye for Canada.”

Speaking at a news conference Wednesday, Mulcair called the reported attempt to monitor the Brazilian ministry "a huge mistake."

According to the CSEC website, the agency's mandate is to "acquire and use information from the global information infrastructure for the purpose of providing foreign intelligence, in accordance with Government of Canada intelligence priorities."

The agency is a key member of the intelligence-sharing network known as the Five Eyes, which include Canada, the United States, Britain, Australia and New Zealand.

With a report from CTV's Daniele Hamamdjian and files from The Canadian Press