WASHINGTON — The Justice Department sought on Monday to tightly hem in this week’s congressional testimony by the former special counsel, Robert S. Mueller III, telling him in a letter that he “must remain within the boundaries” of the public version of his report on the Russia investigation.

The department also told Mr. Mueller that he could not “discuss the conduct of uncharged third parties,” like President Trump, his family and his closest associates, nor could he discuss “the redacted portions of the public version of your report.”

“Should you testify, the department understands that testimony regarding the work of the special counsel’s office will be governed by the terms you outlined on May 29,” the department said, referring to a rare public news conference by Mr. Mueller in which he said he would appear before lawmakers only reluctantly, and would not discuss any matters not contained in his 448-page report.

“The report is my testimony,” Mr. Mueller said then.

Mr. Mueller, 74, is scheduled to appear before the House Judiciary and Intelligence Committees on Wednesday to answer questions about his two-year inquiry into Russia’s plot to undermine the 2016 election and any links to Mr. Trump’s campaign, as well as about the president’s efforts to thwart the investigation.