The Australian Tax Office asked that the robodebt scheme "cease and desist" using taxpayer data, but was ignored by the Department of Human Services.
The royal commission into the controversial debt collection scheme was told an ATO officer concerned about the legality of robodebt asked the department to stop using taxpayer information.
"I ask that you cease and desist the usage of the data until we have your assurance around the data use," ATO director Tyson Fawcett wrote in a 2017 email addressed to the DHS.
But the DHS pushed back and insisted the unlawful program carry on.
"There are currently a range of measures the government has asked us to deliver which rely on the data matching capabilities of our organisations and this work needs to continue," DHS representative Ali McRae wrote.
Hundreds of thousands of Australians were caught up in the program which recovered more than $750 million from nearly 400,000 people, many of whom were welfare recipients falsely accused of owing the government money.
Prior to these emails, the ATO did not seek advice on robodebt even though it was legally required to carry out a privacy impact assessment.
When asked why, ATO director Jeremy Hirschhorn said it was not necessary because the office didn't see the joint DHS venture as a new project.
"We view this as a continuation - providing the same data that we had always provided," he said.
"(The ATO) relied on the fact that other agencies are operating on a lawful basis."
Mr Hirschhorn said the ATO would have provided the data to the DHS regardless of whether it was used for "good" or "bad" purposes, though the moral judgment was beyond his expertise.
"But certainly, if we were provided information that it was not being lawfully used, that would be something that we would consider very deeply," he said.
From November 2016, internal ATO communications showed an awareness of issues that later became hallmarks of robodebt: false positive identifications, overestimated incomes and identity matching discrepancies.
When media coverage around robodebt began picking up, the ATO put together a briefing paper that asserted the connection between DHS debt recovery and ATO had been in place for 25 years.
However, in the years before robodebt, that connection was limited by the Data Management Program Act. After 2016, the two agencies sidestepped the DMP for "administrative convenience" and was now acting under voluntary guidelines.
This meant the ATO was not obligated to hand over data to the DHS, but it continued.
"It's not required to, it is now a choice to provide the information," Mr Hirschhorn said.
When ATO representatives asked DHS to "cease and desist" using data, it was too late.
"The information has been provided, (DHS) was in possession of that data. The leverage of holding back data is not there," Mr Hirschhorn said.
The royal commission later heard from ARL Collect and Illion, debt collection agencies used by the federal government during the robodebt period.
ARL Collect's call script contained detailed instructions on what operators should do if those notified of debts made threats of self harm, came from vulnerable backgrounds, or were experiencing hardship.
While ARL Collect representative Robert Whelan insisted these calls were uncommon, he said they happened "more often than I'd like."
The hearing also revealed Illion, previously known as Milton Graham, worked with DHS on commission.
When asked by counsel assisting Salwa Marsh if this arrangement incentivised collectors to recover as much money as fast as possible, Illion representative Christopher Ross agreed.
"Yes, but in a compliant manner," he said.
The inquiry is accepting submissions from people affected by the scheme until February.
A final report is due to be handed down by mid-April.