Imam Mahdi's conduct will be based on that of his forefather, the Prophet. He will defend the religion and the Qur'an that were given to the Prophet. For instance, the Prophet is reported to have said: "One of my ahl al-bayt will rise and will act upon my tradition and my custom." And, he said: "The Qa'im among my children, will have my name and my patronymic. He will possess my features and will follow my conduct. He will command the people to my obedience and to my law; and he will call them to the Book of my Lord."
In another tradition he said: My twelfth descendant will disappear in such a way that he will not be seen at all. There will come a time when there shall remain nothing but a name from Islam. And, there shall remain nothing but a trace from the Qur'an. At that time God will permit him to revolt and through him God will reinforce Islam and revive it In still another hadith the Prophet said: "Mahdi is from my family and will fight for my tradition, just as I fought for the Qur'an."
As one can observe, these traditions clearly indicate that the twelfth Imam's agenda and his plan of action are to propagate Islam and to revive the importance of the Qur'an. In order to execute the teachings of the Prophet he will strive with force. Hence, if there is any ambiguity in the earlier traditions cited in this section, the above traditions help clarify them. Over all, the traditions should be interpreted as follows: During the occultation, innovations will appear in the religion, and the ordinances of the Qur'an and the teachings of Islam will be interpreted in accordance with people's likes and dislikes. As a result, many teachings and laws will be forgotten as if they were never even a part of Islam. When the Mahdi appears he will invalidate these innovations and will restore the ordinances of God as they were when they were commanded. He will institute the penal laws of Islam without any leniency. Evidently, such a program will be perceived by the people something new.
Imam Sadiq in another hadith has made the aforementioned role of the Mahdi explicit: "When the Qa'im rises he will emulate the conduct of the Prophet, except that he will elaborate the traditions of Muhammad (peace be upon him and his progeny)." Fadl b. Yasar heard Imam Baqir saying: "When our Qa'im rises he will face so much difficulty from the people, that even the Prophet during the period of jahiliyya did not face." Fadl asked: "Why should that be so?" The Imam said: When the Prophet was appointed people worshipped stones and wood. However, when our Qa'im arises people will interpret the ordinances of God against his interpretation, and will argue with him and dispute by means of the Qur'an. By God, the justice of the Qa'im will enter inside their homes, just as the heat and the cold enter them.