A federal judge has denied President Donald Trump’s attorney Rudy Giuliani’s request for the return of a trove of digital information seized by the FBI in a raid on his Manhattan home and office last month as part of an investigation into potential violations of foreign lobbying laws.

However, in a written order issued Friday, U.S. District Court Judge Paul Oetken stated that he will appoint an outside lawyer as a so-called special master to oversee the process of ensuring that investigators do not obtain access to attorney-client privileged materials to which they are not entitled. “The Court agrees that the appointment of a special master is warranted here to ensure the perception of fairness,” Oetken wrote.

Prosecutors from the United States Attorney’s Office in Manhattan requested the special master’s appointment, citing a precedent from a similar seizure of information from former Trump attorney Michael Cohen in 2019.

The judge denied Giuliani’s lawyers’ request that the FBI’s seizures of 18 computers and other devices be essentially reversed, and that prosecutors instead proceed by subpoenaing information from Giuliani and letting him decide what to produce in response. Oetken also denied Giuliani’s attorneys’ request for the return of information secretly seized from his iCloud account in 2019 as well as access to the affidavits the government used to obtain the search warrants. The judge stated that Giuliani appeared to be attempting to gain insight into the government’s investigation of him, but he does not have that right at this time.

“He is not entitled to a preview of the Government’s evidence in an ongoing investigation before he has been charged with a crime,” wrote Oetken, a former President Barack Obama appointee. “Of course, if Giuliani is charged with a crime, he will be entitled to production of the search warrant affidavits… But such disclosure is premature at this time.” Federal prosecutors have been looking into Giuliani’s work in Ukraine in 2019 and 2020 as part of a larger effort to spark investigations there that could have been politically damaging to President Joe Biden, who was seen at the time as a strong potential challenger to Trump.

Giuliani has claimed that his Ukraine-related efforts were made on Trump’s behalf, but prosecutors appear to believe that the former New York City mayor was attempting to influence U.S. government decisions on behalf of Ukrainian officials or individuals.

According to Giuliani’s lawyers, prosecutors are looking into potential violations of the Foreign Agents Registration Act and a similar criminal law that prohibits acting in the United States as an agent of a foreign government without first registering.

Oetken also denied parallel requests from Victoria Toensing, a Washington-area attorney whose phone was seized on the same day as Giuliani’s raids and who also worked on Ukraine-related matters. Her phone was returned, but she appeared to be requesting that the government erase the information it had obtained from the device as well as during an earlier search of her online accounts.

“Lawyers are not immune from criminal investigation searches,” the judge wrote. “These materials were obtained in accordance with search warrants based on probable cause, and the Government’s investigation is ongoing. The government’s retention of them is neither improper nor illegal.”

Both Giuliani and Toensing will be able to review the seized materials, just like the special master, and make recommendations on what should be kept from investigators as privileged, according to Oetken. He did not immediately appoint a special master in the case, but he did request proposals from both parties by June 4.