In what is being billed as a victory for government transparency, the California Supreme Court ruled Thursday that officials from state and local government must disclose public records even if those records are stored on private devices or accounts.

The decision means text messages and emails sent by public employees are a matter of public record if they deal with government business.

The court did leave a fair amount of wiggle room in its ruling, providing only general guidance on where the line would be drawn for public and private information, which could create challenges for cities and municipalities as they determine what is considered official business and what is off limits.

According to the ruling, communications sent on personal cell phones and computers must be disclosed to the public if they “relate in some substantive way to the conduct of the public’s business.” Conversations making incidental mention of government business likely won’t be required to be made public.

“For example, the public might be titillated to learn that not all agency workers enjoy the company of their colleagues, or hold them in high regard. However, an employee’s electronic musings about a colleague’s personal shortcomings will often fall far short of being a “writing containing information relating to the conduct of the public’s business,” the court wrote.

The case dates back to 2009 when local environment activist Ted Smith filed a public records request seeking records of communications between San Jose government officials concerning a proposed downtown development effort in the city. His request yielded no materials from personal devices or accounts, and Smith sued.

City of San Jose and the County of Santa Clara, who were subject to Smith’s requests, argued the records could be exempted from the exempted from the California Public Records Act.

Smith won his original challenge in trial court but was defeated on appeal. The California Supreme Court ruling Thursday undoes that appeals court decision.

Now government agencies throughout the state of California will have to examine the content of messages from personal accounts—including the purpose of the message, who it was sent to, and whether the content falls within the scope of the official’s job.

“It is no answer to say, as did the Court of Appeal, that we must presume public officials conduct official business in the public’s best interest,” the court wrote. “The Constitution neither creates nor requires such an optimistic presumption. Indeed, the rationale behind the Act is that it is for the public to make that determination, based on information to which it is entitled under the law. Open access to government records is essential to verify that government officials are acting responsibly and held accountable to the public they serve.”