I think you are quite close to what going in our best friend's mind.
We had a dog who liked to bark in front of our bedroom windows -- to let us know something out there -- so that we should get up and investigate. Sadly she died of old age of 16 years. Before that we had another dog who would never ask for our permission to chase any other invaders out of our boundary. He was poisoned!
Dogs are friends with personalities!