We read in al-Kāfī, vol. 2, p. 72:
مُحَمَّدُ بْنُ يَحْيَی عَنْ أَحْمَدَ بْنِ مُحَمَّدِ بْنِ عِيسَی عَنْ مُحَمَّدِ بْنِ إِسْمَاعِيلَ بْنِ بَزِيعٍ عَنْ أَبِي اَلْحَسَنِ اَلرِّضَا عَلَيْهِ اَلسَّلاَمُ قَالَ: أَحْسِنِ اَلظَّنَّ بِاللَّهِ فَإِنَّ اَللَّهَ عَزَّ وَ جَلَّ يَقُولُ أَنَا عِنْدَ ظَنِّ عَبْدِيَ اَلْمُؤْمِنِ بِي إِنْ خَيْراً فَخَيْراً وَ إِنْ شَرّاً فَشَرّاً .
Muḥammad ibn Yaḥyā, from Aḥmad ibn Muḥammad ibn ʿĪsā, from Muḥammad ibn Ismāʿīl ibn Bazīʿ, from Abū al-Ḥasan al-Riḍā (peace be upon him), who said: “Have a good opinion of Allah, for indeed Allah—Mighty and Majestic—says:
I am in accordance with the opinion My believing servant has of Me: if it is good, then good (will befall him), and if it is evil, then evil (will befall him).”