A senior public servant says she is ashamed about lacking the courage to speak up against the robodebt scheme despite knowing it was illegal.
The royal commission also heard former prime minister Scott Morrison - then social services minister - may not have been told about legal advice that should have stopped the program from going ahead.
Serena Wilson, former deputy secretary at the Department of Social Services, appeared before the robodebt royal commission on Wednesday.
Robodebt was initiated under the former Liberal-National government and falsely accused welfare recipients of owing money.
Automated debt notices were issued by a process called income averaging, which compared people's reported income with tax office figures.
The commission is investigating how the scheme, which operated between 2015 and 2020, went ahead despite government departments knowing the debt calculation method was unlawful.
Ms Wilson said deliberate, specific and comprehensive legal advice was provided to the Department of Human Services (DHS), now called Services Australia, in 2014 before the program was rolled out.
But she believed this advice was not passed on to Mr Morrison because there was some "role confusion" between the two departments.
She trusted DHS officers to convey the legal advice to the minister, but said in hindsight she should have done more to ensure they did.
"When (the brief) was finally put to Minister Morrison it shows repeated watering down of the quite specific and explicit information that DSS had provided to DHS," she said."
She said her own understanding of the scheme was different to what was actually implemented.
"At the time, I thought we had come to an understanding ... that the essential elements of what became the robodebt scheme, and in particular the income smoothing or averaging, would not go ahead," she said.
"In hindsight, I was clearly wrong."
But when she realised in 2017 that income averaging - an unlawful calculation method - was in fact being used to determine debts, she did not alert anyone.
Ms Wilson said she "lacked courage" and was "consumed with other responsibilities".
"Human services were running and implementing the program and it was a difficult position (for me) to be in," she said.
"Now, I'm ashamed and in hindsight I could have spoken up."
Commission lawyer Justin Greggery put to Ms Wilson that she did not complete her duty as a senior public servant to give full and frank advice to the minister about the policy.
"I didn't feel it was necessary ... I genuinely believed that DHS got it and understood ... what the issues were," she said.
Ms Wilson admitted she should have done more, but as the policy was being overseen by a different department she "felt quite removed" from it.
Commissioner Catherine Holmes pointed out it was a policy that was supposed to recoup $1.7 billion for the government and there were hundreds of thousands of people affected by it.
"How removed could you be when you're the deputy secretary of the department responsible for policy and the way recipients are ultimately treated?," Ms Holmes asked.
Ms Wilson couldn't provide an answer but said it was something she thought about all the time.
"I could have sought more information," she said.
The commission heard Ms Wilson's notebooks that could have contained details of meetings about robodebt were destroyed when she retired.
"They were not official records, they were personal jottings that were mainly lists," she said.
Hundreds of thousands of Australians were sent debt notices under the scheme, which recovered more than $750 million before it stopped operating.
The commission is accepting submissions from people affected until February 2023, with a final report due by mid-April.