At what minimum depth is trench protection or sloping of the ditch mandatory?

At what minimum depth is trench protection or sloping of the ditch mandatory?