confine (someone or something) within (something)
To restrict a person or animal to a particular place or area. Don't worry, I confined the baby within her playpen. Maddy is scared of dogs, so we need to confine Fido within the back yard.
confine (someone or an animal) within something
to contain someone or an animal within something. We were unable to confine the dog within the yard. Could you confine all your car-repair mess within the garage?