LOS ANGELES — Nine days after Nikolas Michaud’s latest heroin relapse, the skinny 27-year-old sat on a roof deck at a new drug rehabilitation clinic here. He picked up a bong, filled it with a pinch of marijuana, lit the leaves and inhaled.

All this took place in plain view of the clinic’s director.

“The rules here are a little lax,” Mr. Michaud said.

In almost any other rehab setting in the country, smoking pot would be a major infraction and a likely cause for being booted out. But here at High Sobriety — the clinic with a name that sounds like the title of a Cheech and Chong comeback movie — it is not just permitted, but part of the treatment.

The new clinic is experimenting with a concept made possible by the growing legalization of marijuana: that pot, rather than being a gateway into drugs, could be a gateway out.