Your dog will guard and protect you if you have created the appropriate bond ot trust and respect

All dogs naturally understand how to guard and protect. You need to build the appropriate bond and level of respect for them to want to protect and guard you.