I find that does are more inclined to dig than the bucks. There are two ways to deal with digging that apply to your situation.
First option is to bury fencing around the perimeter to a depth of 24". There could still be breakouts, so monitoring the perimeter is needed.
Second option is to remove 24" of soil and bury fencing to cover the area of the pen and vertically to connect to the lower edge of the above ground fencing, then back fill the topsoil. This is most secure.
For both solutions, I have found that providing some areas of "cover" can guide their digging. A piece of corrugated tin, a tree stump to hold up the tin, some long "benches" as tunnels. You will still need to be careful walking around due to shallow tunneling
The bucks at my place get individual runs of about 18" x 36" with walls and topwire. Not all bucks want to see a neighbor so be prepared to provide blocker ... wire tie and an opened feed bag, scrap piece of plywood, etc. There seems to always be a buck that insists on being top buck, so topwire is required, randy buck has to be restrained LOL