Regardless the final composition of the next Iraqi coalition government, NATO will have to interact with an executive part interested in maintaining the militias, their base of power. As a matter of fact, Security Sector Reform (SSR) in Iraq may appear as a national issue, but in reality the structure of Iraq's armed forces has implications for the whole region, including the Mediterranean, which is the "Southern", and in some cases also the "Eastern" flank of NATO.
First, the armed Shi'a militias that proliferated in Iraq, since 2003 on, operate not only in Iraq, but also in Syria, and share organizational linkages with the Hezbollah in Lebanon.
Second, the Syrian-Kurdish People's Protection Units (YPG), an affiliate of the Turkish Kurdistan Worker's Party, the PKK, also operate in Iraq.
Third, the demobilization of the Ba'athist-era military after 2003 pushed unemployed officers towards ISIS, a group whose fortunes turned around as a result of the Syrian civil war, which indirectly favored the conquest of Mosul in 2014.
Finally, all these actors operate in Syria, a state that borders the Mediterranean, and along the Turkish frontier, a member of the Atlantic Alliance. NATO can play a role in shaping the post-conflict scenario with Baghdad: but in order to understand how it could do it, it is necessary to analyze the structures of the military and violent sub-state actors in Iraq.
Security experts have often quoted Max Weber to highlight the weakness of the Iraqi state as it lacks a monopoly on violence. However, applying Weberian categories to the Middle East may prove to be a futile exercise in the post-2011 environment. Instead of the traditional pattern of states with national armies fighting each other, new types of actors emerged, as in the case of quasi-states with non-conventional militaries, combatting one another: the Iraqi militias warring against ISIS are indicative of a "duopoly of violence" trend. In this scheme, national militaries have either collapsed or they exist in a weakened shape, while being supplanted by militias: parallel militarism will persist in the future as a regional dynamic.
Iraq's armed forces are divided in those controlled by the Iraqi state and sub-state actors. Due to the ISIS offensive in Mosul (June 2014), the widely corrupted Iraqi Security Forces (ISF) collapsed.  Even before the ISIS invasion, the ISF was not deployed in the Kurdistan Regional Government of Iraq: KRG had its own security forces, built upon the militias of the two dominant Kurdish parties, the Kurdistan Democratic Party (KDP) and the Patriotic Union of Kurdistan (PUK), collectively referred in Kurdish as the peshmerga, or "those who face death".
Thus, Iraq's duopoly of violence was "official" before 2014. The division between the military and the peshmerga forces was already institutionalized, while Shi'a militias operated informally before Grand Ayatollah Ali Al-Sistani's fatwa (religious decree) for their mobilization, in the summer of 2014.
Iraq's military must continue on the reform path, institutionalizing the best practices of SSR to develop a professionalized ethos, in order to become an inclusive and national institution.
As demonstrated in the past, units of the ISF can be reformed. Before 2014, the Counter-Terrorism Force, known also as the "Golden Division", was beset with problems, derogatorily referred to as the former prime minister Nuri al-Maliki’s "private army."  Since 2014, the force has reformed itself with the help of a US training mission, and bore the brunt of most of urban combats in cities as Falluja, Ramadi and Mosul, emerging as one of the few professional, inclusive Iraqi military institutions.
The Arab Sunni community, traumatized by both ISIS rule and the past behavior of ISF, have begun to reconcile itself with the army, which represents the Iraqi state and nation. Polling conducted in March 2018, before the parliamentary elections, indicated that the Iraqi military enjoyed an 80% of approval rating, the highest of a national institution, an indicator that the military was able to reinvent itself after the defeat of ISIS. 
In 2014, Shi'a militias reached a number between 60,000 and 120,000 fighters, while the Iraqi military, after the fall of Mosul, dwindled to only 50,000 reliable forces.  The militias supplemented, if not supplanted the regular military: they were subsumed under the government banner, al-Hashd al-Sha’bi or the Popular Mobilization Units (PMU), an umbrella institution that sought to coordinate the wide array of para-military groups.
The PMU has been referred to by policy makers as "pro-Iranian Shi'a militias", but this label is misleading, as it masks the complexity within the organization. While they served as proxies of the Islamic Republic of Iran, they also attempted to carve out their own agency and often pursued agendas independently of Tehran's will.
Iraq's security will depend on how these militias will be integrated in the national political landscape. On November 2017, the Iraqi state developed a legal framework to formally integrate the militias into the armed forces with civilian, government oversight. But the government did ostensibly little to control the de-facto autonomy enjoyed by these forces:  there are still many Shi'a militias, around thirty and some continue to fight also in Syria, while other leaders sought to increase their power through the political process, by running in May 2018 elections.
The electoral outcome is really a headache for NATO. The Shia cleric Muqtada al-Sadr's coalition, al-Sairoun (The Marchers) won, running on his platform of non-sectarianism and fight against corruption. His victory is the example of a militia leader (Sadr guided the disbanded Mahdi Army), who was able to demobilize and engage in cross-sectarian politics. The Hadi al-Amiri's Fatah (Conquest) coalition arrived second, featuring a list of candidates proceeding from the militias, stressing that sectarian politics and mobilization in Iraq are still salient dynamics. Even though the PMU candidates resigned from their militia posts to run in the elections, they still maintain informal connections to their military units.
Will Iraq's new government succeed to consolidate an inclusive and professional security architecture, or old pattern of politics are going to persist?
NATO can build upon interesting SSR frameworks: is the case of the three-year research initiative on the "Impact of Non-state, Local or Hybrid Security Forces (LHSFs) in Iraq, Afghanistan and Syria", started in 2016 and funded by the Netherlands Organization for Scientific Research (NWO), WOTRO Center for Global Development, and the Berlin-based Global Public Policy institute (GPPi). This network meets with representatives from the Iraqi government and KRG, local and international NGOs, in Sulaymaniyya, Iraq. The research initiative aims to identify key non-state and hybrid security players active on the ground, then addressing the fundamental issue of community-level reconciliation processes. 
In terms of SSR, two NATO members, the US and Turkey are engaged with Iraq's armed forces. The American military-to-military cooperation in Iraq has become more robust after the ISIS invasion: the Atlantic Alliance has planned a training mission in Iraq. Washington will likely use this leverage to pressure Iraq's leader to distance themselves from the Iranian influence. However, for a sustainable SSR process, regional players, such as Iran and NATO's Turkey, need to be part of the framework. Unfortunately, both Teheran and Ankara contributed to the proliferation of militias and this is why NATO's Iraqi future will be really challenging.
 For a discussion of the problems of security sector reform prior to the ISIS invasion see Ibrahim Al-Marashi, "Iraq’s Security Outlook for 2013", ISPI, Milan, 3 October 2013; and Giovanni Parigi, "Iraq Competing Views of Military Reform", ISPI, Milan, 7 December 2017 https://www.ispionline.it/it/pubblicazione/iraq-competing-views-military-reform-19125
 See David Witty, "The Iraqi Counter Terrorism Service", Brookings Institute, Washington DC, March 2015.
 Iraqi Thoughts, "Results of A Nationwide Public Opinion Poll On Iraq’s Upcoming Parliamentary Election", 26 March 2018, http://1001iraqithoughts.com/2018/03/26/results-of-a-nationwide-public-opinion-poll-on-iraqs-upcoming-parliamentary-election/
 The 60,000 figure comes from the Kurdish news portal Rudaw, rudaw.net/english/middleeast/iraq/180520155. The 120,000 figure comes from the BBC, http://www.bbc.com/news/world-middle-east-32349379. The number of Iraqi military personnel comes from Kenneth Katzman, and Carla E. Humud, "Iraq: Politics and Governance", Congressional Research Service, Washington DC, 16 September 2016, p. 12. There are no reliable figures for the number of ISIS fighters.
 See Parigi 2017.
 American University of Iraq, IRIS, "What Comes After Mosul? Local and National Security Relationships, and the Impact of Local or Non-State Security Force Proliferation", http://auis.edu.krd/iris/events/working-discussion-what-comes-after-mosul-local-and-national-security-relationships-and