When 'Umar ibn 'Abdul-'Aziz became Caliph, he wrote to Al-Hasan al-Basri to write him the description of a just Imam, and Hasan wrote him:
"Know, Commander of the Believers, that God has made the just Imam the prop of every learner, the straightener of every deviator, the reform of all corrupt, the strength of all weak, the justice of all oppressed, the refuge of all who are pitied. The just Imam, O Commander of Believers, is like a herdsman, solicitous for the camels he tends, desiring the sweetest pasture for them, driving them away from any dangerous grazing place, protecting them from beast of prey, and shielding them from the harms of heat and cold.
And the just Imam, Commander of the Believers, is the guardian of the orphan, and the treasury of the poor, fostering the little ones, and providing for the old ones. The just Imam, Commander of Believers, is as the heart is to the members of the body: all are sound when it is sound, and all corrupt when it is corrupt. The just Imam, Commander of Believers, stands intermediary between God and His servants; hearkening to God's words, and making them hearken; looking to God, and making them to look; obedient to God and making them obedient.
Therefore, Commander of the Believers, act not in what God the Mighty and Glorious has given you like a slave whose master has trusted him and given into his care his wealth and his children, who then squanders his master's wealth and drives his children away, and reduces the family to poverty and scatters their fortune.
And know, Commander of the Believers, that God has sent down (His prescription for) the legal punishments to chide (people) away from wickedness and immorality. How shall it be, if he who administers them, deserves them? And He sent down (the law of) retaliation to give life to His servants. How will it be if the man who gives them retaliation puts them to death?
Remember, O Commander of the Believers, death and what comes after it, and how few partisans you have there, or aids against it. Therefore make provision for death, and against the greater terror which follows it.
And know, Commander of the Believers, that there is a place for you other than the place where you are now. Your stay there will be long, and your friends will be separated from you. You will be committed to its depths as a completely solitary individual. Therefore, make provision of what you may take with you.
"On the day when a man shall flee from his brother, his mother, his father, his consort, his sons." [Al-Qur'an 80:36]
And remember, Commander of the Believers:
"When that which is within the tombs shall be cast out, and that which is in the breasts exposed." [Al-Qur'an 100:9], when secrets are made manifest, and "The record leaves nothing, great or small, without numbering it." [Al-Qur'an 18:49]
And now, Commander of the Believers, you are in leisure, before the dissolution of death and the serving of hope. Therefore, Commander of Believers, do not give judgement among the servants of God according to the usages of pre-Islamic period (bi hukum al-jahiliyyah), and do not travel the way of transgressors with them, and do not put he arrogant in power over the humble, for such will not watch over any believer or the protected religious groups (dhimma), so that you will have to acknowledge your own faults and the faults of others, and bear your own burdens and other burdens too. Do not be deceived by those who would lead a pleasant like by causing damage to you, and eat the good things of this world by causing the good things of your afterlife to disappear. And do not regard your power in this world, but look toward what will be your power when you are captive in the bonds of death, and forced to stand before God Most High in the company of the angels and prophets and apostles, and faces are turned to the Living and Self-subsisting One.
And I, O commander of Believers, though I have not attained by my rigors what prudent men attained before me, yet have not desisted from offering you solicitude and advice, sending you my letter as a doctor causes a beloved friend to drink disagreeable medicine, because he hopes to offer him health and soundness.
And peace be upon thee, O Commander of the Believers, and the mercy of God, and His blessing."
(s) Recorded by Ibn 'Abd-Rabbiji (d. 328H / 940CE), taken from The Necklace (an enclopedic anthology) as found in Williams (1971), Themes of Islamic Civilisation, from, Al-Iqd al-Farid, Cairo, 1953.