Nxivm’s sex slaves had to demonstrate the ultimate loyalty to their masters — by inking non-compete contracts, a former member testified Monday.

The ex-slave, referred to as Nicole in Brooklyn federal court, said her “master,’’ “Smallville’’ TV actress Allison Mack, told her she had to sign the document in 2017.

Nicole — who said she was ordered to call Allison “Madame Mack” — added that she was told she also had to sign other papers that would release the accused cult of liability for such things as “physical and psychological injuries” and “disfigurement.”

The former sex slave, who was branded with a cauterizing pen, said she even had to sign an agreement stating that anything she created could be published under leader Keith Raniere’s name.

Nicole said she didn’t want to sign the papers and ultimately never did because Mack grew distracted and apparently forgot about them.

Another slave, identified only as Sylvie, previously testified of signing similar papers for her master, who was not Mack.

Later Monday, jurors heard testimony from a woman called “Jay” who said she became a member of Nxivm’s master-slave group, DOS, under India Oxenberg.

The 29-year-old woman said Oxenberg — the daughter of “Dynasty” TV actress Catherine Oxenberg — told her the group was “controversial” but that belonging to it would be good for her.

“It’s very controversial, it’s meant to be shocking,” the model and actress said Oxenberg told her of DOS’s practices. “I’m actually your master, and you’re actually my slave.”

To join the group, Jay told jurors, she turned over four pieces of “collateral,” including a truthful video confession in which she talked about being molested by her uncle, and a sex tape involving her and an ex-boyfriend.

Oxenberg, who has royal blood, allegedly told her she personally turned over unspecified family heirlooms as her collateral.

Jay testified that while the alleged sex cult in Nxivm was known as DOS, Mack also called it “The Agency” — because “her slaves were all actresses and models and were beautiful, so it was as if she was running an agency.”

Prosecutors say DOS slaves were branded with Raniere’s initials and kept on near-starvation diets to align with his sexual preferences — when he was able to perform.

Multiple witnesses, including Nicole, have testified that the accused sex cult “Grandmaster” suffered from erectile dysfunction.

Raniere is on trial for sex trafficking and other charges. Mack and other alleged accomplices have copped plea deals.