Sometimes I think this is just something the dog does, or it doesn't. Bristol has never strayed, sits on the deck, or lays close to me as I garden, but he doesn't leave. Even when he sees other dogs. Never really trained him, it's just his way. Now Selby will stay as long as I am close enough to block her. She will leave in a heartbeat. I like her with me, so I will use a tie out. Maybe she will eventually learn, but this little 4lb girl who is afraid of noises, and sometimes sudden movements, will scamper of to the wild unknown of the park across the street with no hesitation.
The main worry I would have if you weren't out with them, even for just a minute or two, is what other dog could come into your yard and hurt them, even before you have a chance of getting them to safety.