(Bloomberg Opinion) -- San Francisco, long a vanguard of digital enlightenment, has just made a regressive mistake. This week, it became the first major city to prohibit its police force and government agencies from using facial-recognition technology.

Such a ban has an understandable appeal. Concerns about facial recognition are widespread among the public. In just a few years, the technology has advanced at a startling rate. Other countries are using it to repress their citizens, while Americans are accustomed to anonymity in public spaces. Abuses — accidental and otherwise — are all too easy to envision.

Simply banning the technology, though, is the wrong response to these worries.

The fact is, properly used, facial-recognition tools are a boon for governments and citizens alike. In some places, they’ve been deployed to protect borders and other vulnerable sites. In others, they’re helping to fight sex trafficking and find missing children. Police use them to identify suspects, track down fugitives, and speed up investigations. Last year, authorities used the technology to quickly identify the perpetrator in a horrific mass shooting in Maryland.

Down the road, the public benefits could be even more pronounced. Schools may use such software to spot sex offenders and other threats. Airports might use it to speed boarding and security procedures. It has great potential for improving public health. As the software improves, its benefits should only expand.

It’s natural to worry about abuses even so. But a China-style panopticon isn’t on the cards in the U.S. The Fourth Amendment protects citizens against unreasonable government intrusions, and the Supreme Court has forcefully applied it to digital technologies in recent years. Last year, the court ruled that the government may not access historical mobile-phone location data without a warrant, for instance. Overly broad uses of facial-recognition would undoubtedly face similar challenges.

The question, then, is what further rules are needed to maximize the benefits of this technology while minimizing harm.

One concern is data. A facial-recognition database differs in kind from one of fingerprints or DNA, because it’s likely to contain voluminous records on innocent people. That raises the probability of privacy violations or other misconduct. Access to such data should be limited to clearly defined purposes and subject to regular audits. One study found that only 17% of police agencies log database searches to guard against misuse; that should change.

For law-enforcement in particular, some added rules are needed. In most cases, police should use the technology only for a targeted purpose and not for generalized surveillance. Checking a facial-recognition database to identify a suspect who has been lawfully detained, for instance, is reasonable. Real-time monitoring of camera or video feeds should generally require a court order.

A final worry is discrimination. In some studies, facial-recognition software has been shown to misidentify women and ethnic minorities at disproportionate rates. Concerns have eased somewhat as the technology has improved, but public agencies must still be on guard for biases. A set of federal standards for testing and certifying such systems would help.

Like all new technologies, facial recognition can be used for good or for ill. Regulating its use in the private sector will be equally challenging, if not more so. But it’s up to policymakers to strike the right balance. Simply banning a tool with so much promise amounts to an abdication of that responsibility — and threatens to let fear stand in the way of real progress.

—Editors: Timothy Lavin, Clive Crook.

To contact the senior editor responsible for Bloomberg Opinion’s editorials: David Shipley at davidshipley@bloomberg.net, .

Editorials are written by the Bloomberg Opinion editorial board.

©2019 Bloomberg L.P.