U.S. Attorney General William Barr on Thursday delivered a stark warning to American executives courting business in China, cautioning that their efforts to win favor in the country could put them at risk of running afoul of a federal law requiring the disclosure of influence activities for foreign powers.

In a speech at the Gerald R. Ford Presidential Museum, Barr urged executives to be mindful of being “used” by the Chinese government and of the possible need to register as a “foreign agent” in connection with any influence efforts for a foreign company or government.