Abu Hurairah reported,

Allah has pardoned my community for the whisperings and inner thoughts that cross their minds, as long as they do not act upon them or speak them aloud.

Bukhari 6664

Sahih

حدثنا خلاد بن يحيى حدثنا مسعر حدثنا قتادة حدثنا زرارة بن أوفى

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

إن الله تجاوز لأمتي عما وسوست أو حدثت به أنفسها ما لم تعمل به أو تكلم

البخاري 6664صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Oaths and vows
Chapter
If one breaks an oath forgetfully
Numbering
Darussalam 6664
Bukhari 6664