I had a dog that actually served that purpose during a period when a lot of female strangers should show up at my apartment, I came to let the dog decide if I would let them stay or not. It was a little stray Chihuahua that had adopted me, I came to trust her decision on whether a new female could spend the night.
My daughter's house was broken into a few years back. She called us at 9:00 p.m. to tell us that she had just gotten home and found her window broken. I told her to call 911 from her cell phone and don't go in. The police officer was there when I arrived and my Ridgeback walked over to him and treated him like a family member. A few minutes later the land lord arrived with a drunk friend and the dog wouldn't let them near us.