Abu Hurairah reported,

The Messenger of Allah ﷺ said, "The angels say, 'Lord, that servant of Yours intends to commit a sin,' though He sees him better than they do. He says, 'Watch over him. If he commits it, record it against him as one sin, and if he abstains from it, record it for him as a good deed, for he abstained from it only for My sake.'"

Azami 592

Sahih

عن أبي هريرة، قال

قال رسول الله ﷺ: قالت الملائكة: رب ذاك عبدك يريد أن يعمل سيئة- وهو أبصر به-، فقال: ارقبوه. فإن عملها فاكتبوها له بمثلها، وإن تركها فاكتبوها له حسنة إنما تركها من جراي.

الأعظمي 592صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the angels
Section
Angels record the deeds of the hearts
Numbering
Jami al-Kamil 592 (2nd edition)
Azami 592