Former Madoff Chief Financial Officer Frank DiPascali, an admitted fraudster turned star government witness in a trial of five former co-workers, told a Manhattan federal jury on Monday that in 2005 his ex-boss once placed two Securities and Exchange Commission investigators assigned to probe his firm in a glass-walled office for a week — so he could “spy” on them.

DiPascali also revealed that Madoff even searched through one of the government investigator’s briefcases when he wasn’t around — and freaked out after discovering a copy of a 2001 article from Barron’s magazine.

That article quoted financial experts who were skeptical with how Madoff made money through his investment advisory business, which years later would be revealed as the source of the epic $65 billion fraud. DiPascali said Madoff was under the impression that the auditors were there to review his “legitimate” proprietary-trading business.

DiPascali said the entire firm then went into panic mode and that he personally had a conversation with two of the ex-Madoff staffers on trial for fraud – computer programmers Jerome O’Hara and George Perez – about “bugging” the office being used by the SEC probers.

“We discussed the possibility of purchasing equipment that would bug the room they were using, so we could learn the scope of what they were doing,” said DiPascali, adding they never followed through with the plan.

Madoff staffers, however, did begin “scrubbing” emails from office servers that would’ve raised red flags for the SEC, he added.