The Neutrality Act of 1794 makes it illegal for an American citizen to wage war against any country at peace with the United States
https://en.wikipedia.org/wiki/Neutrality_Act_of_1794
18 U.S. Code § 960.Expedition against friendly nation
https://www.law.cornell.edu/uscode/text/18/960
Contemporary application: A Texas businessman convicted of plotting to violate the U.S. Neutrality Act in a failed 2014 bid to overthrow the government of Gambia and install himself as president of the tiny African nation was sentenced on Thursday to a year in prison.
https://www.reuters.com/article/us-usa-gambia-plot-idUSKCN0Y...