The risks of providing legal advice to marijuana businesses became clear to Jessica McElfresh in the early morning of May 24 when law enforcement agents started banging on the front door of her Rancho Sante Fe home in southern California.

The authorities had a search warrant. An attorney with experience in criminal defense, McElfresh, still in her pajamas, let the officers in. She, her boyfriend and her mother were handcuffed as the police searched for files, computers, cellphones and thumb drives.

“My first thought actually was, they had the wrong house,” McElfresh told The Recorder in an interview. “Then I thought I was being spoofed. And then, ultimately, I thought they were simply seeking clients’ files.”

Jessica McElfresh

It wasn’t until McElfresh read the warrant that she realized she was facing seven felony charges. The San Diego County District Attorney’s Office accused her of conspiring with James Slatic, a prominent cannabis-infused products distributor, to hide evidence of an illegal hash oil operation in Kearny Mesa from inspectors. Slatic and four employees of his business, Med-West Distribution, were also charged. Agents would later search McElfresh’s San Diego office.

McElfresh, a solo practitioner who represents marijuana enterprises and criminal defendants, pleaded not guilty to the charges in June.

The prosecution of McElfresh has raised alarms among lawyers who serve the cannabis industry both for the charges she is facing and the wide scope of documents that prosecutors have sought to look at. McElfresh and her attorney, Eugene Iredale of Iredale and Yoo in San Diego, have fought prosecutors for months to narrow the scope of that document search, arguing that files related to medical marijuana businesses McElfresh represents should remain off-limits.

“The DA’s office has been very comfortable suggesting in state court that none of my clients, no matter what my intentions or how I could have acted, enjoy attorney-client privilege because marijuana is illegal under federal law,” McElfresh said in the interview. “I think that that’s a strange position for a state and local California prosecution office to take.”

[We Asked 4 Marijuana-Industry Lawyers 4 Questions. Here's What They Said]

Prosecutors have said they’re not going after privileged information. A special master was appointed to separate those documents covered by the warrant from those that are not. The DA’s office contends emails and records tied to Med-West Distribution and Slatic are not protected.

“This case is not about marijuana,” Deputy District Attorney Jorge Del Portillo said at McElfresh’s June 15 arraignment. “This is a case against a dishonest marijuana company that lied to city inspectors about what they were doing and lied to their patients about what they were selling.”

‘First Responders to an Emerging Industry’

Lawyers serving state-legal dispensaries have always walked the fine and sometimes murky line between counseling clients on conflicting state and federal laws on marijuana.

Local bar associations in San Francisco and Los Angeles have issued opinions concluding that attorneys may ethically represent clients legally operating medical marijuana operations. Legislation awaiting action by Gov. Jerry Brown would clarify in statute that lawyers can counsel legal marijuana businesses without violating ethical duties or violating attorney-client privilege.

The police action against McElfresh so concerned cannabis industry attorneys that the two-year-old National Cannabis Bar Association submitted its first-ever amicus curiae brief—backing McElfresh—in any case. The group threw its support behind McElfresh’s effort to narrow the search warrant and to assert attorney-client privilege.

“Attorneys representing cannabis clients should not be bereft of the privacy and confidentiality normally afforded to clients merely because they serve as first responders to an emerging industry that happens to be caught in the crosshairs of conflicting state and federal law,” attorneys Omar Figueroa, Stacy Hostetter and Lauren Mendelsohn wrote on behalf of the cannabis bar group.

[IRS Lawyer Says the Agency Isn't Targeting Cannabis Lawyers]

McElfresh and her supporters may have secured a partial victory last week.

On Sept. 27, a San Diego judge indicated she would restrict at least the initial search of the lawyer’s records to only those names and companies identified in the first paragraphs of the warrant, according to Iredale and a spokeswoman for the district attorney’s office.

The judge also said she would order the disclosure of the identity of a confidential informant whose affidavit was used to secure the warrant, while giving the DA’s office enough time to challenge that decision in an appellate court.

Iredale said he will submit a proposed order to the court based on the judge’s directions in the coming weeks.

Prosecutors contend McElfresh lied to a city inspector in April 2015 by telling him during a walk-through of Med-West that the building “was only a paper and packaging company” with no marijuana on-site.

The DA’s office produced portions of a December 2015 email—approved by a judge for use in filing the criminal charges—from McElfresh to Slatic saying she was “convinced” inspectors “walked away knowing it wasn’t a dispensary in the typical sense … but it probably seemed like something other than just paper.”

Prosecutors say the building was really being used improperly to manufacture hash oil for distribution around the country. Slatic and the other defendants have denied the charges. Another hearing in the case is scheduled for next month.

McElfresh said she continues to work and has received messages of support from lawyers around the country. Asked if she cautions other attorneys about the risks of her practice, McElfresh said “I think the San Diego DA’s Office has already told them they’re at risk.”

Cheryl Miller, based in Sacramento, covers the state legislature and emerging industries, including autonomous vehicles and marijuana. Contact her at cmiller@alm.com. On Twitter: @CapitalAccounts

Read More:

Legal Marijuana: Budding Industry, Burning Questions

Q&A: Greenbridge Corporate Counsel’s Founder Khurshid Khoja

California’s Pot Chief Says She’s Not Focusing on Feds

California’s Cannabis Agency Takes to Instagram, Hashtags and All

Why Some California Counties Are Saying No to Commercial Cannabis