Staff from the Wellington consultancy SenateSHJ worked in the physical offices of the competition watchdog and were given Commerce Commission email addresses and devices.
With a senior Senate staffer charging himself out at $420 an hour, and junior staff at $195-$230 an hour, the Commerce Commission wracked up a bill of more than $300,000 between July 2020 and September 2022.
The commission spent the money on Senate even though it had 16 of its own communications staff with a salary budget of $1.7 million.
RNZ has obtained thousands of documents outlining Senate's work for the commission on competition issues in the grocery, energy and residential building supplies sectors as well as fair trading and retail payment systems.
"It's completely inappropriate. It's wildly, wildly inappropriate," said Max Rashbrooke, an academic and author who has written extensively on lobbying and democracy.
"If you've got a lobbying firm - whose job it is to get government decisions changed in favour of its clients - embedded right in the heart of government, then I think that's totally inappropriate," he said.
"Current or future Senate clients will have access to all kinds of knowledge about government processes and decision-making processes that should be confidential. The potential for conflicts of interest, I think, are enormous."
The Commerce Commission said that while Senate lobbied for private sector clients, the commission did not pay Senate for lobbying - only for communications and media training.
The documents showed Senate worked on commission projects in the energy sector, despite representing private-sector energy clients.
On its website, Senate said it "helps oil and gas companies, electricity generators, retailers and lines companies" and has "extensive experience working with stakeholders across major energy projects".
Despite that, the commission used Senate for "strategic communication advice" for its review into price regulation and service standards for gas companies First Gas, GasNet, Powerco and Vector.
Senate's work included project management and preparing briefings for ministers as well as communications and media training.
It was told to "return all Commerce Commission documentation, confidential information or other property" or to "securely destroy such documentation or confidential information" if requested.
Senate also worked on a commission project reviewing the lines company Aurora, which is owned by Dunedin City Council and distributes electricity to about 90,000 consumers in Dunedin, Central Otago and Queenstown.
In January 2021, Senate signed a $122,000 contract to provide "specialist communications advice" to the commission for work it was doing to set minimum service standards for Aurora and cap its revenue increases.
The commission also gave Senate confidential details about a case it was taking against a sunscreen company in 2022.
"We, confidentially, have an investigation into a sunscreen manufacturer which will likely come to a close in the next 2-3 months," the commission told Senate.
In August 2022, the commission gave Senate the Statement of Facts (SOF) from the court proceedings.
"This is to be treated with confidentiality but this is the agreed SOF for the Ego case. It's worth having a read to familiarise yourself on the case, investigations," the commission told Senate.
In November 2022, the commission announced that Ego Pharmaceuticals, an Australian skincare company, was fined $280,000 for making unsubstantiated claims about the sun protection factor (SPF) of two products.
The documents also showed a senior Commerce Commission investigator handed over confidential information to Senate in July 2022 about the monitoring of sunscreen companies.
"I have attached the draft internal objective/plan for your information," the investigator wrote. "This is confidential information and only being provided for the purpose of providing the contracted services; it must not be disclosed externally… and needs to be stored securely."
The documents, obtained under the Official Information Act, included a July 2021 email in which Senate assured the competition watchdog it could protect sensitive information.
"The work is undertaken at the commission and from SenateSHJ's offices depending on the confidentiality for each task," Senate said.
"The commission checks with us to see if we do work in a sector and, if so, what type of work and for whom. The commission then determines if it is comfortable for us to proceed. All work is done under the NDA (Non-Disclosure Agreement) provisions, and for work that is very sensitive it is done at the commission."
Senate staff were given Commerce Commission email addresses and laptops.
In one case, a Senate staff member held onto a commission laptop several months after finishing work on a project on regulation of the gas industry.
In an August 2022 email exchange, a senior commission investigator helped a Senate staffer get a Commerce Commission email address.
"Turns out you were already in the system, so the email address will be ready quicker than anticipated," the senior investigator wrote.
He then asked whether the Senate staffer still had a commission device.
"Sorry, I totally forgot I still had a laptop," she responded.
'Unacceptable breach' over role in supermarket competition study
Perhaps the most sensitive project Senate worked on was the study into competition, pricing and profits in the supermarket sector.
Senate was paid about $100,000 to work on the supermarket competition probe between August and November 2021, months before its final release in March 2022.
Senate declared a conflict of interest in relation to the project, but the details of the conflict were redacted in the documents the commission released to RNZ under the OIA.
After the study was released, Senate told the commission it wanted to work with another player in the supermarket sector.
"We've been approached by a company that provides services in the wholesale part of the retail and supermarkets sector," Senate told the commission in a June 2022 email.
"We think there is no conflict with the commission, given the market study has been completed but just wanted to confirm that with you before we proceed."
Senate declined RNZ's request for comment saying, "we don't discuss client work".
"This is an unacceptable breach of the fine line of the private sector versus the public sector. We're in the middle of a cost-of-living crisis, and we have a private sector firm that has a vested interest in protecting its clients' interests."
Edwards said an independent investigation was needed to determine whether the supermarket study had been compromised.
"This is a breach of its high standards that possibly requires a judicial review and it possibly requires a rework of the supermarket study because it is such a substantial breach of protocol," Edwards told RNZ.
"It requires a third-party investigation. It requires international benchmarking as to what international best practice should have been, and inevitably we need to rework the entire supermarket investigation."