The Lieber Code, also known as General Order Number 100 dictated how Union troops were to conduct themselves. The Code was named for its creator Francis Lieber a professor at Columbia College in New York City, and was signed into law by President Abraham Lincoln April 24th 1863. It included humane treatment of people in occupied areas, and forbade the giving of “no quarter” to prisoners. The code also covered the use of torture, how to treat POW’s and what was a permissible means to use end insurrections.
The Code was a predecessor to the Hague Regulations, written in 1907.
If you’re interested in reading the original law I recommend General Orders No. 100 : The Lieber Code