While the IRGC has always operated outside of formal political structures headed by the Supreme Leader, it has not been exempted from challenges.
Former president and reformist, Mohammad Khatami, tried to curb its power but, with the help of Khamanei's patronage, the IRGC responded by deepening its power base, both through an elaborate network of economic interests and the appointment of former IRGC officers into political positions.
This policy of placing IRGC personnel in senior positions continued under President Mahmoud Ahmadinejad who was, himself, a former member of the IRGC.
The IRGC also runs its own internal intelligence service set up at Khamanei's behest in frustration over the inability of Iran's Ministry of Intelligence and Security (MOIS) to contain the 2009 demonstrations.
The result of this has been an entrenchment of IRGC power through an extensive network of economic and political influence. Its survival is dependent on that of the regime, as is it for many Iranians who, whilst not members of the IRGC, depend on it for economic or professional reasons.
In total, the IRGC comprises approximately 190,000 members organised into 31 provincial corps (two in Tehran), special forces and armoured and infantry brigades.
The IRGC also possesses a strong naval force (20,000) responsible for conducting operations in the Gulf, an aerospace force (15,000) and the IRGC Quds Force (5,000) responsible for overseas operations.
The Quds Force
The IRGC QF, currently led by Ismail Ghani, expanded its power and influence significantly under his predecessor Qassem Soleimani through an aggressive strategy of sponsoring militias in conflicts across the Middle East.
The real strength of the QF lies in the size and capabilities of the foreign entities that it leverages including the Lebanese Hezbollah and several other large militias in Syria and Iraq.
Although not a force used for suppressing dissent at home, it commands a large body of foreign fighters in the 'defence of the Islamic Revolution'. It demonstrated its power to mobilise in the war in Syria where it successfully deployed volunteers from as far afield as Afghanistan and Pakistan.
The Basij
The IRGC also has operational command of the volunteer force, the Basij, whose popular membership is estimated to be as high as 6 million (Iranian official sources say the force comprises 23 million volunteers).
The Basij is a mass movement with branches in schools, universities and the workforce, whose origins are similar to those of the IRGC in the early days of the Islamic Revolution. Its personnel — often recruited and deployed locally — play a frontline role in suppressing popular dissent.
The Basij is a vital power base but also a source of information and, when required, a muscle for the regime. It was inevitably in a rivalrous relationship with the IRGC.
This rivalry came to a head in 2009 when it was subordinate to the IRGC and officially placed within the Imam Ali and Iman Hussain brigades, which played a key role in suppressing dissent during the anti-government protests of 2009 and 2019.
The MOIS
The Ministry of Intelligence and Security (MOIS) was originally established to play a coordinating role between intelligence and security services, but it has developed a distinct character as a security agency focused on specific threats to the regime including dissidents overseas against whom it waged an assassination campaign in the 2010s.
It has most recently been accused of being behind cyber operations against the oppositionist movement Mujahidin Al Khalq (MEK) in Albania as a result of which the Albanian government, which was also targeted, retaliated diplomatically, prompting the US Treasury Department to impose sanctions on the MOIS.
Constitutionally, the MOIS works for the Supreme National Security Council which is chaired by the president. But, in practice, it, like all the security and defence services, is ultimately commanded by the Supreme Leader.
The police force
The front line of Iranian public security is the responsibility of Iran's police force (NAJA). The force (c. 60,000) represents a fusion of three originally separate organisations: the police, the gendarmerie and the revolutionary "Komitehs."
The Security Police (PAVA) is an element of the police force. The notorious morality police also known as the religious police, are a sub-section of PAVA, which, in virtue of its right to intervene on aspects of dress and behaviour, has wide powers of intervention — the application of which were responsible for the death of Mahsa Amin and the current wave of protests. They, like the entire police force, report to the Minister of Interior but are not subject to any formal oversight or accountability.
The decision to disband the religious police is a significant concession by the regime as it represents its right to regulate aspects of the private lives of citizens in accordance with its interpretation of Islam.
It remains to be seen whether its mandate and personnel will be redistributed across other agencies or whether its disbanding represents a genuine policy shift on the regulation of the private lives of citizens.
The army
The extensive security apparatus is separate from, and in rivalry with, the conventional army (600,000). The regime has actually never been fully confident in the loyalty of these forces.
The role of the army is not to maintain internal security and it is unlikely they would be deployed against domestic protesters. A deliberate design of the regime is that its internal security apparatus is sufficient to deal with widespread internal dissent without having to call on its conventional army.
If this were to happen, it would be an admission of defeat on the part of the security establishment. It would also bring large numbers of servicemen into the regime's political arena who are not as dependable or trusted as the security forces.
Associated risks
Iran's security agencies possess highly developed intelligence and counterintelligence capabilities which penetrate local communities and enable them to identify and disrupt threats.
However, such a large security machine also presents risks. With such an unwieldy structure, it is difficult to apply universal standards, rules of engagement and command and control.
The numbers of employees are also sufficiently large enough to raise the numerical probability that some elements will, at some point, sympathise with anti-government demonstrators — a move which, however small in numbers, would have a disproportionate and symbolic impact.
National security structure
The national security structure in Iran consists of the NSC at the top, supported by regional security committees whose responsibility is to coordinate the response of various agencies to combat local threats.
The system has been tested before by popular demonstrations and riots in various provinces but not to the extent to which it is being currently tested.
The proliferation and variety of Iran's security organisations reflects the unique constitution under which the ultimate authorities are religious rather than political.
Similarly, the law and law enforcement are subordinate to religious authorities responsible for ensuring that all aspects of the state conform with the religious tenets of the ruling Shiite school.
Organisations, therefore, derive their power from their religious zeal and rectitude rather than from law. This has been the case with the IRGC, in particular the Quds Force, the Basij, and the religious police, who have specific mandates to support and protect the Islamic Revolution.
These entities sit outside any conventional legal or political structure, although they are integrated into the regime's security apparatus.
Religious police debate
This has led to disagreements sometimes played out at the polls over the role of religion in security. The role of the religious police has been more openly questioned by society and even by former President Hassan Rouhani.
The debate was revived by recently-elected President Ebrahim Raisi as part of his conservative agenda. The recent statement from the Attorney General that the religious police are being disbanded may represent a significant concession to the demonstrations and a hope that, by sacrificing them, the regime can defuse tension.
But it remains to be seen whether their functions will be assigned to other organisations or whether any formal changes will be made to the regime's doctrine on Islamic dress and conduct.