The race for Suffolk County district attorney broke new ground Tuesday, hosting a candidates' forum within a jail — believed to be the first forum of its kind.

On Tuesday, inmates at the Suffolk County House of Correction asked questions of the six people running for district attorney. Suffolk County Sheriff Steve Tompkins said he wanted the candidates to hear from people in his jail who are directly affected by a district attorney.

"This has been an engagement in the civics process and if anyone thinks that folks that are inside an incarceration facility do not have anything to say that's going to move our society forward, they are diabolically wrong," he said.

A large institutional room at the Suffolk County House of Correction at South Bay was the setting for this unusual forum. The candidates took a dozen questions from a few of the 1,600 people incarcerated there.

The group of six includes five Democrats and one independent — Michael Maloney, a defense attorney. The others are state Rep. Evandro Carvalho, former general counsel for Massport Rachael Rollins, attorney Linda Champion, former public defender Shannon McAuliffe and Greg Henning, a prosecutor in the district attorney's office.

One of the questions revolved around the opioid epidemic.

"What is your plan to deal with the opioid epidemic? Do you feel diversion programs are the way out, or do you feel you can punish addicts out of it?" asked Michael Murphy, 38, who is being held in pretrial detention.

All of the candidates said prosecutors should not punish people for addiction.

The six agreed on most issues, saying they would hold police officers accountable, and that they would not try to deport someone for a nonviolent crime. And they all agreed that the bail system needs reform.

Where they primarily tried to distinguish themselves was by highlighting their personal stories, which sometimes included their own experiences with the criminal justice system — ranging from their own arrest to family members' experiences with addiction, to working as an attorney within the system.

The race is also unusual in that it marks the first time in decades that the incumbent isn't running. Current District Attorney Dan Conley, widely known as a conservative prosecutor, has held the post for 16 years. The office handles some 30,000 criminal cases a year from Boston, Chelsea, Revere and Winthrop.

Several of the 25 incarcerated people who attended the forum said they appreciated the opportunity to ask questions of candidates who potentially could directly affect their lives.

"It made me feel really good. I feel like we have voices and it was big change and I liked that. Yeah, it made me feel good," said Tatiana Ortiz, 27.

Murphy, the man who asked about the opioid epidemic, said if his case gets settled and he's out in time to vote, the forum will influence his choice. In Massachusetts, someone convicted of a felony is able to vote after completing their sentence.

But Murphy also wondered if the candidates played to their audience.

"They all kind of agreed on the same things," he said. "It would be interesting to see how they answer the questions to a different group than us, you know?"

This forum was co-hosted by the American Civil Liberties and Suffolk County Sheriff. The primary election is Sept. 4.

Correction: An earlier version of this story misspelled Rachael Rollins' name and incorrectly stated her title. We regret the error.