A separate U.S. law dating back to 1794, the Neutrality Act, prohibits citizens from making war against foreign governments at peace with Washington and carries a prison sentence of up to three years. The law, which could technically apply to volunteer military action against Russia, was used to prosecute Americans involved in an attempted coup in Gambia in 2014.
But otherwise it has been rarely enforced in modern history, according to David Malet, a professor at American University in Washington, D.C. "Absent links to domestic terrorism, it's hard for me to imagine Americans being prosecuted for going to Ukraine," Malet said.