How to hide my XML Sitemap from competitors but not from search engines

I recently tried to check my competitor site and I git this error

Error 1020

Ray ID: 683404323e6a33d2 • 2021-08-23 11:31:45 UTC

Access denied

What happened?

This website is using a security service to protect itself from online attacks.

Cloudflare Ray ID: 683404323e6a33d2 • Your IP: 27.5.26.181 • Performance & security by Cloudflare

You can try a Firewall Rule like this. If the URL is your sitemap, and the visitor is NOT a known (good bot), then block. That will only allow popular search engines. Keep an eye on your firewall events log. You may need to add exceptions if you see other search engines you like being blocked.