Frederic Wehrey, senior associate in the Middle East Program at the Carnegie Endowment for International Peace and co-author of “Building Libya’s Security Sector.”

In Libya these days, no other concern seems as pressing and dire as basic security. People clamor for formal security institutions to take the place of militias—even those that have been nominally co-opted by the government. Last November, the country witnessed its deadliest day of violence since the 2011 Revolution when militiamen opened fire on protesters in Tripoli. When, in the following weeks, the regular army and police deployed across Tripoli and the militias retreated, the applause was thunderous. In Benghazi, there were similar outpourings of support for the local Special Forces unit and its charismatic commander during clashes with Ansar al-Sharia.

Outside powers are stepping into this vacuum with plans to train and equip a national army. The U.S. Congress was recently notified of a request for the U.S. to train up to 8,000 Libya soldiers for a “general purpose force” (GPF) for a period of eight years. Britain, Turkey, and Italy are also contributing. The project has been in the works since at least last summer and seems sound in theory.

But in conversations in November with Libyans from across the spectrum, numerous challenges and pitfalls became apparent. Many of these pertain to the force’s civilian oversight, actual purpose, and inclusivity. AFRICOM officials tell me the force is meant to protect government institutions and elected officials, to give breathing space for the troubled democracy. After that, they say, it will need to replace the role currently played by the so-called Libya Shields—militia coalitions acting on the authority of the Chief of Staff—to secure the country’s periphery. As a national army, the GPF’s officer corps and enlisted ranks should draw from all of Libya’s regions and tribes.

Islamist leaders in the east told me they agree in principle to foreign training for Libya’s army. But they oppose foreign control: a narrative has taken hold about the United States’ exclusive focus on counter-terrorism in Libya. Some see the force as serving only the interests of the National Forces Alliance or Prime Minister Ali Zeidan himself. For their part, some senior officers in the Libyan army oppose the integration of militiamen, especially Islamists, seeing them as unruly and ideologically tainted. Events in Egypt have had a subtle but discernible ripple effect on civil-military relations in Libya.

All of these tensions will need to be resolved to ensure the success of the new army. Government officials have convened multiple working groups and inter-ministerial committees to address the GPF and its future. U.S. officials and partner nations seem cognizant of the pitfalls. But a parallel effort is needed to overcome deep-seated political distrust and the absence of national reconciliation. Rivalries within ministries, within the General National Congress (GNC), and within the fragile security institutions threaten to derail the project.

Aside from dialogue, Libya needs to address the social, economic and political drivers behind the militias’ persistence. The young men in the militias’ ranks must be given incentives to leave and rejoin society. A sustained program for demobilization, disarmament, and reintegration is essential. A national-level project, the Warriors’ Affairs Commission, is a good start. But much of the actual progress is being made at the local level, at the direction of local councils and respected tribal elders.

Such efforts point to an important truth in post-revolutionary Libya that outside patrons and donors would do well to heed: the specificity of many of Libya’s challenges demand a case-by-case approach, tailored to towns and regions. Relying exclusively on a top-down, overly centralized solution, like the GPF, could well inflame an already tenuous environment.