Investigations of harassment complaints against former ministers should be independent of the Scottish government, a leading QC has said.
Laura Dunlop was tasked with examining the government's procedures after it conceded its handling of complaints against Alex Salmond was "unlawful".
The QC made a range of recommendations about how complaints against serving ministers could be investigated.
But she said probes concerning former ministers should be independent.
Deputy First Minister John Swinney said the government would work on how her recommendations could be implemented.
He said the government was determined that future complaints could be "raised and investigated with confidence", and apologised to the women "let down" by the botched investigation of Mr Salmond.
The Scottish government was taken to court by Mr Salmond in 2018 over its handling of two internal harassment complaints against him.
The government admitted that the way a newly devised complaints process had been applied was "unlawful", because the civil servant who conducted the investigation had had prior contact with both complainers.
Ministers commissioned a review of the process, to be carried out by Ms Dunlop, as well as a parliamentary inquiry into what went wrong and an independent investigation of whether current First Minister Nicola Sturgeon broke the ministerial code in her contact with Mr Salmond.
In her report, Ms Dunlop made a range of recommendations for strengthening the complaints procedure, which has not been used since the botched investigation of Mr Salmond.
Reflecting on why the court case brought by the former first minister was conceded, the QC said that anyone involved in either the investigation or preparation of a report about a complaint "should have had no prior involvement with any aspect of the matter being raised" and no "close association with either party before or during the investigation".
She also said further consideration could be given to respecting the wishes of complainers who did not want the police to be involved, as was the case with the complaints against Mr Salmond - although she said this was a difficult balance to strike.
And she suggested that a process of "censure with consent" could be introduced to allow ministers to accept their conduct had been unacceptable at an early stage in an investigation, something she said was "undoubtedly a helpful mechanism for resolving proceedings" with certain types of complaint.
Ms Dunlop said it was "extremely difficult" to fit the investigation of complaints against former ministers into "any structure connected to the government in power when the allegations came to light".
She said there was a "political context" whether the party in power was the same as that of the former minister or not, and that "the risks of perception of bias, either in favour of or against the person complained about, are obvious".
The QC recommended that any formal complaints against a former minister "should be investigated and adjudicated independently" of government.
She suggested that the Commissioner for Ethical Standards in Public Life or the independent advisors on the ministerial code could be called in to conduct inquiries, rather than have them done in-house.
Permanent Secretary Leslie Evans - the Scottish government's top civil servant, who played a key management role in the investigation of Mr Salmond - previously told MSPs that it would be "unusual in employment policies to have any independent element until after the procedure has been exhausted".
She told the Holyrood inquiry committee that the new complaints system was "predominantly looked at as an employment policy", but said the government would "decide whether an independent element should be injected into the procedure at some point".
Mr Swinney said he welcomed Ms Dunlop's report and its "constructive, forward-looking recommendations".
He said the government would have to work with trade unions on implementation.
"Our shared priority is to have in place policies and procedures that allow any future complaints to be raised and investigated with confidence," he added.
"I would reiterate the Scottish government's apology to the women who had the courage to make the harassment complaints - they were let down, and it is only right to ensure that lessons are learned for the future."
Scottish Conservative leader Douglas Ross said the government had "sneaked out" a report which "lays bare 10 glaring flaws" in how it handled sexual harassment complaints.
He said the government had been "doomed to lose" the case brought by Mr Salmond because of the contact between civil servants and the complainers.
"They must abandon this disastrous procedure and build one that actually works," he added.
Scottish Labour's deputy leader, Jackie Baillie, said the review confirmed that the government's sexual harassment policy was "not fit for purpose".
"Had they taken professional advice beforehand they might have devised a fairer, more effective policy; they could have avoided an expensive and failed judicial review and - vitally - protected the women involved," she said.
The report of the parliamentary inquiry and that of James Hamilton on whether or not Ms Sturgeon broke the ministerial code are also expected to be published in the coming week, before Holyrood breaks up for May's election.