Twenty-one anonymous New Yorkers are suing Airbnb to block the lodging website from releasing their personal information to the state’s attorney general for his probe of illegal hotels.

Under the name “New Yorkers Making Ends Meet in the Sharing Economy,” the John and Jane Does claim the California-based startup would violate their privacy rights if it handed over their names, email addresses, telephone numbers, social media accounts and tax identification numbers to AG Eric Schneiderman.

“This is treason!” Adam Leitman Bailey, the hosts’ attorney, warned in an interview with The Post.

The Manhattan civil suit says Airbnb conducted “secret negotiations” with the AG to hand over information for 124 users the company dubbed “bad actors” who violated their policies.

The 130 hosts were informed on Aug. 22 that Airbnb would be handing over their information on Sept. 2. The company told hosts that the agreement protects “thousands of regular New Yorkers.”

But the anonymous New Yorkers include a single mother and an unemployed attorney who are in good standing with the site’s rules, said Bailey.

“Airbnb holds itself out as a ‘trusted community’ marketplace for people to list, discover and book unique accommodations around the world, online or from a mobile phone,” the court papers state.

The $10 billion company violated that trust by cutting the hosts out of its deal-making with the attorney general, who filed a subpoena for the information, the suit says.

Bailey said Airbnb agreed to delay the handover since the suit was filed.

​​A rep for Airbnb said, “Last month, we followed our normal procedures and notified a small number of hosts that their data had been requested by the New York Attorney General under a subpoena. We will not take action with data from hosts who have previously filed suit until the court makes a decision and we will respect the court’s decision.”

A spokesman for the AG declined to comment.

Last spring a judge ruled that online hoteliers violate city code and state law. Still, an estimated 3,000 New Yorkers rent out their apartments to visitors, making an expected $1 billion in profits.