The legislation on the practice of espionage is now so widely defined that neither does the person of interest need to be in contact with a foreign power, they needn't even intend their activities to be helpful to another country... only that activities would likely be of interest to that foreign power;
you will be both fascinated & (i'll wager) rather worried by section 3 of the new National Security Act as discussed by @davidallengreen
https://theemptycity.com/blog/2026/03/the-curious-section-3-of-the-new-national-security-act/