Treat the defeated leadership with respect. No matter how just their cause may have been, there is little doubt that many of Libya's rebels fought Qaddafi's forces to avenge past grievances. Such is the nature of revolution against repressive autocrats. Revenge can motivate in war, but it is less valuable when building peace. It is crucially important to allow low-level Qaddafi government officials a chance to develop a private life in the new Libya. After the fall of the Taliban, Afghan government officials and tribesmen who had suffered under the previous regime harassed their erstwhile tormenters, which in turn spurred the Taliban insurgency that rages today. Officials guilty of crimes should be charged, tried, and punished transparently (and in some cases, severely), but other bureaucrats must be allowed to normalize their life. This is not solely a matter of human rights, but of future security as well.
Don't forget about the police. Demobilizing the ad hoc rebel forces who have been waging a fierce guerrilla campaign since February will be difficult, and the natural impulse will be to put the ex-guerrillas into a new Libyan army. This is part of the answer to Libya's inevitable security challenges, but only a part. Stability in the new Libya should be based in civilian security structures, above all reliable police forces. The international community in particular should invest resources into effective policing immediately rather than focusing on traditional military forces.
Again, a look at recent history suggests just how bad the alternatives can be. The Iraqi Interior Ministry became home to terrifying Shiite death squads that meted out awful punishments to Sunnis and were a key ingredient in the sectarian violence that engulfed Iraq in the years immediately following the coalition invasion. In Afghanistan, police units are still weak, and the failure of the judicial sector writ large continues to be a source of instability. Neither the NTC nor their foreign backers should wait five years to make effective policing a priority, as the world did in Iraq and Afghanistan.
Buy back the guns. The fragmented Libyan rebels are rightfully considered freedom fighters, but the risk that a portion of that coalition has links with al Qaeda is real. And there is no doubt that militants of various stripes will converge on Libya to buy weapons for various purposes. The most dangerous of these are the reported stocks of Libyan man-portable surface-to-air missiles, but smaller arms have done damage enough across Africa and beyond.
Staunching the flow of these weapons out of Libya is a Sisyphean task, but one the international community should embrace nonetheless. At a minimum, a program to purchase these weapons from Libyan factions will raise their market price. No doubt some will question the cost of such a program, but in the long run such an effort is a relatively low-cost, high-return investment. If Libyan weapons are used in a terrorist attack in Egypt or to target a Western airliner, we will regret not being more aggressive now.
All of this, of course, is easier said than done -- after all, experts offered similar warnings in the early days after the fall of the Taliban and Saddam Hussein. The key is to identify social and political groups with real power and allow them to negotiate Libya's future in a structured manner rather than impose a vision from abroad or allow narrow domestic factions to monopolize government authority. Minimizing the chance of an insurgency by the disempowered in Libya will be as much art as science. And that, perhaps, is the best lesson for both NTC leaders and their supporters in the international community to take away from Iraq and Afghanistan: Treat the challenges in Libya with humility and respect. Broad principles from other conflicts are useful reminders of potential missteps, but they are not a blueprint for peaceful transition. Qaddafi looks as if he will go the way of Saddam Hussein; the important thing now is to ensure that Libya in 2012 does not go the way of Iraq in 2004.