We understand we are at war. We can see the carnage. We need to mobilize the economy to beat the disease and achieve pandemic resilience. The coming challenge in our fight against the novel coronavirus is to massively scale up testing and contact tracing.

Let’s take the fight to the virus. But that can’t mean turning toward methods that trample civil liberties and disregard justice.

We need to get to work on two phases.

First, restarting our economy will require millions of tests a day. In the current phase of social distancing, we need to test to get as many people as possible back to work. We should use testing both to diagnose the symptomatic and their contacts and to find the “safe” — that is, to exempt people from the collective quarantine we are now living under. Tests should be distributed through a triage process that would prioritize health-care workers, child-care workers and other essential personnel. Unless they test positive for immunity, people exempt from social distancing requirements would have to be tested frequently and routinely confirm a negative test status.

As others have argued, we will comfortably be able to ease the current social distancing once four things are in place: a sustained reduction in cases for at least 14 days, hospitals’ capacity to manage all cases needing treatment, the capacity to test at the levels described above, and the capacity to supply personal protective equipment at scale, including for universal mask-wearing.

Then we hit the second phase. Once social distancing ends, the goal of the testing regimen would shift to identifying those who should be in individual quarantine. The symptomatic and their contacts would be tested, and there would be some random testing done, possibly targeted to geography or occupation. Anyone testing positive would be treated in quarantine.

But this presents a challenge: Tracing contacts at this scale requires technology. What about Big Brother? Won’t tech-supported contact tracing give the government or tech companies too much power? Not if we choose wisely now.

The concern is not unwarranted. During the HIV/AIDS crisis, government control of data about chains of association often put gay men in real jeopardy. Today, however, we can use peer-to-peer methods. For instance, developers are working on apps that permit people to opt in to GPS and Bluetooth-based data systems that will send them warnings if their phone has moved along the same path as the phone of someone else who has also opted in to the system and who has reported a positive test for the coronavirus.

In this way, contact tracing becomes contact warning: Friends make sure to warn friends to get tested. Integration with the public health system would still be necessary for monitoring of quarantine and testing patterns. But apps are under design that house most data on the user’s phone, and have largely anonymized data stored on a server using random tokens and secure keys, as is described in a white paper published Friday by a group of tech researchers.

Data should be further protected through an independent auditing system, perhaps run by the Department of Health and Human Services or the Centers for Disease Control and Prevention and therefore accountable to the public. And we need to ensure that vulnerable populations have access to the tests they need while also ensuring that testing is not used to support immigration or criminal justice surveillance.

We do need big tech and the government to help with this, but with the right kind of auditing, we the people can hold both accountable.

The more people participate, the more successful such a system can be. We currently have about 80 percent smartphone penetration in the country. But the figure is even higher among those not part of the high-risk groups that are more likely to maintain extensive social distancing for the durationof the outbreak anyway. To make access universal, Medicaid and Medicare could supply rudimentary WiFi-enabled phones to those who do not have them to make testing and warning universal.

AIDS testing became more workable when it evolved into a project owned by the community of activists and advocates. The same principle applies now. If we own our data, and take responsibility for its use as a matter of civic duty and solidarity by opting in to a tracing and warning system, we can protect our civil liberties and meet our public health and economic needs simultaneously.

Remember, collective social distancing and mass testing are themselves infringements on civil liberties. In the law and ethics of quarantine, individual quarantine is preferable to collective quarantine. So, too, less testing is preferable to more testing. Maximizing the value of testing and minimizing its footprint requires contact tracing. A peer-to-peer app-based system is the method for carrying it out that is best aligned with our civil liberties and justice standards.

Liberty, justice, health and prosperity for all. Any testing and contact-tracing infrastructure we build must deliver all four for everyone.

Read more: