In line with the Qur'anQur'an 66:3 ↗وَإِذۡ أَسَرَّ ٱلنَّبِيُّ إِلَىٰ بَعۡضِ أَزۡوَٰجِهِۦ حَدِيثٗا فَلَمَّا نَبَّأَتۡ بِهِۦ وَأَظۡهَرَهُ ٱللَّهُ عَلَيۡهِ عَرَّفَ بَعۡضَهُۥ وَأَعۡرَضَ عَنۢ بَعۡضٖۖ فَلَمَّا نَبَّأَهَا بِهِۦ قَالَتۡ مَنۡ أَنۢبَأَكَ هَٰذَاۖ قَالَ نَبَّأَنِيَ ٱلۡعَلِيمُ ٱلۡخَبِيرُ
The Prophet told something in confidence to one of his wives. But when she disclosed it, and God made it known to him; he communicated part of it, and he avoided another part. Then, when he informed her of it, she said, “Who informed you of this?” He said, “The All-Knowing, the All-Informed, informed me.”
The verse recounts the prophet confiding a matter to one of his wives who disclosed it, censuring the disclosure that Anas in the report avoided.
In line with the Qur'anQur'an 23:8 ↗وَٱلَّذِينَ هُمۡ لِأَمَٰنَٰتِهِمۡ وَعَهۡدِهِمۡ رَٰعُونَ
Those who are faithful to their trusts and pledges.
The verse praises those who keep their trusts and covenants, matching Anas keeping the secret entrusted to him even from his mother.