Skip to content
VPNDetection

Handle privacy relays

Learn what VPNDetection's is_relay means, why most relay users are ordinary customers, and how to treat iCloud Private Relay in your rules.

A privacy relay hides a browser's IP address from the websites it visits. Unlike a VPN, it keeps the user's approximate location, so a site still knows the user's country. VPNDetection flags relay addresses with is_relay, separately from is_vpn, because most rules should treat the two differently. This guide explains what a relay is, who uses one, and how to write rules that treat relay users fairly.

What is_relay covers

  • Privacy relays, such as iCloud Private Relay, which hide the user's address while keeping their country and approximate region.
  • Enterprise web gateways, which send a company's web traffic out through a small set of addresses.

Both flags come with every plan, and so does the relay object, which names the operator in relay.provider and relay.provider_name when it's known.

How a privacy relay works

iCloud Private Relay, for example, sends Safari's traffic through two hops: one that knows who the user is but not what they visit, and one that knows what they visit but not who they are. The website sees the second hop's address. That address represents the user's region, and many users share it at once.

Two things follow for your rules. The address tells you the user's country but not who they are, and many unrelated people can arrive from the same relay address within minutes.

Who uses relays

Mostly ordinary people. iCloud Private Relay comes with an iCloud+ subscription and covers browsing in Safari, so many Apple users are behind it without thinking about it. A company gateway carries its staff's traffic at work. Neither suggests fraud.

How to treat relays in your rules

  • Allow relay traffic by default. Blocking relays blocks a large share of Apple users.
  • Use the country. A relay keeps the user's country, so a country rule can read its location as it would any other.
  • Count a relay as a weak signal, if at all. For a high-risk action, a relay can add a little to a score, but less than a VPN.
  • Don't limit by address. Because many users share a relay address, a per-address limit on sign-ups or logins catches everyone behind it.
Node.js
const r = await client.lookup(ip);
if (r.isRelay) {
    // An ordinary user behind a privacy relay or a company gateway.
    return 'allow';
}

Test it

Turn on iCloud Private Relay on an Apple device, then open api.vpndetection.io/myip in Safari. The answer should show is_relay as true, with the operator named in relay, and location.country should be your own country.

Next steps

For rules that combine the country with VPN and Tor detection, see Restrict content by country. For a sign-up policy that allows relays and verifies VPNs, see Screen VPN and proxy sign-ups.