Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Allah has pardoned my Ummah for the thoughts that arise in their hearts and for what they were coerced into. They will be taken to account for putting what is in the heart into words or acting upon it."
(b) Ibn Abi Awfa narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him), attributing it to the Prophet (peace and blessings be upon him), (a hadith) with this meaning about inner thoughts and whisperings; and the words "unless they speak of it or act upon it" relate to inner thoughts, not to the one who is coerced.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 20014