Simultaneously...
Simultaneously, they worked to divide the Shiites internally by appointing men from the Jaririyya to certain sensitive posts, so that the Jaririyya could investigate the Imamites and spread propaganda against them. After the failure of this policy, from the time of al-Ma'mun the ‘Abbasids instituted a new plan which was intended to curtail the revolutionary activities of the Shiites. Part of this plan was to make the Imams their courtiers so that they could watch their every move.
This can be observed in the policy of al‑Ma'mun, who brought al‑Riďa from Medina to Merv and appointed him his heir apparent, keeping him under house arrest. Al‑Ma'mun followed a similar policy with the ninth Imam al‑Jawad. Later the ‘Abbasid caliphs followed al‑Ma'mun's lead in their attitude towards the tenth Imam, al‑Hadi, and his son al‑‘Askari, both of whom were kept under house arrest in Samarra for most of their lives.
It thus became extremely difficult for the Imams to have normal relations with their followers, except their closest associates with whom they held secret meetings. It seems likely that the house arrest of the later Imams led them to expand the role of the organization, the Wikala, and to entrust the Saf’ir with more authority to supervise the Imamites' activities. From the time of al‑Jawad onwards, the Imam began to guide the activities of his followers through his Saf’ir.
The ordinary Imamites found such a situation strange and had to be educated to accept such indirect communication with the Imam. However the role of the Saf’ir during this period is not as obvious as his later position during the first occultation of the Twelfth Imam, because the Imam's whereabouts were well‑known and his position clear. It also seems that the continuation of the house arrest encouraged the Imams to find a means which might release them from its restrictions.
From the years 245‑250/859‑64 onwards statements related on the authority of al‑Hadi and al‑‘Askari, indicating that an unnamed Twelfth Imam would go into concealment, were circulating amongst the Imamites. Furthermore al‑Hadi and al‑‘Askari ordered their close agents to follow the instructions of ‘Uthman b. Said al‘Umari and his son Abu Ja’far (i.e. the first and the second safrs).
It appears therefore that outwardly and historically the Imam's first concealment grew from the desire of his fathers to evade the surveillance of the government of the day, so that he could safely perform the duties of the Imama.