Answer
"7 Rings" is indeed not written by Ed Sheeran. The song was written by Grande alongside Tayla Parx, Victoria Monét, Njomza Vitia, and producers Tommy Brown, Charles Anderson, and Michael Foster. Sheeran, on the other hand, has collaborated with Grande on several hit songs including "One Last Time" and "Don't".