I offered two rak'ahs of prayer before the Maghrib prayer (i.e. obligatory) during the time of the Messenger of Allah ﷺ. I (narrator al-Mukhtar b. Fulful) asked Anas: Did the Messenger of Allah ﷺ se you ? He replied: Yes, but he neither commanded us nor forbade us (to do so).
صَلَّيْتُ الرَّكْعَتَيْنِ قَبْلَ الْمَغْرِبِ عَلَى عَهْدِ رَسُولِ اللَّهِ ﷺ قَالَ قُلْتُ لأَنَسٍ أَرَآكُمْ رَسُولُ اللَّهِ ﷺ قَالَ نَعَمْ رَآنَا فَلَمْ يَأْمُرْنَا وَلَمْ يَنْهَنَا