Bernie Sanders’ insurgent primary battle against Hillary Clinton may have been just an act, leaked e-mails reveal.

A May 26, 2015, memo — among a batch hacked from Clinton campaign chair John Podesta and newly released by WikiLeaks — cites an “agreement” between Sanders and Clinton that should have kept the Vermont senator from criticizing her wealth.

“This isn’t in keeping w the agreement,” Clinton campaign manager Robby Mook wrote to Podesta, referring to remarks by Sanders. “Since we clearly have some leverage, would be good to flag this for him.”

Sanders had made the supposedly offending critique during a CNBC interview in reply to a direct question about Clinton’s fortune.

“When you hustle money like that, you don’t sit in restaurants like this,” he said. “I’m not going to condemn Hillary and Bill Clinton because they’ve made a lot of money. That type of wealth has the potential to isolate you from the reality of the world.”

Although far from scathing, the remarks were enough to spark a round of spinning and strategizing in the Clinton camp, the memo chain shows.

“Trying to get reporters to write that HRC and Bernie are actually in the same place,” staffer Christina Reynolds wrote. “We’re working on talking points for surrogates now.”

In December, a strategy memo — written a full two months before Democrats started voting in caucuses and primaries — presumed Sanders would endorse Clinton.

“Demonstrate unity through POTUS, Sanders, O’M and other endorsements,” Mook wrote in a “transition concept” outline meant to guide the campaign once Clinton clinched the nomination.

“O’M” refers to Maryland Gov. Martin O’Malley, who was still in the Democratic primary race at that point.

“Secondary objective will be communicating Democratic unity and using Sanders and others to help drive contrast and urgency,” Mook wrote.

Meanwhile, Sanders and Clinton held a joint conference call with millennial voters Saturday to shore up her support in a demographic that has still not warmed to her.

“The future of the planet is at stake,” he said.