People get very paranoid about others digging mine holes around them, usually a village will deny all hermits around them metal because they are afraid of the hermits getting an easy way into their village.
This is a rough solution, generally speaking though it implies that an above ground claim extends underground too.
Players with the mining skill have the option to fortify a cavern wall by using bricks and clay (ergo making it easier to fortify a cavern than the area above it). Same soak as a brick wall.
Walls can already be made in a cavern, so gates go as standard.
A little rough but something that would be very good to see once the devs are back in action ^_^