Libya¿s transition is behind schedule, and the absence of shared values and political rules of engagement aggravates insecurity.
Lawless Libya needs to build new, democratic institutions
Every time a bomb goes off in Libya, it restarts an old debate: which should come first, security or democracy?
The answer must be that democracy precedes all other imperatives.
Before the Arab revolutions, the Arab world put security first, with results we know. So it makes no sense to revert to the security-first approach now.
North Africa has embraced change - however slowly - so new ideas and new ethics are called for. Security will mean something different from what it meant before.
The Arab Spring was a demand, by rebellious Egyptians, Tunisians, Libyans and others, for the freedom and dignity that democratic values can protect. But for Libya the next step, the building of open institutions and solid, just legal foundations for the state, is proving to be challenging.
The collapse of the security state and the absence of new institutions have created in Libya a vacuum, allowing other identities - based on extremism, sectarianism, tribalism or warlordism - to claim the loyalty of restless young men.
Security advocates, feeling validated by the resulting tumult, demand maximum vigilance and strong measures to contain "threats" to western interests.
Other Libyans worry for democracy: the return of the security state does not bode well for democratisation. Neither does the militarisation of much of Libyan society.
Libyans distinguish between "genuine" and "fake" revolutionaries. The fakes are criminals and detainees unleashed by Muammar Qaddafi as he tried to hold power. Many of these people, with their weapons and their ruthless dispositions, have simply, ominously vanished into society.
Many "genuine" revolutionaries, in contrast, were members of militias. Some still are, although nobody knows how many militias or militiamen Libya contains.
Some of these men have been integrated into the police - 140,000 strong - and to a lesser extent the army. But training is poor and little has been done to make the police civilian and professional, as befits a democracy.
In Qaddafi's day, coercion was the norm but the government had a monopoly on it. Now, the use of force is informal and diffuse; the militias that were supposedly integrated into the security forces generally owe no loyalty whatsoever to the centre or the whole society.
Recent news headlines say it all: an aborted attempt to blockade Tripoli; clashes in the Warshfana area; fighting in Sabha pitting the Awlad Sulayman tribe against the army. And, significantly, there was also a car bomb in Tripoli, injuring two French embassy guards.
That bomb demonstrated the international dimension of Libya's crisis - and the weakness of what is supposedly the national government.
France played a major role in the Nato air campaign to protect Benghazi-based rebels from Gaddafi's forces. That success may have emboldened the French to intervene against conquering Islamist forces in Mali, in the first days of this year. If so, it is ironic that weapons from Libya, which the French helped liberate, ended up in the hands of those insurgents in Mali, creating that problem for Paris.
And when France sent troops to roll back the Islamists there, she set herself up for further trouble in North Africa. Al Qaeda in the Maghreb (AQIM) threatened to attack France, and then came last week's embassy bombing. The French are learning that there is no intervention without cost.
The terrorists who attacked a natural gas plant in Algeria, near the Libyan and Malian borders, in January had one main demand: a French withdrawal from Mali. The signs were there, so why didn't Libya take measures to protect the French embassy?
The answer may lie in the incapacity of the Libyan authorities. The embassy attack was a signal of AQIM opposition to French and western intervention in Mali, obviously, but it also underscores the extent to which Libya is imploding, unable to provide security for foreigners, its own politicians, or anyone else.
The list of problems is imposing.
The lack of a transitional justice process is one: more than 30,000 Libyans were killed in Qaddafi's fall, but there is no process to address this.
The government, such as it is, has only limited capacity in southern and western Libya. Weapons are everywhere and arms flow freely to neighbouring countries.
Further, the security forces and militias are divided, and drenched in ideology. The secularist-Islamist split, so noticeable in the interim parliament, is reflected in clashes between militias.
Some militias easily intimidate the supposed government, as when gunmen forced adoption of an ill-advised law banning Qadaffi-era officials from public posts in the new era. This law threatens to derail the whole government-building process, not only as a bad precedent for how to get the law you want, but because it will outlaw many capable administrators.
With all that going on, how do you start building democracy?
Libya's transition is behind schedule, and the absence of shared values and political rules of engagement aggravates insecurity.
Political reconstruction can only improve public security. Indeed lawlessness and the democratic deficiency can be seen as parts of the same problem. But that does not mean that "policing" must precede democracy.
In the long run, real security for Libya demands economic progress, human rights, justice, and opportunity. Security problems will fester in the absence of shared values, equal opportunities, regional development, inclusiveness and distribution of power and wealth. Real security demands trust among citizens, and between them and the state. Democratisation can create security, not the other way around.
Dr Larbi Sadiki is a senior lecturer in Middle East politics at the University of Exeter in the UK, and author of Arab Democratisation: Elections without Democracy