Over the last 12 months, al-Shabaab has markedly increased the tempo and sophistication of its attacks on a range of soft and hard targets in Somalia, the semi-autonomous region of Puntland and in southeast Kenya. The al-Qaeda affiliate is re-taking territory it once controlled in southern and central Somalia while threatening Puntland and southeast Kenya by moving more operatives into those regions (al-Jazeera, June 8; The Star, July 16). The resurgence coincides with the 2016 withdrawal of a significant number of Ethiopian National Defense Forces (ENDF) and a planned drawdown of troops with the African Union Mission in Somalia (AMISOM) (African Arguments, October 27, 2016).
The partial withdrawal of the EDNF and the proposed drawdown of AMISOM forces have contributed to al-Shabaab’s ability to go on the offensive (IRIN, February 28). There is no doubt that the presence of relatively well-trained EDNF troops helped keep al-Shabaab from overtly taking control of villages and towns. However, the EDNF, AMISOM and the Somalia National Army (SNA) have struggled to consistently provide security for Somalis in the areas outside of select villages, towns and strategic roadways. In much of Somalia, especially in those areas under the nominal control of the Somali federal government, banditry, kidnapping and extortion are rife. The Somali National Army (SNA) remains poorly trained and is plagued by corruption and clan rivalries.  AMISOM — which is plagued by issues of corruption — and the SNA have largely failed to fill the security vacuum (Daily Nation, July 24).
Instead, al-Shabaab is stepping in, perhaps more so than ever before. The reasons for the group’s enhanced capabilities in Somalia and further afield are twofold and interlinked. First, it has, over the last six years, further developed its formidable intelligence apparatus, the Amniyat.  Second, due to greater organizational discipline and efficiency, it is providing more consistent and predictable levels of security for residents than its primary rival, the Somali government.
Amniyat: A Ministry of Fear
Since its 2011 withdrawal from Mogadishu and its 2012 withdrawal from the port of Kismayo, al-Shabaab has undergone a transformation (al-Jazeera, September 29, 2016). Much like al-Qaeda in the Arabian Peninsula (AQAP) in neighboring Yemen, it is an organization that readily learns from its mistakes and rapidly adapts to shifting political and tactical environments. This ability to learn and adapt has served al-Shabaab well over the last five years. Under the leadership of Ahmed Abdi Godane (killed September 2014), al-Shabaab became a more streamlined and disciplined group (Daily Nation, September 5, 2014).
In the wake of its withdrawal from Mogadishu and the subsequent loss of the revenue generating port of Kismayo, al-Shabaab was forced to restructure itself. Rather than focusing its efforts on set piece battles with the better-armed AMISOM forces and on holding and governing territory, al-Shabaab prioritized organizational security and lower risk operations against its foes. Both of these priorities fostered and fueled the development of the Amniyat, al-Shabaab’s intelligence apparatus.
Enhancing the Amniyat’s capabilities and power was viewed by al-Shabaab’s former leader, Godane, as critical to both his own survival and that of the organization. After its withdrawal from Mogadishu in 2011, al-Shabaab was riven with bloody internal disputes. The empowerment of the Amniyat allowed Godane to purge al-Shabaab of those who posed a threat to his leadership (African Arguments, July 2, 2013). Amniyat operatives instilled fear in al-Shabaab’s cadre of fighters through intimidation and, when required, assassination. Amniyat operatives — who were and are seeded throughout the larger al-Shabaab organization — ensured the loyalty and discipline of regional and sub-commanders. Disloyalty to Godane, financial irregularities and ideological deviations could all lead to harsh punishments that included summary execution.
The ability of Amniyat operatives to seemingly see everything that went on in the larger al-Shabaab organization led some al-Shabaab members to refer to them as “Godane’s ghosts.”  The al-Shabaab leader recognized that secrecy is as seductive as it is useful, and while members of the Amniyat were feared, being chosen to serve within its ranks was an honor for which many fighters competed. 
Secrecy is at the heart of the Amniyat. To achieve a high degree of secrecy and security, the Amniyat is ring-fenced from the broader al-Shabaab organization. In addition to operating as an organization within an organization, parts of the Amniyat itself are further compartmentalized. This measure was taken to prevent leaks and, most critically, to ensure that when its operatives are captured by enemy forces, they are only able to reveal limited amounts of information about their particular job or task.
The compartmentalization of the Amniyat became ever more critical in 2012 and the years that followed. The sustained AMISOM offensive that began in earnest in 2012 and persisted to varying degrees for three years put pressure on al-Shabaab. Its fighters retreated to the thickly forested parts of the Somali state of Jubaland, located along the Somali-Kenya border. However, while the bulk of al-Shabaab’s forces retreated to these areas where they could not be easily targeted, Amniyat operatives remained behind in the cities, towns and villages from which al-Shabaab had retreated. These operatives were al-Shabaab’s eyes and ears on the ground.
The Amniyat has gone on to set up a countrywide network of operatives and informants. Al-Shabaab has boasted about the fact that it has informants in every government ministry and within AMISOM itself.  This is evidenced by the fact that al-Shabaab has repeatedly been able to attack secure sites in the Somali capital of Mogadishu and, with increasing regularity, heavily defended AIMISOM bases (The New Arab, March 21; BBC, January 27).
Many of these attacks are coordinated and timed in a way that points to its ability to conduct persistent surveillance of targets. In addition to being able to attack secure compounds, al-Shabaab, via its Amniyat operatives, routinely intimidates, recruits — often via threats to family members — and assassinates members of the Somali government, its security services, journalists and non-compliant business owners (Garowe Online, July 1; Garowe Online, July 6).
The Amniyat is also tasked with collecting intelligence on Somalia’s fluid and fraught clan dynamics.  Such intelligence allows al-Shabaab to safeguard and grow its influence in Somalia.
In the early 1990s, the then-emergent al-Qaeda organization failed to establish itself in Somalia. Abu Hafs al-Misri, the deputy dispatched to Somalia by Osama bin Laden, attributed this failure to Somalia’s fractious and ubiquitous clan politics.  All but a minority of those Somalis which al-Qaeda tried to recruit put loyalty to their clans and sub-clans ahead of ideology and obedience to foreigners.
The same problem bedeviled al-Shabaab’s early expansion efforts. The leadership of al-Shabaab was, just like the Somali government, often held hostage to ever-shifting clan politics. Former al-Shabaab leader Godane recognized that clan rivalries posed a serious threat to his organization. Al-Shabaab, especially during times when it is under pressure, must be able to rely on its core membership. When it is on the offensive, it must also be able to rely, at least for a short period of time, on those it recruits and uses as “first wave” fighters. If clan politics and rivalries predominate, then there is little or no organizational cohesion.
To circumvent this, Godane and those close to him undertook a two-step plan. First, they indigenized al-Shabaab by expelling and or assassinating most of its members who were foreign jihadists. Al-Shabaab, much like AQAP would do later, recognized that, apart from some with technical expertise, foreigners were an unnecessary liability. The presence of foreigners had alienated al-Shabaab from the local population that they wanted to control. The second and concurrent step undertaken by al-Shabaab leadership in the aftermath of the defeats in 2011-2012, was to reshape al-Shabaab’s organizational structure. Godane cleverly adopted a structure that outwardly modeled the de-centralized and non-hierarchical structure of Somalia’s clans.
To this end, commanders and sub-commanders were empowered and allowed to recruit foot soldiers, appoint junior commanders and undertake limited defensive and offensive actions on their own initiative. They were also permitted to work with one another on joint operations, with little guidance from al-Shabaab’s governing body, the executive shura council. However, this de-centralization of power was permitted because, at the same time, Godane markedly expanded the scope and powers of the Amniyat, which monitored all of al-Shabaab’s junior and even senior commanders. Most importantly, the Amniyat answered only to Godane. The Amniyat was and remains highly centralized in terms of its leadership structure.
Al-Shabaab’s commanders and sub-commanders were allowed — and indeed encouraged — to engage in clan politics. Al-Shabaab’s leadership considers this as an “above but part of” strategy. The group’s senior leaders and, to a lesser degree, its regional commanders remained above the often messy and at times bloody machinations of rival clans and sub-clans, allowing al-Shabaab’s senior leadership to act as arbiters in conflicts. This outcome was not accidental and has allowed al-Shabaab to build a considerable amount of goodwill in parts of Somalia.
Hearts and Minds?
Al-Shabaab’s pragmatic and Machiavellian approach to managing and taking advantage of Somalia’s clan dynamics is emblematic of its larger strategy for winning the minds, if not the hearts, of the people it wants to control. Al-Shabaab’s militant Salafist ideology remains an anathema to most Somalis. However, the aversion of many Somalis to al-Shabaab’s radical interpretation of Islam is overcome by the higher levels of security and predictability that the organization often provides.
The leadership of al-Shabaab clearly understands the importance of predictability to a target population. To this end, while their methods are harsh and their punishments often overly punitive, they are consistent. For example, in those areas outside of al-Shabaab influence and control, a trader or mid-level businessman never quite knows what to expect from the SNA and AMISOM troops and officials that exert nominal control. He may be heavily taxed on whatever goods he is trying to move or sell or he may have them seized outright. He may also have to pay off numerous clan-based militias before he is able to finally get his goods to market. With al-Shabaab this trader or businessman knows what taxes he will have to pay. He is given a receipt for payment which allows him to move his goods through subsequent checkpoints without paying more taxes (Somali Update, July 24). Additionally, he knows that he is unlikely to come across bandits in those areas controlled by al-Shabaab.  This level of predictability and security is no small thing in a country that has known neither for three decades. While few Somalis are enthusiastic about al-Shabaab, in some areas there is a grudging respect for the control commanders have over their forces.
At the same time, there is fear. This fear is largely due to the Amniyat and its hold over both of al-Shabaab’s own forces and of those civilians living in areas under al-Shabaab control. The Aminyat often imprisons or executes individuals who work against the group, those who refuse to pay its taxes and even clan elders who refuse to acknowledge its authority. Within al-Shabaab itself, those fighters and commanders who take bribes, embezzle funds or who do not follow orders are also subject to harsh punishments, including summary execution.
In the areas it controls, al-Shabaab is successfully employing a “carrot and stick” method to guarantee compliance if not support. Because of the years of war and famine, the bar for good governance in most parts of Somalia is low. If al-Shabaab provides a minimal level of security — in fact, it often provides quite a high level — and if it can control its forces, this places it well ahead of many of its rivals for power. Combined with this, it wields a mighty stick in the form of the Amniyat. Al-Shabaab’s leadership has developed a formula for control that works and is likely to continue to do so.
Over the last three years, there have been numerous forecasts that have predicted the demise of al-Shabaab as a force. These forecasts have all proved to be premature if not wholly incorrect. Al-Shabaab, much like AQAP in Yemen, has proven itself to be an adaptable organization that learns from its mistakes and then in response to lessons learned, modifies its tactics and overall strategy accordingly.
This ability to learn and adapt is evidenced by al-Shabaab’s combination of an efficient and highly capable intelligence service with a pragmatic approach to building local support. This alone will guarantee that al-Shabaab endures. When these enhanced capabilities are combined with a planned drawdown of AMISOM forces and the inability of the SNA to provide real security, the result may well be that al-Shabaab yet again thrives.
 See: Andrew McGregor, ‘Are Corruption and Tribalism Dooming Somalia’s War on al-Shabaab,’ Terrorism Monitor (February 21, 2017).
 The Amniyat’s origins as a power within al-Shabaab are not clearly defined. It is known that it was formalized as an institution within al-Shabaab in 2009 with Mukhtar Abu Seylai as its head. The Amniyat rapidly evolved into an elite cadre of al-Shabaab operatives and soldiers recruited on the basis of both their abilities and most importantly their ideological resolve. Members of the Amniyat were and are the most radical members of the al-Shabaab organization, and most of them likely subscribe to takfirism, a more radical form of Salafism. The Amniyat’s remit includes ensuring the unity and security of al-Shabaab. As part of this remit, the Amniyat has the ability to circumvent al-Shabaab’s own justice system and carry out immediate (most often lethal) action against those members who the Amniyat suspected of disloyalty.
 Author interviews with Somalia-based analysts (2016-17).
 Members of the Amniyat enjoy higher pay and status than most other members of al-Shabaab.
 Al-Shabaab operatives routinely phone even senior military commanders on their private lines in order to threaten and intimidate them.
 Governance within Somalia clans is acephalous – ie there is no central or hierarchical leadership. A popular aphorism in Somalia is: “Everyman is an elder.” This is broadly reflective of the reality in which often even relatively young members of families and sub-clans participate in informal and formal discussions about matters that affect them. Somalia scholar IM Lewis argues that, “democratic principles in Somalia are practiced almost to the point of anarchy.” To a large degree this characterization remains valid, especially in Somalia’s predominantly rural areas where resources and power are less likely to concentrate. The primacy of the clans and their diffuse power structures militate against the imposition of hierarchical systems.
 See: “Al-Qaeda’s (Mis)Adventures in the Horn of Africa,” Harmony Project, West Point Combating Terrorism Center (2007).
 Author interviews with Somalia-based analysts and journalists (May 2017).