You could do that, and another option if it wasn't a front lawn would be to take the hardware cloth and line the bottom of a garden
fence around the beds instead. The channel Back to Reality just made a video about it which explains it well. (Edit: they take a 3 foot
fence and bend it into an L shape, with half extending out away from the fence so critters can't as easily dig under.)
If a 1.5 foot tall fence around the garden area fits the looks of the front yard, then you wouldn't have it corroding as quickly. Depends on the type of digging critters I guess.