The Supreme Court on Wednesday appeared to side with the City of San Francisco in its unusual challenge of federal water regulations that it said were too vague and could be interpreted too strictly.The outcome could have sweeping implications for curtailing water pollution offshore and would deal another blow to the Environmental Protection Agency, which has faced a string of losses at the court over its efforts to protect the environment.The case has given rise to unusual alliances, with the city joining oil companies and business groups in siding against the E.P.A. In arguments on Wednesday, it was the conservative justices who seemed the most aligned with a city best known as a liberal bastion.At its core, the case is about human waste and how San Francisco disposes of it — specifically, whether the Clean Water Act of 1972 allowed the E.P.A. to impose generic prohibitions on wastewater released into the Pacific Ocean and to penalize the city.Almost from the start, the justices appeared to wrestle with what was actually at stake in over an hour of highly technical arguments that centered on sewage discharge permits issued by the agency.Justice Clarence Thomas asked, “With this permit, what is at bottom the problem?”Tara M. Steeley, a deputy San Francisco city attorney, replied, “What at bottom is the problem is that permit holders don’t know what they need to do to comply.”She added that city officials do not have clear guidance about how to comply with a federal permit aimed at determining how much wastewater can be released without running afoul of the Clean Water Act.Under the current E.P.A. requirements, she said, San Francisco is “exposed to crushing criminal and civil penalties even when it otherwise complies with its 300-page permit.”She estimated that the city faced $10 billion in penalties from the federal government over the issue.Justice Sonia Sotomayor appeared skeptical of the city’s arguments. She focused on the practical matter of how much feces should be permitted to be released into the ocean.“I’m sorry, no one’s asking you to shift on a dime,” Justice Sotomayor said. “What they’re asking you to do is to become responsible for doing what’s necessary, not on a dime, but — nothing in the E.P.A. works on a dime — but to take the steps necessary to control situations that develop.”But Justice Brett M. Kavanaugh appeared receptive to the city’s concerns, expressing skepticism toward the arguments raised by Frederick Liu, an assistant to the solicitor general, who contended that the E.P.A. does have the power to issue broad guidelines.Justice Kavanaugh questioned whether the federal government was going after San Francisco “based on the past when they didn’t know what the relevant limitation on them was and seek retroactively, without fair notice, huge penalties, including criminal punishment” based on unclear standards.Mr. Liu accused San Francisco of failing to provide the federal government with detailed information about its sewage system.“Without that information, we’re basically flying blind as to how we’re going to tell exactly what San Francisco should do to protect water quality,” he said.The case poses another test of federal agency power and will be the first chance for the court to address the effect of its landmark decision last term overruling the Chevron precedent.For decades, courts had relied on the precedent, Chevron v. Natural Resources Defense Council, which held that courts should defer to federal agencies and their expertise when interpreting ambiguous laws.Still, the case heard Wednesday, San Francisco v. Environmental Protection Agency, No. 23-753, is a departure from more recent challenges to the E.P.A. brought by attorneys general in Republican-led states that directly seek to curtail the agency’s power.Instead, San Francisco sued the E.P.A. during the Trump administration, and officials have pushed back on the idea that the case is a challenge to the federal government’s ability to regulate the environment. Its challenge, the city says, aims to clarify the provisions of the city’s wastewater permit so that San Francisco can comply with the Clean Water Act.