Fence and a gate. Then shut it. Then lock it.

Works around here.