Internally, we call this classifying the networks. For typical setups, this determination is quite accurate considering that both the local network and the providers often use private IPs.
Because of the above, there is no way to be one hundred percent sure that the software got it right and in not so typical setups, human intervention is required. The user must know their own network in order to understand the results.
In fact, this is something mentioned in these forums quite a bit, that in some cases, the agent cannot determine the local network from the providers and the user has to know this. I'll give you an example.
Lets say a private network with multiple routers, gateways and no static. The algorithm might think that the first gateway it sees is yours because the next one is say four hops away. It cannot reliably determine where your network ends and where the providers starts.
Lets say you have a couple of wireless routers being used as hot spots (APs) and in turns, those use your main router as their gateway. Then your providers IP is another private IP. The code may not be able to determine where your network ends and where the providers starts.
In some cases, providers control everything from their plant to the Ethernet port or access point they provide at the customers home. All these devices are on the providers network and the customer gateway is inside the providers network. The code may show that the gateway is where the local network ends.
While software can do a lot, in non typical setups, it is assumed that the user knows their own environment and can take this into consideration.
There is something on the table about allowing the user to 'adjust' their networks so the algorithm is aware of each network. For example, the user could specify which hops are in their own network and the algorithm would simply know this when it tries to classify the networks.
The classification code will get better as we get feedback and read about how members are using the service. We do have tests happening even as I type this and as we confirm something works, are able to constantly replicate a good result, then we look at adding it into production. There are a few things being tested in terms of the classification, it just takes time to prove or disprove it.