Take a black-market business that relies on cash. Move the business out of the shadows by giving it government oversight. Hire new regulators to keep watch on the business, all without any experience regulating a brand-new industry.
The result can be a recipe for government corruption.
Recent cases in Colorado and Washington are the first known instances of current or former pot regulators being accused of having improper dealings with the industry. The two recreational marijuana states are the nation's oldest, approving legal weed in defiance of federal law in 2012.
A pair of cases several years into the legal-weed experiment might not seem like much, but they give a black eye to all marijuana regulators and fuel old fears about the criminal element's influence.
In a case that has caught the U.S. Justice Department's attention, former Colorado marijuana enforcement officer Renee Rayton is accused of helping pot growers raise plants for illegal out-of-state sales.
State investigators say the marijuana warehouse inspector quit her job last year and immediately went to work for the illegal pot ring, taking an $8,000-a-month job.
A June 7 indictment says Rayton told the pot growers she could help them "get legal" through her contacts at the Colorado agency that oversees the marijuana industry. The indictment says Rayton had "vast knowledge" of marijuana regulations and "must have been aware" that other defendants in the case were growing pot illegally.
She is charged with conspiracy to illegally grow pot. Rayton's attorney told The Associated Press she is innocent.
In Washington, the state agency that regulates pot recently fired an employee who leased land to a prospective pot grower.
Marijuana licensing specialist Grant Bulski was leasing 25 acres to a marijuana entrepreneur for $2,834 a month, The Spokesman-Review reported . That violated Washington rules prohibiting state pot regulators from having a financial stake in the business. Bulski was not charged with a crime.
Messages left at numbers for a Grant Bulski in Olympia weren't returned.
Pot isn't the first product in the U.S. to go from illegal to legit. Alcohol and gambling made similar transitions last century.
But since recreational pot remains off-limits in most states and in the U.S. government's eyes, a massive black market remains.
"Marijuana is unique because it's so front and center in the public eye," said Lewis Koski, who became Colorado's top marijuana enforcement officer after regulating the gambling and alcohol industries.
Now a government consultant who teaches public policy at the University of Colorado-Denver, Koski said government employees who regulate any business face tension. Regulators know the industry they're monitoring well. And in the case of the marijuana business, those regulators have no guidance from federal authorities and little precedent to rely on.
And because the federal government considers all pot business illegal, making it difficult for those businesses to access banking products as basic as checking accounts, the pot industry remains cash-heavy.
U.S. Attorney General Jeff Sessions cited the Colorado case last month when he asked Congress not to renew a spending provision that prevents the Justice Department from spending tax money to interfere with state marijuana laws and businesses.
"It would be unwise for Congress to restrict the discretion of the Department to fund particular prosecutions," Sessions wrote in the letter first obtained by cannabis social network Massroots.com.
The Colorado and Washington cases were uncovered by state officials, not federal drug authorities. They highlight how critical it is for states to tightly regulate a business still coming out of the black market, Koski said.
"Both sides — government agencies and the industry — are working hard to establish credibility," Koski said. "So it makes it more concerning when you have people going back and forth."
Ethics watchdogs say the Colorado and Washington cases should spur pot states to beef up ethics commissions charged with monitoring conflicts of interest by government employees. Michigan, a medical-marijuana state, passed a 2016 law banning even relatives of its pot oversight board members from having any financial stake in the weed industry.
Poorly staffed ethics offices in some marijuana states aren't prepared to stop regulators leaving to work for the industries they once monitored, said Aaron Scherb, national legislative director for the government watchdog group Common Cause.
"It's like trying to keep water out of a sinking boat — you can do it for a while, but it's only a matter of time," he said.