A consortium of 14 banks, led by Goldman Sachs, closed Wednesday on a $66 million investment into a highly secure messaging app that has a nifty little feature — it allows bank compliance officers to monitor messages in real time.

The feature, not available on Wall Street’s ubiquitous Bloomberg messaging service, could stop nonkosher messages — that contain language about rigging the market or trading against a customer’s interest — from being sent.

Such embarrassing messages sent by unscrupulous bankers via the Bloomberg system have been obtained by regulators and used against banks in court cases.

The new service, formerly called Perzo but renamed Symphony, could prevent those messages from becoming public, Symphony Chief Executive Officer David Gurle told The Post.

“In the last few months, there were lots of issues with that,” Gurle said, referring to instant messages that have been used to show that currency or interest-rate benchmarks were deliberately rigged.