A senior public servant told a Social Services official to tone down language indicating the robodebt welfare management scheme wouldn't be lawful before it was introduced.
Andrew Whitecross, from the Social Services department, told the royal commission investigating the scheme it "couldn't be clearer" calculating welfare debts based on an average income would require laws to be changed in 2015.
The scheme, which went from 2015 until 2020, wrongly recovered more than $750 million from 381,000 people, with a number of victims committing suicide while being pursued for false debts.
Mr Whitecross strongly advised against using income averaging in 2015 and said he was surprised to learn the scheme was implemented the following year.
He told the commission he'd had a meeting with Social Services' Cath Halbert and Human Services' Mark Withnell in 2015 where he outlined income averaging wouldn't be legal. He said Mr Withnell was frustrated with the feedback because it could mean a promised $1.2 billion saving wasn't achieved.
Of the saving, Mr Whitecross later added: "It was a sense ... this was a number that had come out of a methodology, but the number itself was a goal of the process".
The commission heard he was told by Ms Halbert that DHS deputy secretary Malisa Golightly "didn't want us to go in so hard" with feedback income averaging was illegal.
Asked by senior counsel assisting the commission Justin Greggery if he had pushed back, Mr Whitecross said he had but she had continued to ask him to change the language.
He said Ms Halbert was concerned with the relationship between the Human and Social Services departments.
Mr Whitecross told the commission he did tone down the language on the brief but tried to maintain his legal concerns.
He wrote the proposal would need "further development" regarding legislation and budget outcomes, which he said should have been a "red flag" to officials.
"That's polite public service speak for 'this isn't a goer unless you can address these problems'," he said.
The commission saw emails from January 2015 where Social Services staff discussed welfare compliance options the then minister Scott Morrison had requested, where they indicated using data matching would need changes to legislation.
An email from Mr Whitecross included that any debt calculated on averaged income "would likely be overturned by a tribunal".
Presented a draft proposal of the scheme by the Human Services department, Social Services staff responded: "Notwithstanding this new information, our primary concerns remain".
The royal commission is investigating how the scheme went ahead despite government departments knowing the debt calculation method was unlawful.
Mr Morrison will give evidence to the commission next Wednesday. His lawyer is applying for him to be able to refer to redacted cabinet documents on Thursday.