The term “enemies,” as used in the constitutional clause defining treason (Const, art. 3, § 3), applies only to subjects of a foreign power in a state of open hostility with us; it does not embrace
rebels in insurrection against their own government.
Finally, the crime of treason by aiding an enemy can only be committed during a time of war.[7] Thus, to be convicted of treason by aiding an enemy, a person must give aid or comfort to a subject of a foreign power openly at war with the U.S. and the person must do so with an intent to betray the U.S.
In 1863 the Supreme Court limited treason thusly
https://uclawreview.org/2018/10/15/treason-what-is-it/amp/