President Trump’s personal lawyer—former New York City Mayor Rudy Giuliani—appears to have played a pivotal role in orchestrating the president’s designs with respect to Ukraine. Assuming the part of an unofficial diplomat, Giuliani reportedly met with a Ukrainian prosecutor and with a senior aide to Ukrainian President Volodymyr Zelensky in order to press for an investigation of former Vice President Joe Biden. In doing so, Giuliani appears to have sidelined the national security officials who manage U.S.-Ukraine relations, expressing views that do not reflect U.S. policy. Giuliani also may have facilitated the premature recall of U.S. Ambassador Marie Yovanovitch from her post in Kyiv. And while he kept Trump apprised of his activities, Giuliani apparently left other officials guessing about his agenda and the source of his authority.

Among many other legal issues, these developments raise a question about the Appointments Clause: Was it lawful for the president to dispatch an envoy to interface with a foreign government on his behalf, without first seeking the Senate’s advice and consent?

Some might suspect that the president’s reliance on Giuliani was unlawful. After all, the Constitution requires Senate confirmation for a broad range of diplomatic appointments—not only “Ambassadors” but also “other public Ministers.” Giuliani was not an ambassador, but if he was a “public Minister” in his role, then the unilateral manner in which Trump selected him would violate the requirement of Senate advice and consent.

Yet there are several reasons to reject such a possibility. First, long-standing practice holds that individuals do not qualify as public ministers if they carry out diplomatic activities in an unofficial capacity. The first example of this practice occurred in 1789, when President Washington sent Gouverneur Morris to London to inquire about British compliance with the Treaty of Paris. Rather than seek the Senate’s advice and consent in the endeavor, Washington acted alone, explaining that Morris would serve as a “private Agent” in order to limit the fallout from a potential British refusal to negotiate. Likewise, in 1794, Washington independently sent Samuel Bayard to London as an unofficial spokesperson for American merchants whose ships had been seized by the British. James Madison, among others, accepted these kinds of appointments because the agents “would have no rank as public characters, but be mere agents.”

In this regard, U.S. practice matched European understandings with which the Framers were familiar: Abraham de Wicquefort, one of the Enlightenment’s leading commentators on diplomatic affairs, explained that a public minister must either be officially recognized as such by a receiving government or hold a letter of commission. In Giuliani’s case, neither appears to have occurred: He did not hold a commission, and the government of Ukraine was reportedly uncertain about his status.

Second, another extended line of official practice maintains that individuals whose diplomatic functions are secret do not qualify as public ministers. President Zachary Taylor, for example, independently appointed A. Dudley Mann as a confidential agent to Hungary in 1849. During the Civil War, President Lincoln sent secret agents to England to negotiate war-related matters with the British. And Woodrow Wilson dispatched John Lind as a confidential agent to Mexico in 1913. This practice once again aligned with traditional European understandings, which held that the category of public ministers excludes individuals whose roles are known to receiving governments but hidden from the public at large.

Even opponents of unilateral appointments accepted this practice. For example, in 1831, Sen. Littleton Waller Tazewell criticized President Andrew Jackson’s decision to independently appoint agents to negotiate a treaty of navigation and commerce with the Ottoman Empire, but the senator also acknowledged “the power of the President to appoint secret agents when and how he pleases” (emphasis added). The effect in Giuliani’s case seems straightforward: Insofar as his initial contacts with Ukrainian officials were confidential at the time, Giuliani was not acting as a public minister.

Finally, ad hoc diplomatic agents do not qualify as public ministers insofar as the position they occupy is not an “office”—which the Supreme Court has defined as “a public station” or “employment” that is “conferred by the appointment of government” and “embraces the ideas of tenure, duration, emolument, and duties.” As I have argued elsewhere, substantial evidence suggests that the Framers conceived of many special envoys, treaty negotiators and other types of ad hoc diplomats as public ministers and “Officers of the United States”—even when the position in question was temporary and created for the completion of a single task. But modern practice no longer reflects the original understanding. As the Justice Department’s Office of Legal Counsel explained in 2007, a position “‘summoned into existence only for specific temporary purposes’” does not qualify as an “office” in the modern constitutional sense. Thus, to the extent that Giuliani’s responsibilities were temporary and ad hoc, it is quite likely that he did not hold an office of any kind.

Giuliani’s role in the Ukraine controversy raises plenty of serious legal questions about both his actions and those of President Trump. But the legality of Giuliani’s involvement under the Appointments Clause is not among them.