They can be sneaky buggers!!! Just take any basic protetion spell and use your pets names and state your intent. Anything can be adapted.
As for no roaming a good checking and repairing of your fence line should solve that. For the dog. Cats well.... There cats and fences and doors are mere inconviences to them. Good luck and blessed be to you and your pets.