(g) Any person qualified to practice law, insofar as he engages or agrees to engage in the legal representation of a disclosed foreign principal before any court of law or any agency of the Government of the United States: Provided, That for the purposes of this subsection legal representation does not include attempts to influence or persuade agency personnel or officials other than in the course