A federal magistrate judge on Monday clarified his order restricting the contact former Virginia governor Robert F. McDonnell and his wife can have with potential witnesses in the corruption case against them, saying the couple is barred from “substantive discussions about the case” with those who might be called to testify.

In a contentious, 20-minute hearing in U.S. District Court here, Magistrate Judge David J. Novak peppered an attorney for McDonnell (R) with questions and warnings and said his initial order that the McDonnells “have no contact with any witnesses or representatives of the government” was a standard one, designed to protect the couple from accusations of obstructing justice.

But in the end, Novak narrowed the restrictions slightly. He said the couple can talk about trivial matters with potential witnesses — who may include relatives and close friends — but can discuss “nothing about the substance of the case.”

“If they violate it, I’m going to put them in custody,” Novak said.

The McDonnells were charged last month in a 14-count indictment that alleges that they repeatedly asked wealthy Richmond businessman Jonnie R. Williams Sr. for loans and for gifts of money, clothes, golf fees and equipment, trips and private plane rides. In exchange, the McDonnells allegedly worked together to lend the prestige of the governor’s office to the businessman’s struggling company.

The McDonnells have pleaded not guilty, and a trial is scheduled for July 28.

Also on Monday, prosecutors filed paperwork resisting defense attorneys’ efforts to gain access to grand jury instructions and laying out a preview of how they plan to overcome some of the McDonnells’ challenges to their case. Prosecutors wrote that they would not need to show “a specific this-for-that correlation between each particular thing of value given and each particular official action performed or contemplated,” but only that McDonnell took gifts and acted on a sort-of “as needed” basis.

Monday’s hearing grew out of defense attorneys’ request that Novak relax his initial prohibition on the McDonnells’ contact with witnesses. The attorneys said the order could prevent the couple from talking with family members. They argued in court filings that the couple should be able to discuss the case around the dinner table and should be able to appeal personally to close friends to serve as character witnesses.

Novak said that his order would not apply to people who would be called exclusively as character witnesses and that McDonnell and his wife, Maureen, are free to talk about anything to each other. But he told the McDonnells to have no case-related discussions with anyone who might be called to testify about substantive matters — drawing no distinctions for friends and relatives or between prosecution and defense witnesses.

Novak ordered prosecutors and defense attorneys to exchange lists of possible witnesses by the close of business Wednesday.

Almost from the moment Novak took the bench, the proceedings were contentious. Before any pleasantries were exchanged, Novak said to McDonnell attorney John L. Brownlee: “It seems to me you might be the only criminal defense attorney in history who wants his client to talk to everybody. Why is that?”

Novak rejected Brownlee’s request that the court prohibit the McDonnells only from discussing the “substance of anyone’s testimony” with potential witnesses, saying they were barred from discussing the “substance about the case, period.” More than once he referred to McDonnell’s public statements and warned the former governor not to communicate with witnesses through “surrogates.”

Assistant U.S. Attorney Jessica Aber said that prosecutors did not object to Novak’s order and that it was always their intent to be “reasonable.” In court filings, prosecutors had said that they did not object to the McDonnells’ talking with relatives but that they should not discuss the case with them or contact others who might be called to testify.

After the hearing, the McDonnells did not offer substantive comment.