Dalil

Quran Al-Anbya 21:94

فَمَن يَعۡمَلۡ مِنَ ٱلصَّٰلِحَٰتِ وَهُوَ مُؤۡمِنٞ فَلَا كُفۡرَانَ لِسَعۡيِهِۦ وَإِنَّا لَهُۥ كَٰتِبُونَ

Translation

So whoever does righteous deeds while he is a believer - no denial will there be for his effort, and indeed We [i.e., Our angels], of it, are recorders.