Jami` at-Tirmidhi 2642
جامع الترمذي#2642SahihNarrated 'Abdullah bin 'Amr:that the Messenger of Allah (ﷺ) said: "Indeed Allah, the Blessed and Exalted, created His creation in darkness, then He cast His Light upon them, so whoever is touched by that light he is guided, and whoever is not, he goes astray. It is for this reason that I say that the pens have dried with Allah's knowledge
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Ahmad Muhammad ShakirSahih
Al-AlbaniSahih
Zubair Ali ZaiSahih
In-book reference: 40:37