All gates leading inside your base should be Visitor Gates. Players passing through a Vgate can't commit crimes until they leave your claim.
HOWEVER: You can't go through a Vgate when you are in combat (even when the Vgate is open). A palisade with only Vgates is not a place to escape to when an animal or player is out to murder you. You can't get inside.
Your palisade needs Normal Gates. One entrance and one exit. This way you can enter your base during combat and with just a Slave Key.
You enter the locked cabin to break line-of-sight and disengage combat. Then travel to your hearthfire. Nobody will follow you into this construction. This can be used to trap players.

You don't need to copy my layout. Here's another example I found but it's lacking the log cabin.
The Vgate stays open so you can enter without a key (when not in combat). Other players can't open the fence gate behind the Vgate due to the visitor buff.

also read the Basic Claim Safety thread: https://www.havenandhearth.com/forum/viewtopic.php?f=42&t=72166