The book says it works like this:
I cast the spell on you and tell you to protect me. You'll therefore attack anyone who attacks me. If I tell you to go for a walk, you'll go and keep walking until I tell you to stop, although you will eat, sleep, et cetera. If, however, I tell you to kill...