Blake wrote:
https://armyhistory.org/mine-warfare-in-the-civil-war/
Good article on mine usage. Much more common than I thought.
In response to the mines, Major General George B. McClellan, who also had been an American observer of the Crimean War, vowed to “make the prisoners remove [the mines] at their own peril,” and soon began ordering Confederate prisoners to clear mines at Yorktown. This threat was repeated by Major General William Sherman and Read Admiral David Dixon Porter later in the war.
McClellan was not a "hard war" advocate but even he understood that in the age before "mine detectors" that using enemy prisoners made sense. As a commanding officer, are you going to order your men to walk across a mined area and take the punishment... knowing they may later shoot you in the back in a future battle for risking their lives? Or, will you make the soldiers happy, and have those that planted them act as detectors to save the lives of your men? Or, from the other side, if you were a private in the 2nd Mississippi and the Yankees planted mines all around Washington and Early says, "hey, Swanson, march on ahead and see if that road is booby-trapped!" Are you saluting and saying, "yes, sir," or are you looking at the Yankee captives and saying, "I think I have a better idea."
In the end, Gabriel Rains (CSA) best captured the moral dilemma of mine warfare, stating, “Each new invention of war has been assailed and denounced as barbarous and anti-Christian, yet each in its turn notwithstanding has taken its position by the universal consent of nations according to its efficiency in human slaughter.” I'm sorry but it's against the Union's own rules (
https://www.generalstaff.org/WFA/Dox/WD_GO-100.htm) to utilise prisoners in such a manner. Specifically [my emphasis in bold]:
56. A prisoner of war is subject to no punishment for being a public enemy,
nor is any revenge wreaked upon him by the intentional infliction of any suffering, or disgrace, by cruel imprisonment, want of food,
by mutilation, death, or any other barbarity.
68. Modern wars are not internecine wars ...
Unnecessary or revengeful destruction of life is not lawful.
71.
Whoever intentionally inflicts additional wounds on an enemy already wholly disabled, or kills such an enemy, or who orders or encourages soldiers to do so,
shall suffer death ...
75.
Prisoners of war are subject to confinement or imprisonment such as may be deemed necessary on account of safety, but they
are to be subjected to no other intentional suffering or indignity.
As those rules were only in place from 24 April 1863 that
may excuse earlier incidents. However, they still would have been bound by other laws of war and the expectation that they behave in a manner befitting an officer. The other complication for earlier incidents was that the U.S.A. didn't recognise the Confederacy as another State so they may not have seen the conflict as an international one. Still, practical necessity (the Confederates were also capturing Union combatants) meant that 'prisoners of war' is what they were, even before General Order 100.
However, there is no excuse for Sherman. General Order 100 had been in place for more than a year before the actions described earlier. That he took pleasure in such things makes it all the worse.