Previous plans to clean the rocks had been stymied by a morass of state and federal regulations protecting the environmentally sensitive stretch of coastline in northern San Diego, where seals, sea lions, scuba divers, swimmers, tourists, former presidential candidates and the panoply of birds all congregate. The pretty cove is home to the area’s finest restaurants and most expensive homes.

The bacterial solution, city officials insisted, would not run off into the ocean. As a result, the city could forgo the lengthy permit process that would have been required to power-wash the cliffs.

Standing near the workers on Wednesday, Antonette Gutierrez, a senior biologist with Merkel & Associates, kept an eye on the birds and sea mammals to make sure they were not disturbed. Several times this week, work was stopped when the wind picked up, to make sure the bacterial foam did not blow into the ocean. Rain would theoretically also halt work for the day (theoretically — this is Southern California).

“We don’t want to disrupt the nesting birds tending to their chicks,” Ms. Gutierrez said. “As far as the seals and the sea lions, we’re just monitoring them to make sure if there’s any aggression — really towards us — that we just back away.”