According to this informative administrative timeline of the Department of State by the Office of the Historian, one of the earliest laws the Congress passed concerning the State Department was the Logan Act.
January 30, 1799:
“An act for the punishment of certain crimes therein specified” (the Logan Act, 1 Stat. 613) conferred upon the Department of State the exclusive right to engage in negotiations with foreign governments.
The Act was passed following the unauthorized peace negotiations of one George Logan, a Pennsylvania state legislator and Quaker, with France.
The Logan Act was last updated in 1994, so I assume it's not just a quaint relic of the 18th Century, and violation of the Act is a felony. But, so far as I can tell, no one has ever been prosecuted for violating it. John Kerry probably won't be the first. Probably.