No slave of Allah can be an ally of Allah unless he has the characteristics of faith and pious practice, as is clear from the previously cited verse:
“Indeed, there is no fear upon the awliyaa’ of Allah, nor shall they grieve, those who believe and are ever pious in their actions.” Qur’an 10:62-63
“Then, my slave will continue to come closer to me by making extra efforts until I love him.”
No one becomes a pious believer until they seek to come close to Allah by doing everything which is obligatory upon them, then they become one of the righteous, those of the right hand. Then, one may continue to seek to become close to Allah through the commendable non-obligatory actions (nawaafil), until the rank of the forerunners, those brought close is achieved. It is thus known that no one of the disbelievers or the hypocrites can be an ally of Allah, likewise those whose belief is not valid (because of their being not responsible for their actions) even though there may be no sins upon them as yet, such as the children of the disbelievers, and those who have not received the message.
So, though it may be said that they will not be punished until the message has been delivered to them, at the same time, they cannot be among the allies of Allah until they become one of those of belief and pious practice. Whoever does not seek to become close to Allah by the doing of good (as defined by Allah) actions and the avoiding of bad actions, is not one of the allies of Allah. The case is the same for the mentally incompetent or insane, and young (pre-puberty) children. The Prophet (ﷺ) (sallallahu `alayhi wa sallam) said:
“The pen has been lifted for three: the insane until he regains his sanity, the child until he reaches puberty, and the sleeper until he wakes up.”
This hadith is narrated in the major books of hadith after Muslim and Bukhari known as As- sunan from Ali and Aisha (may Allah be pleased with them), and the scholars are unanimous in their acceptance of this hadith. However, the discriminating child (i.e. one who has reached the age of tamyeez or ability to discriminate between right and wrong which occurs usually around seven years), can perform valid acts of worship, for which he may be rewarded by Allah in the unanimous opinion of the scholars. As for the insane person for whom the pen has been lifted, none of his acts of worship are valid in the consensus of the scholars, nothing is valid from him by way of belief, disbelief, prayer, nor any other such act.
Moreover, his actions and statements are invalid even in mundane affairs such as business, manufacturing; he is not suitable to be a cloth merchant, a perfumer, a blacksmith, or a carpenter. His contracts are invalid in the consensus of the scholars. His buying, selling, marrying, divorce, confession, testimony, and all other verbal statements are invalid, having no legal significance, result in no reward or punishment, and are regarded as completely meaningless. This is unlike the discriminating child some of whose verbal acts (acts of worship and in mundane affairs) are valid by evidence of a legal text (Qur’an or Sunnah), some by the evidence of consensus of the scholars, and in some there is a difference of opinion.
Since the faith, pious practice, and seeking to come close to Allah with the obligations and the extra efforts are all invalid from the insane person, it is impossible for one of them to be of the allies (awliyaa’) of Allah. Thus it is not allowed to believe that such a one is an ally of Allah, especially if ones evidence of that is some revealing of hidden things which he heard from the person himself, or some behavior of his, such as his pointing to someone who then died or fainted, since it is well known that the disbelievers, and the hypocrites among the associationists and the Christians and the Jews often perform the revealing of unknown things and other amazing satanic feats. Examples are the fortune tellers and the sorcerers and the ascetics among the associationists and the Christians and the Jews – it is not allowed for anyone to cite such feats (and only this) as evidence that the person is among the allies of Allah, even if nothing is known which contradicts the presence of acceptable faith, let alone in the cases mentioned where that which contradicts any alliance (wilaya) to Allah is well known.
For example, if it is known that the person does not believe in the obligatoriness of following the Prophet openly and in secret, but believes that he follows the “superficial” law but not the inner “reality”, or if he believes that the allies of Allah have a special route to Allah other than the route of the prophets upon them be the peace and prayers of Allah. Or, they may say: “The prophets prepared the way”, or “They are an example for the average people, not for the special people”, or other such beliefs, which are held by some of those claiming to be allies of Allah ta’ala. Such people contain elements of kufr (disbelief) which contradict the presence of imaan (belief) itself, let alone closeness (wilaya) to Allah subhaanahu wa ta’ala. Whoever argued for such beliefs citing as evidence the “miraculous” occurrences associated with such people is farther astray than the Jews and the Christians.
Likewise the insane person, his very insanity contradicts the presence of any valid belief or worship, which are necessary conditions for the alliance with Allah. The sufferer of chronic spells of insanity who is insane sometimes and normal other times, who is a believer in Allah and His Prophet (ﷺ) while in his right state of mind, fulfilling the obligations and avoiding the forbidden is rewarded for the belief and pious practice which he does while in his right mind, and his spells of insanity do not prevent the acceptance of that. His alliance and closeness to Allah will be in accordance to those acts done while in a state of sound mind. Also, one who becomes insane after having believed and practiced Islam: Allah will reward him for his belief and pious practice which preceded his insanity, and will not cancel these good deeds because of the insanity with which he was afflicted through no sin of his. The pen is lifted for him during the time of his insanity.
Therefore, if someone puts up an appearance of alliance to Allah but does not fulfill the obligatory and does not avoid the forbidden, and does things to counter-indicate wilaya to Allah, it is not allowed for anyone to say: “He is an ally of Allah”. Such a person, if he is not insane – either permanently or suffering from chronic attacks – but neglects the obligatory and commits the forbidden while of sound mind, and while believing that they are not obligatory upon him is a kafir (disbeliever). If, on the other hand, he is really insane, the pen has been lifted for him. Such a one, though not liable to be punished as is the disbeliever, is nonetheless not deserving of that which the people of belief and pious practice are deserving i.e. the karamaat or miraculous occurrences which Allah grants to His allies.
So, in either of the two possible cases, it is not allowed to hold the belief that such a person is an ally of Allah. If, in states of sound mind, he is a pious believer, he has the alliance with Allah to the extent of these acts. If, on the other hand, he has while in sound mind elements of disbelief and hypocrisy, or is in fact a disbeliever or a hypocrite, and then becomes insane, he retains whatever he earned in terms of disbelief and hypocrisy and is punished for that – his insanity does not cancel anything that he does or believes while in a state of sound mind.