I understand that an "invisible" fence sounds like the perfect solution, but as the story in the link by the moderator sadly illustrates, there are things that are too tempting for a dog. There is also the issue of getting shocked or beeped or whatever upon going through the "fence" and not desiring to return due to the undesirable consequences experienced. Please put up a real fence or take the dog out on a leash at all times. This my humble opinion.