Libya's NTC prime minister, Mahmoud Jibril, has come under fire over his former allegiance to the Gaddafi regime. Photograph: Li Muzi/Xinhua Press/Corbis

The most contentious popular debate in post-Gaddafi Libya concerns the role that former regime officials and government bureaucrats should be allowed to play in public life. As the last resistance crumbles in Sirte, successfully resolving this issue is key to social harmony and economic viability.

The debate has echoes of Iraq in 2003 when Paul Bremer, US pro-consul at the time, began a process aimed at removing all former members of Saddam Hussein's Ba'ath party from public life – particularly from the military, schools, the oil ministry and the civil service. Most experts agree that Bremer's broad and rigorous implementation of "de-Ba'athification" was the worst decision taken by the Bush administration in Iraq. It significantly hindered rebuilding of the economy while simultaneously fuelling sectarian grievances.

Although Libya under the Colonel had no government party equivalent to the Ba'ath, Gaddafi's ideology and cronies nonetheless infused the governance apparatus, determining its structure and functions. The most crucial difference with post-Saddam Iraq is that Libyans rather than foreign occupiers will decide how far they wish to purge society of anyone connected with the previous regime.

Currently, this issue divides Libyans along class, regional, tribal and educational lines. Fighters and the previously disfranchised – such as the young, unemployed and minorities – tend to advocate a high degree of "de-Ba'athification" whereas the wealthy, the highly educated and tribes favoured by Gaddafi prefer less extensive purging.

On a recent visit to Mellitah Oil and Gas Company in Tripoli, we learned that some members of the management had been unceremoniously ejected by the employees. Additionally, verbal clashes occurred at meetings of the Tripoli Chamber of Commerce and Libyan Businessmen's Council as the new guard accused the old guard of being opportunists who switched allegiance to the rebels for personal gain.

A similar tactic has been employed by populist politicians and militiamen to whip up fervour against the NTC prime minister, Mahmoud Jibril, who served as head of the Economic Development Board under Gaddafi. An equally controversial example is Abdulrahman Shalgham, Libya's UN representative.

Like Jibril, he was a high-profile member of the old regime who defected in the early days of the revolution and was instrumental in its success. Should he now be rewarded with a high-profile political position? Or ejected as a member of the "old guard" even if no gross personal corruption can be proven?

"Old guard" is a broad term that is fuzzy around the edges. The easiest cases to define are former Gaddafi officials with blood on their hands or billions in foreign bank accounts. They must be tried and punished by the new Libyan state and held under house arrest until the court system is ready to process them – even if that is in 18 months' time after democratic elections.

A more nebulous category is those who have committed minor white-collar crimes, including some in the private sector whose businesses aided and abetted the ruling class in enriching itself.

A far larger category is state employees, many of whom are tainted in varying degrees. This last category is so broad that ejecting perpetrators of minor offences or those who simply turned a blind eye to others' corruption would decimate the ranks of the bureaucracy.

Hardline advocates of de-Ba'athification argue that many Libyans refused to taint themselves, even at great personal financial loss. They, therefore, contend that those who remained lily-white should be given priority in political and administrative positions – even if they lack expertise or experience.

A fringe position argues that all high-level officials should be ejected because they were intrinsically complicit in Gaddafi's regime. To become a high-ranking government official one had to figure out how to succeed within a system predicated on a peculiar mixture of socialist and libertarian ideology, rampant institutionalised corruption and brutal thuggery.

Therefore, according to this view all high-ranking Libyan officials were intrinsically self-serving hypocrites. Although emotionally appealing, this policy would be disastrous for Libya. Officials should only be punished if gross sins of commission can be demonstrated. Moreover, it seems only just to give all those who erred in the past a chance to apologise, seek forgiveness, and mend their ways.

Only a Libyan version of South Africa's Truth and Reconciliation Commission can establish a culture of the rule of law and avert haphazard revenge-taking and a wave of workers' strikes, like last week's at the National Oil Company. Such a commission should begin work immediately, so that anger and suspicion does not fester while Libyans wait 18 months for a constitutionally elected government.

If the NTC inaugurated local and national tribunals imbued with President Mustafa Abdel Jalil's spirit of compassion and even-handedness, perpetrators of corruption could openly come forward admitting their crimes and seeking forgiveness. Also, those who accuse their bosses and neighbours could present their case to the tribunals rather than engaging in vigilantism, as happened in Iraq.

This process would promote discovery of the gross corruption that underlies many of the old regime's foreign business dealings without causing a witchhunt or jeopardising those existing contracts – many with US and UK firms – that are actually corruption-free. Additionally, it would facilitate the work of the investigative panel recently tasked by the finance minister, Ali Tarhouni, to review past contracts.

Without a truth and reconciliation commission, flagrantly guilty parties are likely to use their power and money to evade discovery, while others who committed relatively minor offences (or no provable offences at all) may be ostracised from public life.

In short, such a commission, if well designed and properly implemented, could be the first crucial step to closing the open wounds of the Gaddafi period and focusing Libyans on moving forward with shared purpose.