Transform Rule for Authelia / Caddy

I’m trying to understand what the Authelia documentation is asking me to do here: Forwarded Headers - Integration - Authelia

It looks like it is saying to create two rules that each remove the X-Forwarded-For header? One removes it if it is non-empty and one removing it if it doesn’t contain a Cloudflare IP address? These don’t make sense to me. I’m not sure what we’re trying to accomplish?

My interpretation (which has to be wrong) is that any match of either of the expressions:

(http.x_forwarded_for ne "")
 - OR -
(not ip.src in {})

should result in X-Forwarded-For be removed.

I’m trying to set up a small homelab mainly for Home Assistant and smarthome applications. Ultimately, I want to go through Cloudflare Tunnel to Caddy proxy with Authelia authenticating. Could someone please explain what transforms I’m supposed to be creating? I’m lost on what I’m supposed to be accomplishing and I don’t want to do anything that will negatively affect security.